-
Notifications
You must be signed in to change notification settings - Fork 12
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
DOP-5448: Integrate Bump GH action to generate spec pages #530
base: main
Are you sure you want to change the base?
Conversation
]; | ||
|
||
function handleAdminAPIv2() { | ||
const docId = '2accf4b8-a543-426c-94c3-794ae26b68be'; |
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.
can we pass this ID as env variable? you can add another secret or var to the repo
// Add new specs to be deployed to Bump here | ||
const SPEC_MAPPING = [ | ||
{ | ||
doc: 'f929d2d7-27d7-4591-b22f-6c2e543a7874', |
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.
can we pass this ID as env variable
file: ${{matrix.spec-mapping.file}} | ||
branch: ${{matrix.spec-mapping.branch}} | ||
|
||
api-preview: |
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.
what is the experience to access the preview spec on bump once the job is completed? I am wondering if we should add a step here to add a comment to the PR with the link to the spec
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.
Right now, each matrix job will result in a separate preview link in the GH action logs (example). Would you like me to file a separate ticket to investigate the best way to comment on the PR (probably without spamming a comment for each one) or is this sufficient for now?
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.
Right now, each matrix job will result in a separate preview link in the GH action logs
SGTM. Feel free to introduce it in separate PR and spec out how to get access to preview urls.
const __dirname = path.dirname(__filename); | ||
|
||
// Add new specs to be deployed to Bump here | ||
const SPEC_MAPPING = [ |
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.
Can we document how this array will grow over time?
I'm trying to establish how many matrix jobs this PR will render after we merge and how this will grow over time. Short explanation would do the job
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 updated the comment to be more explicit, but let me know if you need that written out elsewhere or if you need a better explanation!
Right now, it'll create a separate job for each major spec version of the Atlas Admin API, and for each resource version. Docs currently supports 1-2 more additional public OpenAPI specs, which means we may add them to this repo, leading to more jobs, but I wasn't sure if this repo is intended for all OpenAPI specs, or if the preference is to only have this repo be for Atlas Admin API exclusively.
If the number of jobs becomes a concern, what we could potentially do is explore creating a custom action that can accept the entire array as a single input and bulk deploy/preview everything instead of relying on Bump's action that only accepts 1 at a time.
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.
SGTM. It is not about how many jobs but how many minutes are used.
I see that in current scenario this new job will use less than 10 minutes of run time monthly which seems fine.
Co-authored-by: Andrea Angiolillo <andrea.angiolillo@mongodb.com>
…to DOP-5448-bump
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 for approach.
Let's remove the ability to trigger this action for now before we merge PR.
Alternatively please comment out part that depends on the secret.
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
Proposed changes
Jira ticket: DOP-5448
The main goal of this PR is to follow Bump.sh's recommendation for a GH action that deploys changes to an OpenAPI spec to Bump, to be uploaded to the DOP team's Bump account.
Checklist
Changes to Spectral
Further comments
Some implementation details to note:
versions.json
array. Right now, thegenerateSpecMapping
script is mostly for the Atlas Admin API, but hopefully the array/script can be extended to handle any future OpenAPI specs that may be added to this repo.