Skip to content

Failure notification on the daily sync and add persist-credentials: false and a permissions. - #74

Merged
wpak-ai merged 7 commits into
cppalliance:masterfrom
whisper67265:feature/sync-failure-slack-alerts
Jul 31, 2026
Merged

Failure notification on the daily sync and add persist-credentials: false and a permissions.#74
wpak-ai merged 7 commits into
cppalliance:masterfrom
whisper67265:feature/sync-failure-slack-alerts

Conversation

@whisper67265

@whisper67265 whisper67265 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Close #66, close #67.

Summary by CodeRabbit

  • New Features

    • Added Slack notifications for translation workflow failures and stale synchronization heartbeat alerts.
    • Notifications include workflow links, affected languages, and failed-job details.
  • Documentation

    • Documented required Slack webhook configuration and secret usage in setup guides and the changelog.
  • Security

    • Limited workflow repository permissions and prevented automatic reuse of checkout credentials.
  • Tests

    • Added coverage for notification formatting, delivery, failure handling, webhook validation, and heartbeat alerts.

@whisper67265

Copy link
Copy Markdown
Collaborator Author

@coderabbitai, review

@whisper67265

Copy link
Copy Markdown
Collaborator Author

@coderabbitai, fullreview

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 19d9d04b-47b2-482d-8b65-034341353a74

📥 Commits

Reviewing files that changed from the base of the PR and between 3a52790 and e0d87bf.

📒 Files selected for processing (9)
  • .github/workflows/assets/notify.sh
  • .github/workflows/heartbeat.yml
  • CHANGELOG.md
  • README.md
  • docs/GETTING-STARTED.md
  • tests/helpers/common.bash
  • tests/helpers/http_mock.bash
  • tests/helpers/mock_gh.bash
  • tests/test_notify.bats
🚧 Files skipped from review as they are similar to previous changes (6)
  • .github/workflows/heartbeat.yml
  • .github/workflows/assets/notify.sh
  • CHANGELOG.md
  • tests/helpers/common.bash
  • README.md
  • docs/GETTING-STARTED.md

📝 Walkthrough

Walkthrough

The workflows now send Slack alerts for translation sync failures and stale heartbeat checks. A shared notification script builds workflow URLs, failed-job summaries, and Slack payloads. Tests mock Slack and GitHub CLI requests. Checkout permissions are restricted and persisted credentials are disabled.

Changes

Slack alerting

Layer / File(s) Summary
Notification construction and delivery
.github/workflows/assets/notify.sh
Adds helpers for workflow URLs, failed-job summaries, Slack payloads, webhook delivery, sync failure alerts, and stale heartbeat alerts.
Workflow integration and access configuration
.github/workflows/sync-translation.yml, .github/workflows/heartbeat.yml, .github/workflows/add-submodules.yml, README.md, docs/GETTING-STARTED.md, CHANGELOG.md
Adds notification workflow steps, documents SLACK_WEBHOOK_URL, updates checkout behavior, and records the alert changes.
Notification validation and lint coverage
tests/test_notify.bats, tests/helpers/common.bash, tests/helpers/http_mock.bash, tests/helpers/mock_gh.bash, scripts/lint.sh
Adds notification setup, Slack and GitHub CLI mocks, Bats tests, and ShellCheck coverage.

Estimated code review effort: 3 (Moderate) | ~22 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SyncWorkflow
  participant notify-failure
  participant notify.sh
  participant GitHubCLI
  participant Slack
  SyncWorkflow->>notify-failure: detect discover or sync-local failure
  notify-failure->>notify.sh: invoke failure notification
  notify.sh->>GitHubCLI: retrieve failed workflow jobs
  notify.sh->>Slack: send formatted webhook payload
Loading

Possibly related issues

Possibly related PRs

Suggested reviewers: wpak-ai, henry0816191

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies the main failure-notification change and related workflow security settings, although its wording is awkward.
Linked Issues check ✅ Passed The changes implement the Slack alerts, stale-heartbeat handling, secret documentation, shared tooling, and tests required by issue [#66].
Out of Scope Changes check ✅ Passed The workflow, documentation, notification script, and test changes are directly related to the linked issue objectives.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/assets/notify.sh:
- Around line 52-60: Update send_slack_notification so its curl request includes
short connection and total request timeouts via --connect-timeout and
--max-time, while preserving the existing POST payload, headers, webhook URL,
and failure behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 499b07c4-6535-4869-91c2-3a5bad136b50

📥 Commits

Reviewing files that changed from the base of the PR and between 01fa10d and 2de973d.

📒 Files selected for processing (11)
  • .github/workflows/add-submodules.yml
  • .github/workflows/assets/notify.sh
  • .github/workflows/heartbeat.yml
  • .github/workflows/sync-translation.yml
  • CHANGELOG.md
  • README.md
  • docs/GETTING-STARTED.md
  • scripts/lint.sh
  • tests/helpers/common.bash
  • tests/helpers/http_mock.bash
  • tests/test_notify.bats

Comment thread .github/workflows/assets/notify.sh
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

@whisper67265, I will review the changes.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

@whisper67265, I will perform a complete review of pull request #74.

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/GETTING-STARTED.md`:
- Around line 58-64: Update the workflow-specific requirements section in
GETTING-STARTED.md to state that sync-translation requires SYNC_TOKEN and
notify-failure requires SLACK_WEBHOOK_URL. Keep the existing descriptions and
formatting consistent with the surrounding documentation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4bb3b067-ff42-4030-9370-c22055b3f541

📥 Commits

Reviewing files that changed from the base of the PR and between 01fa10d and 3aa8a53.

📒 Files selected for processing (11)
  • .github/workflows/add-submodules.yml
  • .github/workflows/assets/notify.sh
  • .github/workflows/heartbeat.yml
  • .github/workflows/sync-translation.yml
  • CHANGELOG.md
  • README.md
  • docs/GETTING-STARTED.md
  • scripts/lint.sh
  • tests/helpers/common.bash
  • tests/helpers/http_mock.bash
  • tests/test_notify.bats

Comment thread docs/GETTING-STARTED.md Outdated
@whisper67265
whisper67265 requested a review from wpak-ai July 31, 2026 13:40
@wpak-ai
wpak-ai merged commit 6a5617f into cppalliance:master Jul 31, 2026
4 checks passed
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.

Add persist-credentials: false and a permissions: block to add-submodules.yml Failure notification on the daily sync

3 participants