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

feat(openapi): version handling improvements #559

Merged
merged 22 commits into from
Aug 10, 2022

Conversation

kanadgupta
Copy link
Member

@kanadgupta kanadgupta commented Aug 8, 2022

🚥 Fix RM-4898 RM-4984

🧰 Changes

  • Added CI auto-detection to our version selection prompt (used in openapi, docs, and categories commands). When the user fails to pass a --version parameter in a CI environment, we just default to the main version (and inform the user of this via a warning—see below)
    image
  • Added a new --useSpecVersion parameter to the openapi command that uses the version in the info.version field of the spec for the ReadMe project version
  • Consolidated --version parameter description into a separate file called src/lib/versionOpt.js where it was appropriate to do so
  • Small tweaks to a few parameter descriptions
  • Added a li'l ℹ️ emoji prefix to our info statements

🧬 QA & Testing

I added test coverage for all this new version-handling logic. Alternatively, you can checkout this branch and run the following command to confirm that the command will try to sync to v1.2.3 of your project:

bin/rdme openapi --useSpecVersion __tests__/__fixtures__/petstore-simple-weird-version.json

image

@kanadgupta kanadgupta added enhancement New feature or request refactor Issues about tackling technical debt command:docs Issues pertaining to the `docs`, `changelogs`, or `custompages` commands command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands command:categories Issues pertaining to the `categories` commands labels Aug 8, 2022
Just as an additional sanity check, gonna use the weird version file again so we can ensure its version is not being adhered to unless the corresponding flag is passed.
@kanadgupta kanadgupta requested review from a team, erunion and Dashron and removed request for a team August 8, 2022 23:50
@kanadgupta kanadgupta marked this pull request as ready for review August 8, 2022 23:50
@kanadgupta
Copy link
Member Author

@erunion @Dashron this has the TS changes merged in and is ready for review!

__tests__/lib/commands.test.ts Outdated Show resolved Hide resolved
src/lib/versionOpt.js Outdated Show resolved Hide resolved
@kanadgupta kanadgupta merged commit 80e6024 into main Aug 10, 2022
@kanadgupta kanadgupta deleted the kanad/rm-4984-if-run-in-ci-environment-just-assume branch August 10, 2022 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command:categories Issues pertaining to the `categories` commands command:docs Issues pertaining to the `docs`, `changelogs`, or `custompages` commands command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands enhancement New feature or request refactor Issues about tackling technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants