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

fix(ci,oas) move oas ci script to a package under the oas workspace #3391

Merged
merged 3 commits into from
Mar 7, 2023

Conversation

patrick-medusajs
Copy link
Contributor

@patrick-medusajs patrick-medusajs commented Mar 6, 2023

What

Move OAS CI script to a package under the OAS yarn workspace.
Trigger OAS CI on all PRs

Why

Dependencies declared in the package.json at the root of the monorepo would cause unpredictable issues with yarn optimizing packages version to install.

How

  • Move the all the OAS CI script and dependencies under its own package governed by the OAS yarn workspace.
  • Maintain current interface, i.e.: yarn openapi:generate at the root of the repo.
  • Update path resolution within the build-openapi.js script.
  • Use resolutions configuration in order to instruct yarn which version should be used when resolving the dependencies for @redocly/cli

Test

Step 1

  • Run yarn install
  • Run yarn build
  • Run yarn openapi:generate --dry-run
  • Expect OAS validation to run

Step 2

  • Run yarn openapi:generate
  • Move to oas-github-ci package cd packages/oas/oas-github-ci
  • Run yarn preview:admin
  • Expect OAS preview documentation to contain latest OAS changes to admin API.

Step 3

  • Run yarn preview:store
  • Expect OAS preview documentation to contain latest OAS changes to store API.

@patrick-medusajs patrick-medusajs self-assigned this Mar 6, 2023
@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2023

🦋 Changeset detected

Latest commit: 51b0fd6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@medusajs/medusa Patch
@medusajs/inventory Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Mar 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
medusa-docs ⬜️ Ignored (Inspect) Mar 6, 2023 at 9:21PM (UTC)

Copy link
Member

@shahednasser shahednasser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tested generating the OAS and the documentation afterwards

Copy link
Contributor

@kasperkristensen kasperkristensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT!

@olivermrbl olivermrbl merged commit 240d0ea into develop Mar 7, 2023
@olivermrbl olivermrbl deleted the fix/ci-oas-dependency branch March 7, 2023 09:33
Comment on lines +14 to +16
"publishConfig": {
"access": "restricted"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Is there a reason for making this restricted? This setting is blocking us from publishing it in our pipeline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package is only relevant in our monorepo context. It doesn't provide any value as a standalone package. That's why I kept it as restricted. I don't think it needs to be published on npm.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I think we'll have to change it to private: true. Changeset does not recognize this config when running the script to publish packages. If okay with you, I'll open a PR with it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah jeez, my bad for using the wrong flag in the package.json. Thanks for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants