Skip to content

Move dependency from openapi-alps to azure-rest-api-specs #309

Open

Description

  • Add @azure/openapi-diff to azure-rest-api-specs/package.json
  • Update all code in openapi-alps to call npm exec --no -- oad compare instead of importing @azure/oad
  • Publish openapi-alps, verify BreakingChanges still works
  • Remove @azure/openapi-diff completely from openapi-alps

Activity

  1. konrad-jamrozik commented on Mar 23, 2024

    @konrad-jamrozik

    Update all code in openapi-alps to call npm exec --no -- oad compare instead of importing @azure/oad

    Will it make somehow harder to pass arguments and capture output? Like, what if the code throws? We will have to manually parse exception from the stdout or stderr? I understand in case of API call this is easier.

    For reference, this is an example API call right now:

        oadCompareOutput = await oad.compareTags(oldSpec, oldTag, newSpec, newTag, {
          consoleLogLevel: "warn",
        });
    
  2. konrad-jamrozik commented on Mar 23, 2024

    @konrad-jamrozik

    The only dependency on oad and/or openapi-diff in openapi-alps is in the Azure DevOps extension breaking-change.ts and its package.json.

  3. mikeharder commented on Mar 23, 2024

    @mikeharder
    ContributorAuthor

    Update all code in openapi-alps to call npm exec --no -- oad compare instead of importing @azure/oad

    Will it make somehow harder to pass arguments and capture output? Like, what if the code throws? We will have to manually parse exception from the stdout or stderr? I understand in case of API call this is easier.

    For reference, this is an example API call right now:

        oadCompareOutput = await oad.compareTags(oldSpec, oldTag, newSpec, newTag, {
          consoleLogLevel: "warn",
        });
    

    I think our tools should move away from sharing code/APIs and towards sharing data over stdin/stdout. The https://en.wikipedia.org/wiki/Unix_philosophy. Because it allows interop between our own tools and third-party tools, and our own tools written in different langauges.

    But either way, I think pinning the version of @azure/oad directly in azure-rest-api-specs will simplify updates enough to be worth any tradeoffs. It's one small step to getting everything out of openapi-alps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions