-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add spec revalidation trigger to GH Pages deploy workflow #963
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
Conversation
…date-spec-trigger
🌿 Documentation 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.
Pull request overview
This PR adds automatic revalidation of API specification pages when specs are deployed to GitHub Pages. It introduces a hash-based change detection mechanism to identify which specs have been modified and triggers revalidation only for those changed specs.
Changes:
- Created a shell script that compares SHA256 hashes of API specs to detect changes between deployments
- Added a new revalidation job to the GitHub Pages deployment workflow that triggers spec revalidation via API
- Updated the markdown revalidation endpoint path from
/api/revalidate/tagsto/api/revalidate/markdown
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/detect-spec-changes.sh | Implements hash-based change detection for API specs by comparing previous and current SHA256 hashes |
| package.json | Adds npm script to run the spec change detection script |
| .github/workflows/revalidate-content.yml | Updates API endpoint path for markdown revalidation |
| .github/workflows/gh-pages-deploy.yml | Integrates spec change detection and adds revalidation job to trigger API endpoint with changed specs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f7bae32b3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Description
This triggers the new revalidate/spec endpoint in the docs site. Doing this for API specs is a bit complex because we need to infer what specs changed in order to determine which to revalidate. We can't check git because built specs are dependent on any number of shared component files. To solve, we use a hashing strategy that compares previous hash to newly generated hashes. This is done in a shell script for speed. The output of changed specs are then passed into the revalidate endpoint to handle updating that page content.
Related Issues
https://app.asana.com/1/1129441638109975/project/1211825853436056/task/1212917242381402?focus=true
Changes Made
Testing
pnpm run validate)