Skip to content

CLP-1045: Use common slack notification action - #140

Merged
mary-georgiou merged 2 commits into
masterfrom
chore/mary-georgiou/CLP-1045-common-slack-notify
Oct 12, 2026
Merged

mary-georgiou merged 2 commits into
masterfrom
chore/mary-georgiou/CLP-1045-common-slack-notify

Conversation

@mary-georgiou

@mary-georgiou mary-georgiou commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

CLP-1045: Adds a notify-build-failure job to build.yml using the shared SonarSource/core-languages-tooling-public/common-actions/slack-notify action.

Replaces the previous draft's standalone check_suite-triggered workflow (removed), which doesn't work since check_suite never fires for suites GitHub Actions itself creates.

No pre-existing Slack failure notification existed in this repo, so slack-channel: squad-corelang-notifs was chosen to match the org convention; branch-patterns set to master,branch-*,dogfood-* to match this repo's push-trigger branches.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

CLP-1045

Comment thread .github/workflows/slack-notify.yml Resolved
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mary-georgiou
mary-georgiou force-pushed the chore/mary-georgiou/CLP-1045-common-slack-notify branch from 4f2303c to f3c38f7 Compare September 30, 2026 11:29
Comment on lines +57 to +63
needs:
- build
- promote
if: >-
always()
&& (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/branch-') || startsWith(github.ref, 'refs/heads/dogfood-'))
&& contains(needs.*.result, 'failure')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ [cross-pr] Notifier misses scan-job failures once PR #138's scan job merges

This PR (#140, head f3c38f7) adds notify-build-failure with needs: [build, promote] and fires only when contains(needs.*.result, 'failure'). Open PR #138 (head 442e133) moves the Sonar analysis into a new scan job and makes promote depend on [build, scan]. Its description says it keeps "promotion and releasability gated by the scan". needs.*.result only covers jobs listed directly in needs. If scan fails, build is success and promote is skipped, because a dependency failed and it has no always(). Neither result is failure, so the Slack notification is silently skipped for analysis failures on master, branch-* and dogfood-*. This only happens if both PRs merge into master, in either order, and the notifier's needs list is not updated to include scan when the build.yml conflict is resolved. If only one PR merges, the gap does not appear.

Was this helpful? React with 👍 / 👎

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sonarqube-next

Copy link
Copy Markdown

@mary-georgiou
mary-georgiou marked this pull request as ready for review September 30, 2026 15:11

@aurelien-coet-sonarsource aurelien-coet-sonarsource left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe the Gitar review comment is valid and should be addressed here. We should also notify failures to analyze the project once Guillaume's PR is merged.

@mary-georgiou

Copy link
Copy Markdown
Contributor Author

Hey - this should be merged first. Cause now Guillaume's PR contain also these changes.
Also I'm the reviewer in that PR so I have in mind to check that the new step has been included in the slack notification.

@aurelien-coet-sonarsource aurelien-coet-sonarsource left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@mary-georgiou
mary-georgiou merged commit 872027d into master Oct 12, 2026
11 checks passed
@mary-georgiou
mary-georgiou deleted the chore/mary-georgiou/CLP-1045-common-slack-notify branch October 12, 2026 11:36
@gitar-bot

gitar-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 1 closed / 2 findings

🟡 Medium risk · Adds branch-filtered Slack notifications using a shared action after build failures.

Adds Slack notification for build failures via the shared slack-notify action, but the notifier will miss scan job failures once PR #138 merges. Update notify-build-failure to include scan in its needs list to cover analysis failures on master and release branches.

⚠️ [cross-pr] Notifier misses scan-job failures once PR #138's scan job merges

📄 .github/workflows/build.yml:57-63

This PR (#140, head f3c38f7) adds notify-build-failure with needs: [build, promote] and fires only when contains(needs.*.result, 'failure'). Open PR #138 (head 442e133) moves the Sonar analysis into a new scan job and makes promote depend on [build, scan]. Its description says it keeps "promotion and releasability gated by the scan". needs.*.result only covers jobs listed directly in needs. If scan fails, build is success and promote is skipped, because a dependency failed and it has no always(). Neither result is failure, so the Slack notification is silently skipped for analysis failures on master, branch-* and dogfood-*. This only happens if both PRs merge into master, in either order, and the notifier's needs list is not updated to include scan when the build.yml conflict is resolved. If only one PR merges, the gap does not appear.

✅ 1 closed
✅ Bug: check_suite never fires for GitHub Actions builds, so failures go unreported

📄 .github/workflows/slack-notify.yml:3-5
All CI in this repo runs on GitHub Actions (build.yml on push to master/branch-*). GitHub's docs say the check_suite event "does not trigger workflows if the check suite was created by GitHub Actions" (GitHub events docs). Because of that, a failing Build run on master will never start this workflow. It only runs for check suites that third-party apps create, such as SonarQube Cloud or Mend, so the PR's stated goal of notifying on CI failures is not met. To fix it, trigger on workflow_run for the Build workflow (as releasability.yml already does) and pass github.event.workflow_run.head_branch and github.event.workflow_run.conclusion to the action.

🤖 Prompt for agents
Code Review: Adds Slack notification for build failures via the shared `slack-notify` action, but the notifier will miss `scan` job failures once PR #138 merges. Update `notify-build-failure` to include `scan` in its `needs` list to cover analysis failures on master and release branches.

1. ⚠️ [cross-pr] Notifier misses scan-job failures once PR [#138](<https://github.com/SonarSource/sonar-java-jdt/pull/138>)'s scan job merges
   Files: .github/workflows/build.yml:57-63

   This PR (#140, head f3c38f72b85de21b9cb1a5658f91af610b29d84f) adds `notify-build-failure` with `needs: [build, promote]` and fires only when `contains(needs.*.result, 'failure')`. Open PR https://github.com/SonarSource/sonar-java-jdt/pull/138 (head 442e133237ad47cc2d54805cc4810c61f8183f20) moves the Sonar analysis into a new `scan` job and makes `promote` depend on `[build, scan]`. Its description says it keeps "promotion and releasability gated by the scan". `needs.*.result` only covers jobs listed directly in `needs`. If `scan` fails, `build` is `success` and `promote` is `skipped`, because a dependency failed and it has no `always()`. Neither result is `failure`, so the Slack notification is silently skipped for analysis failures on master, branch-* and dogfood-*. This only happens if both PRs merge into master, in either order, and the notifier's `needs` list is not updated to include `scan` when the build.yml conflict is resolved. If only one PR merges, the gap does not appear.

Verification

Functional validation No results

Rules No rules evaluated

Auto-approval Not enabled

Set up

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.
Unblock → Override a blocking verdict and allow merging.

Comment with these commands to change the behavior for this request:

Auto-apply Compact Unblock
gitar auto-apply:on         
gitar display:verbose         
gitar unblock         

Was this helpful? React with 👍 / 👎 | Gitar

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.

2 participants