Skip to content

fix(webhook): stop enqueueing validate-configs on push - #496

Merged
Alajmah merged 1 commit into
masterfrom
fix/stop-validate-configs-enqueue
Nov 22, 2026
Merged

Alajmah merged 1 commit into
masterfrom
fix/stop-validate-configs-enqueue

Conversation

@Alajmah

@Alajmah Alajmah commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Status

Create only. Merge and deploy need review.

What this changes

Every push enqueued a second job named validate-configs, next to sync-repo (packages/web/src/lib/webhookHandlers/handlePush.js). No worker acts on that name. The webhook worker handles sync-installation and sync-repo; for any other name it only logs Generic event logged at debug level. Each push therefore added a job that was stored and never did anything.

This PR removes that one enqueue. handlePush now enqueues sync-repo only, with the same payload and priority. It still invalidates the cached .gitwire.yml when a push changes that file.

Validating .gitwire.yml on push is not an active capability. Validation runs on request: through the policy preview API and the dashboard's playground.

What this does not touch

  • The validate-configs jobs already stored in Redis (249 at the last count) stay as they are. Deleting them belongs to the separate Redis cleanup decision.
  • No worker, queue name or database change. The webhook worker's dispatch is unchanged.

Tests

packages/web/tests/unit/webhook-push-enqueues-sync-only.test.js is new and has 8 tests. It covers the single sync-repo enqueue with its payload and priority, the absence of validate-configs, and the config cache invalidation on the three paths that trigger it and the cases that must not.

  • On the previous handler: 8 of 8 fail. The enqueue tests receive ["sync-repo", "validate-configs"].
  • On this handler: 8 of 8 pass.
  • 19 deliberate mutations of the handler each make the suite fail, among them re-adding the enqueue under its old name and under a different name.

Verification

Manual CI run on this branch, commit 7a0b5c5: https://github.com/Octo-Lex/GitWire/actions/runs/45063790692. All 16 jobs passed; publish-release-images is skipped on a manual run by design.

A merge publishes a release and redeploys the three release services.

Every push enqueued a `validate-configs` job next to `sync-repo`. No
worker acts on that job name: the webhook worker handles
sync-installation and sync-repo, and for any other name it only logs
"Generic event logged" at debug level. Each push therefore added a job
that was stored and never did anything.

handlePush now enqueues sync-repo only, with the same payload and
priority, and still invalidates the cached .gitwire.yml when a push
changes it. Validating .gitwire.yml on push is not an active
capability. Validation runs on request, through the policy preview API
and the dashboard's playground.

The jobs already stored in Redis are left untouched. They belong to the
separate Redis cleanup decision.

tests/unit/webhook-push-enqueues-sync-only.test.js covers the enqueue,
the absence of validate-configs, and the cache invalidation. It fails
on the previous handler and passes on this one. Nineteen deliberate
mutations of the handler each make it fail.

Signed-off-by: Alajmah <55954113+Alajmah@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T20:13:36.724042Z 7a0b5c5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@gitwire-hq gitwire-hq Bot 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.

🤖 AI Code Review — ✅ Approved

Confidence: high · Findings: 0
AI judgment: APPROVE · Evidence: COMPLETE · Authority: advisory
Evidence complete · 2/2 changed files accounted for

GitWire AI Review Gate (bundle-driven v2) · Structured schema · Scope-validated · AI recommendation — maintainers and repository policy retain authority

@Alajmah
Alajmah merged commit ad45e16 into master Nov 22, 2026
39 checks passed
@Alajmah

Alajmah commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Merged and deployed: verification (2026-11-22)

Merge. Re-confirmed before the merge: head 7a0b5c5, 21 checks successful, merge state clean, master at 3847171. Squash-merged at 21:52:19Z as ad45e16, with the sign-off.

Publish. CI run 45074507952: success, 17 jobs, publish-release-images included.

Deploy. Deploy run 45075114617: success. Security Scan passed. Deploy Immutable Release passed through its stages: executor gate, app, dashboard. The release record now points to ad45e16.

Check Result
Ten services 10 containers running. 9 report healthy. The tenth is the tunnel container, which defines no health check; it carried the public health request below
Three release services recreated by this deploy and healthy
SHA /health through the tunnel: status ok, git_sha ad45e1626641477be47dabbc0a4fc175b6940960, migrations current. The revision label of the three release images and GITWIRE_COMMIT_SHA in the app container carry the same value
Retention decision remove=3, kept=24, protected=13; removal 3 succeeded, 0 failed. The three images of release bba0a08 are gone. Releases ad45e16, 3847171, f56b86f and a1b3665 keep 3 images each
Validator image already present locally at digest e2c10a61…, unchanged

No new validate-configs jobs

Counted in the production queue, read-only, with a script that Redis refuses writes from.

Moment Jobs of that name Newest of those, enqueued at Newest job of any name, enqueued at
Before the merge, 21:51:54Z 249 20:45:52Z 20:45:52Z
After the deploy, 22:02:29Z 249 21:52:21Z 21:52:21Z
After a later push, 22:05:05Z 249 21:52:21Z 22:03:44Z

The job of 21:52:21Z belongs to the merge's own push. The previous release processed it, before the deploy replaced the app container. The push of 22:03:40Z was processed by the new release: it added its webhook job and no validate-configs job.

The 249 stored jobs are untouched, by decision.

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