Opened 4 years ago
Closed 3 years ago
#52644 closed task (blessed) (fixed)
Configure Slack notifications for GitHub Action workflows
Reported by: | desrosj | Owned by: | |
---|---|---|---|
Milestone: | 5.9 | Priority: | normal |
Severity: | normal | Version: | 5.6 |
Component: | Build/Test Tools | Keywords: | has-patch |
Focuses: | Cc: |
Description
Follow up to #50401.
TravisCI used to report changes in build status to Slack in the #core channel.
The following would be reported:
- Every build that failed.
- The first passing build in a branch after a failed build.
Some additional ideas for expanding this:
- Posting every build result to the #core-firehose, or a new #core-ci-firehose
@helen had created GH-808 to explore setting this up.
Attachments (1)
Change History (26)
This ticket was mentioned in Slack in #core by chaion07. View the logs.
4 years ago
#3
@
4 years ago
- Milestone changed from 5.8 to 5.9
I'm going to punt this to 5.9 as I won't have the time to address this in the weeks leading up to 5.8.
This ticket was mentioned in PR #1529 on WordPress/wordpress-develop by desrosj.
3 years ago
#4
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/52644
#7
follow-up:
↓ 12
@
3 years ago
Looks like [51511] is doing the trick!
Some notes:
- This will post every non-pull request workflow failure to #core.
- Unfortunately, because this requires the job to actually run, a notification will not be posted if the job times out or fails due to a failure at the service level, such as a GitHub Action outage, or a runner that hangs and times out.
- In Travis, there was a setting to post the first successful job following a failure to Slack. There is no straightforward way to accomplish this in GHA. It could be accomplished with a combination of REST API calls, but haven't figured out the best way for this yet.
- We could also post all workflow results regardless of outcome to the #core-firehose.
- We could also create a #core-ci channel that also receives a post for all workflow results regardless of outcome.
- This will need to be backported to all branches so that Slack notifications are posted when old branches have failed workflow runs.
This ticket was mentioned in PR #1539 on WordPress/wordpress-develop by desrosj.
3 years ago
#8
Trac ticket:
#12
in reply to:
↑ 7
@
3 years ago
Some revised notes after [51535-51537]:
- Slack notifications are now controlled by a separate workflow that runs on the
workflow_run
event when a listed workflow iscompleted
. I took this route to prevent repeating large amounts of code across all workflows where Slack notifications are desired. But ideally, this workflow would be published as an action that could be defined in theuses:
for a step. - The first successful job following a failure will now be posted as a "fixed" notice to #core. There are some potential edge cases with the current implementation where re-running workflows could result in the wrong workflow run being used for comparison.
- All workflow results regardless of outcome are posted to to the #core-firehose.
- All workflow results regardless of outcome are posted to the new #core-ci-firehose channel.
- Since these notifications are controlled in a separate workflow initiated on the
workflow_run
event, this does not technically need to be backported (allworkflow_run
events are created against the primary branch). But, [51511-51512,51535-51537] could be backported just to have consistent contents of the.github/workflows
directory. - The messages themselves are configured within Slack Workflows.
I'm going to leave this open in case any adjustments are needed.
#13
@
3 years ago
Cool screenshot, peterwilsoncc.
Everyone else can ignore it as I've found the setting in Slack to prevent actions expanding -- and used web developer tools to read the truncated tex
This ticket was mentioned in Slack in #core by sergey. View the logs.
3 years ago
3 years ago
#16
This was merged into Core in https://core.trac.wordpress.org/changeset/51511.
#19
@
3 years ago
It looks like in some situations, null
is being found for the previous conclusion. See https://github.com/WordPress/wordpress-develop/runs/3436640677?check_suite_focus=true#step:3:2.
This ticket was mentioned in Slack in #core by desrosj. View the logs.
3 years ago
#21
@
3 years ago
Sergey spotted that the commit message in the failure message posted to Slack has content between backticks stripped.
A cursory look suggests this could be the culprit: https://github.com/johnbillion/wordpress-develop/blob/00d248e699deb0b4336010316b5feb2763de8e87/.github/workflows/slack-notifications.yml#L70
#23
@
3 years ago
Looks like "
within the first line of the commit are not being double escaped causing them to be interpreted incorrectly and producing invalid JSON. See https://github.com/WordPress/wordpress-develop/runs/3478978811?check_suite_focus=true#step:2:2.
#25
@
3 years ago
- Resolution set to fixed
- Status changed from new to closed
I'd forgotten that this more specific ticket was still open. Here are some additional changesets that are related to Slack notifications:
[51921-51922,51924-51925,51934,51937,51952-51954,52002].
I think this is pretty stable for now, so going to close this out.
One note for context going forward. The changes in [51921] and up making the Slack workflow a callable one is nice in several ways, but mainly in that it eliminates all of the additional "Slack Notifications" workflows that run for older branches. This creates quite a bit of noise, and I'd like to backport these changes to older branches once this gets a bit more testing.
One great thing about this is we can call the workflow from the primary branch, so any needed adjustments will not need to be backported after the initial change.
Hi @desrosj,
This was discussed in a 5.8 bug scrubbing session today.
As this doesn't touch production files, it was left on the milestone but feel free to change the milestone if you don't have bandwidth for this release cycle.
Thanks for your contributions to WordPress!