-
Notifications
You must be signed in to change notification settings - Fork 91
Fix openapi #2124
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 openapi #2124
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| annotations: | ||
| root: ./src/annotations.openapi.yaml | ||
| output: ./out/annotations.openapi.yaml | ||
| output: ./out/annotations-api.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these names correspond to the ones in our api reference
20165c3 to
70e8266
Compare
28011da to
caf70d3
Compare
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll put this back after review
openapi/publish.js
Outdated
| // publish the json version | ||
| await execAndLog( | ||
| 'npx', ['rdme', 'openapi', fullPath, `--id=${specId}`, `--key=${README_API_KEY}`] | ||
| 'npx', ['rdme@10.5.1', 'openapi', 'upload', `${fullPath}`, `--key=${README_API_KEY}`, `--slug=${specFile}`, `--confirm-overwrite`], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the rdme docs it looks like this command expects some kind of branch value/version. Since this is used for both the production github action on merge to main and the staging action how does this differentiate between the two? I saw previously there was an ID value that was replaced by the slug, does this value also point to branch/version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. by default, it will post directly to the default version, which in our case is version 3.27 (you might see that tossed around). The github action production script (rdme-openapi) will post this to version 3.27, while within rdme-staging (puts content from both openapi and reference within our dev docs in developer.mixpanel.com to a specific staging version). You might have seen that I commented out the main branch for testing purposes, but I plan to bring it back when I get a successful review; it's more so that you can see what it's supposed to be doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok yeah I see the README_VERSION at 3.27 in the rdme-openapi script and README_VERSION set to a value with the github event number that is then passed to this script in rdme-staging.yml. I guess what I'm confused about is it doesn't look like the README_VERSION value is used in the command directly so I would expect based on the documentation that the branch would default to stable. Does the command take directly from the env var or maybe there is a config I'm missing to be used in this command? The previous iteration didn't have branch/version defined either so I assume I'm missing something here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh! I think you're totally right. I'm not super sure about the previous iteration, perhaps the ids are different across branches? I will modify this
e166379 to
e2fb4c2
Compare
gabrielvigil-mixpanel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* modify workflows * update publish script * update to use json versions and rename outputs * modify test file * testing * add debugger * try without confirm overrite * try adding a convert step * use the full path instead for conversion * fix rdme version * remove conversion step * add branch back in * bring back to main branch only
Docs: https://github.com/readmeio/rdme/blob/next/documentation/commands/openapi.md#rdme-openapi-upload-spec
Currently, the openapi script must be updated to correspond to readme refactored.