Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 tasks
mikeharder opened this issue Mar 23, 2024 · 3 comments
Open
4 tasks

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

mikeharder opened this issue Mar 23, 2024 · 3 comments
Assignees

Comments

@mikeharder
Copy link
Member

  • 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
@mikeharder mikeharder self-assigned this Mar 23, 2024
@konrad-jamrozik
Copy link

konrad-jamrozik commented Mar 23, 2024

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",
    });

@konrad-jamrozik
Copy link

konrad-jamrozik commented Mar 23, 2024

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.

@mikeharder
Copy link
Member Author

mikeharder commented Mar 23, 2024

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
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants