Skip to content

Handle pre-labeled PR deploy webhooks#167

Merged
vigneshrajsb merged 3 commits intomainfrom
fix/prelabeled-pr-deploy-flow
Apr 16, 2026
Merged

Handle pre-labeled PR deploy webhooks#167
vigneshrajsb merged 3 commits intomainfrom
fix/prelabeled-pr-deploy-flow

Conversation

@vigneshrajsb
Copy link
Copy Markdown
Contributor

Summary

  • handle pre-labeled PRs from the pull_request.opened payload instead of assuming a later label webhook is required
  • queue the initial build immediately when the opened payload already includes lifecycle-deploy!
  • keep the existing label-sync path for autoDeploy PRs that are opened without the deploy label
  • add queue-key logging and regression coverage for the observed GitHub delivery sequence

Queue Key Decisions

  • resolve-deploy uses a dedupe key of resolve:${buildId}:${fingerprint} with a short TTL so near-simultaneous PR events collapse into one effective resolve job
  • build uses a deterministic jobId of build:${buildId}:${fingerprint}
  • the fingerprint is build-scoped, not raw SHA-based, so rebuild inputs like comment runtime env, init env, repo-scoped rebuilds, and deploy-level overrides still produce a new queue key when they should

Verification

  • pnpm test -- src/server/services/__tests__/github.test.ts
  • pnpm exec eslint src/server/services/github.ts src/server/services/build.ts src/server/services/__tests__/github.test.ts
  • unit scenarios covered:
    • non-autoDeploy PR opened with lifecycle-deploy!
    • autoDeploy PR opened with lifecycle-deploy!
    • unlabeled autoDeploy PR keeps label-sync behavior
    • labeled -> opened -> labeled pre-labeled autoDeploy PR only queues one effective build path
  • local E2E scenarios validated on kind-lfc:
    • autoDeploy=true PR created with lifecycle-deploy! already present
    • autoDeploy=false PR created with lifecycle-deploy! already present

@vigneshrajsb vigneshrajsb marked this pull request as ready for review April 16, 2026 06:36
@vigneshrajsb vigneshrajsb requested a review from a team as a code owner April 16, 2026 06:36
@vigneshrajsb vigneshrajsb merged commit 6ff8969 into main Apr 16, 2026
1 check 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.

1 participant