-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add Chronus Verify CI workflow and update changelog docs to reference azpysdk changelog
#46585
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
Open
Copilot
wants to merge
8
commits into
main
Choose a base branch
from
copilot/update-changelog-for-azpysdk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
549c207
Add chronus-verify CI workflow and update changelog docs for azpysdk
Copilot 3c3c6aa
Fix doc: accurately reflect chronus-verify workflow path filter
Copilot fdd8e8f
Add /chronus add slash-command auto-fix workflow
8fe8a55
Harden chronus workflows: SHA-pinned actions, base-branch tooling, ti…
6e100c5
Remove /chronus add bot; point verify failures at local azpysdk + Cop…
l0lawrence 0dd5ca0
Pin Node version to 22 in chronus-verify workflow
l0lawrence 1097a19
Address review: use npm exec and paginate listComments
l0lawrence 0b09079
Merge branch 'main' into copilot/update-changelog-for-azpysdk
l0lawrence File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| name: Chronus Verify | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - "sdk/*/*/**" | ||
|
|
||
| concurrency: | ||
| group: chronus-verify-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| chronus-verify: | ||
| name: Verify Chronus Change Descriptions | ||
| if: github.event.pull_request.user.login != 'azure-sdk' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| fetch-depth: 0 # needed so chronus can diff against base branch | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: "22" | ||
| cache: npm | ||
| cache-dependency-path: .github/chronus/package-lock.json | ||
|
|
||
| - name: Install pinned dependencies | ||
| run: npm ci | ||
| working-directory: .github/chronus | ||
|
|
||
| - name: Run chronus verify | ||
| id: verify | ||
| run: npm exec --no --prefix .github/chronus/ -- chronus verify | ||
|
|
||
| # Sticky comment is only post-able when GITHUB_TOKEN has write scope — | ||
| # i.e. PRs from the main repo. Fork PRs see only the error annotation below. | ||
| - name: Post sticky fix-instructions PR comment on failure | ||
| if: failure() && steps.verify.conclusion == 'failure' && github.event.pull_request.head.repo.full_name == github.repository | ||
| uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
|
Comment on lines
+43
to
+45
|
||
| with: | ||
| script: | | ||
| const HEADER = '<!-- chronus-verify-sticky -->'; | ||
| const body = [ | ||
| HEADER, | ||
| '### 📝 Missing changelog entry', | ||
| '', | ||
| 'This PR touches package source under `sdk/*/*/**` but no Chronus', | ||
| 'change description was found. CI requires every user-affecting', | ||
| 'change to have one.', | ||
| '', | ||
| '#### How to fix', | ||
| '', | ||
| 'Run the following from the repo root (or from within the package', | ||
| 'directory) and push the new `.chronus/changes/*.md` file:', | ||
| '', | ||
| '```bash', | ||
| 'azpysdk changelog add', | ||
| '```', | ||
| '', | ||
| 'This adds a change entry for each modified package. If your change', | ||
| 'is not user-facing (e.g. tests or docs only), choose the `internal`', | ||
| 'kind to satisfy the check without bumping the version.', | ||
| '', | ||
| '> 💡 You can also ask **GitHub Copilot** to fix this failing check', | ||
| '> for you directly from the PR\'s *Checks* tab.', | ||
| '', | ||
| 'See [`doc/dev/changelog_updates.md`](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/changelog_updates.md) for full instructions.', | ||
| ].join('\n'); | ||
|
|
||
| const comments = await github.paginate(github.rest.issues.listComments, { | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.payload.pull_request.number, | ||
| }); | ||
| const existing = comments.find(c => c.body && c.body.startsWith(HEADER)); | ||
| if (existing) { | ||
| await github.rest.issues.updateComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: existing.id, | ||
| body, | ||
| }); | ||
| } else { | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.payload.pull_request.number, | ||
| body, | ||
| }); | ||
| } | ||
|
|
||
| - name: Emit annotation on failure | ||
| if: failure() && steps.verify.conclusion == 'failure' | ||
| run: | | ||
| echo "::error::Chronus verification failed. Run 'azpysdk changelog add' locally and push the new .chronus/changes/*.md file, or ask GitHub Copilot to fix this check from the PR's Checks tab." | ||
| echo "::error::See https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/changelog_updates.md for instructions." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If constraining to these paths then this job cannot be made required. Is the intent for this workflow to block PRs?
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.
Initially I dont want this to block prs but eventually yes this should