-
Notifications
You must be signed in to change notification settings - Fork 1
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
ci: Make an issue when ops are missing, instead of messaging slack #92
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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 |
---|---|---|
|
@@ -23,7 +23,8 @@ jobs: | |
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
outputs: | ||
should_notify: ${{ steps.check_status.outputs.result }} | ||
should_notify: ${{ steps.check_missing_optypes.outputs.fail }} | ||
diagnostic: ${{ steps.check_missing_optypes.outputs.diagnostic }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: mozilla-actions/[email protected] | ||
|
@@ -42,31 +43,36 @@ jobs: | |
run: poetry -C tests update | ||
- name: Run the missing op types test | ||
id: check_missing_optypes | ||
run: poetry -C tests run -- cargo test --test integration -- --ignored missing_optypes | ||
- name: Set output flags | ||
id: check_status | ||
if: always() | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const outcome = ${{ steps.check_missing_optypes.outcome != 'success' }}; | ||
console.log(`The outcome is: ${outcome}`); | ||
return outcome | ||
result-encoding: string | ||
run: | | ||
set +e | ||
poetry -C tests run -- cargo test --test integration -- --ignored missing_optypes --nocapture --test-threads=1 > missing_optypes.txt | ||
if [ $? -eq 0 ]; then | ||
echo "The test passed." | ||
echo "fail=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "The test failed with error code $?." | ||
echo | ||
cat missing_optypes.txt | ||
echo "fail=true" >> $GITHUB_OUTPUT | ||
fi | ||
echo "diagnostic=$(cat missing_optypes.txt)" >> $GITHUB_OUTPUT | ||
|
||
notify-slack: | ||
uses: CQCL/hugrverse-actions/.github/workflows/slack-notifier.yml@main | ||
create-issue: | ||
uses: CQCL/hugrverse-actions/.github/workflows/create-issue.yml@main | ||
needs: missing-optypes | ||
if: ${{ needs.missing-optypes.outputs.should_notify == 'true' && ( github.event_name == 'schedule' || github.event_name == 'push' ) }} | ||
with: | ||
channel-id: 'C040CRWH9FF' | ||
slack-message: | | ||
⚠️ `tket-json-rs` is missing OpType definitions. | ||
See <https://github.com/CQCL/tket-json-rs/actions/runs/${{ github.run_id }}|the failing check> for more info. | ||
# Rate-limit the message to once per week | ||
timeout-minutes: 10080 | ||
# A repository variable used to store the last message timestamp. | ||
timeout-variable: "MISSING_OPS_MSG_SENT" | ||
title: "`tket-json-rs` is missing OpType definitions." | ||
body: | | ||
⚠️ `tket-json-rs` is missing OpType definitions. | ||
|
||
``` | ||
$DIAGNOSTIC | ||
``` | ||
|
||
See [https://github.com/CQCL/tket-json-rs/actions/runs/${{ github.run_id }}](the failing check) for more info. | ||
unique-label: "missing-ops" | ||
other-labels: "bug" | ||
secrets: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
GITHUB_PAT: ${{ secrets.HUGRBOT_PAT }} | ||
GITHUB_PAT: ${{ secrets.HUGRBOT_PAT }} | ||
DIAGNOSTIC: ${{ needs.missing-optypes.outputs.diagnostic }} |
This file contains 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.
It would be nice (though not essential) to include the names of the missing optypes in the issue title.
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.
That requires a bit of piping and filtering the output of the test executable.
I'll make an issue so we can change it later.