Skip to content

Scope status webhooks to their repository - #1505

Merged
gulkaran merged 1 commit into
mainfrom
gulkaran/fix-status-webhook-repository-scope
Oct 5, 2026
Merged

gulkaran merged 1 commit into
mainfrom
gulkaran/fix-status-webhook-repository-scope

Conversation

@gulkaran

@gulkaran gulkaran commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR

  • Status webhooks currently update every tracked commit with the same SHA, including commits in unrelated repositories. Restrict updates to the payload repository while preserving updates across its stacks. The regression fails before the fix; afterward, all 19 webhook controller tests (52 assertions) and lint for both changed files pass.

What changed?

  • Scope StatusHandler commit selection to the repository's stack IDs using stack_id: stacks.select(:id).
  • Give WebhooksControllerTest payloads the correct repository full name and consistent JSON keys.
  • Add one regression covering matching production and canary commits alongside a same-SHA commit in another repository under the same organization.

How to test?

  1. Run the targeted tests and lint checks.
bundle exec ruby -Itest test/controllers/webhooks_controller_test.rb
bundle exec rubocop app/models/shipit/webhooks/handlers/status_handler.rb test/controllers/webhooks_controller_test.rb

Why make this change?

  • CI results belong to a repository even when its commits also exist elsewhere. Applying another repository's result can incorrectly influence Shipit's deployment decisions.

@gulkaran
gulkaran merged commit 99104d4 into main Oct 5, 2026
15 checks passed
@gulkaran
gulkaran deleted the gulkaran/fix-status-webhook-repository-scope branch October 5, 2026 19:33
@timothysmith0609 timothysmith0609 mentioned this pull request Oct 7, 2026
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