Skip to content
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

Don't notify Slack if main fails due to workflow cancellation #4913

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amcaplan
Copy link
Contributor

WHY are these changes introduced?

Stops seeing notifications that aren't necessary.

This usually happens due to PRs being merged in quick succession, so an earlier workflow gets cancelled. This is just useless noise.

WHAT is this pull request doing?

Only runs the Slack notification step if the workflow failed, not if it was cancelled.

How to test your changes?

Gotta test in prod

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

@amcaplan amcaplan requested a review from a team as a code owner November 24, 2024 14:22
@@ -90,7 +90,7 @@ jobs:
run: pnpm nx run features:test
- name: Send Slack notification on failure
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # pin@v1.23.0
if: failure()
if: ${{ failure() && github.event.workflow_run.conclusion != "cancelled" }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow run context variable github.event.workflow_run.conclusion isn't accessible in this job. To detect a cancelled workflow, use github.run.conclusion instead:

if: ${{ failure() && github.run.conclusion != 'cancelled' }}

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@amcaplan amcaplan force-pushed the dont-bother-about-broken-workflows-if-just-cancelled branch from 362ec30 to ebadc00 Compare November 24, 2024 17:51
Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 75.41% 8662/11486
🟡 Branches 70.78% 4214/5954
🟡 Functions 74.98% 2272/3030
🟡 Lines 75.96% 8191/10783
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / ConcurrentOutput.tsx
98.36% (-1.64% 🔻)
88% (-4% 🔻)
100%
98.33% (-1.67% 🔻)

Test suite run success

1961 tests passing in 890 suites.

Report generated by 🧪jest coverage report action from ebadc00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant