Skip to content

chore: immediately post a commit check when a dry run starts#1041

Merged
adityachoudhari26 merged 1 commit intomainfrom
immediate-commit-check
Apr 22, 2026
Merged

chore: immediately post a commit check when a dry run starts#1041
adityachoudhari26 merged 1 commit intomainfrom
immediate-commit-check

Conversation

@adityachoudhari26
Copy link
Copy Markdown
Member

fixes #1035

Copilot AI review requested due to automatic review settings April 22, 2026 23:22
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@adityachoudhari26 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 43 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 9 minutes and 43 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a3d405a3-865e-47d3-ad31-b3f43f1dcaf1

📥 Commits

Reviewing files that changed from the base of the PR and between 42c7d92 and 987e51f.

📒 Files selected for processing (1)
  • apps/workspace-engine/svc/controllers/deploymentplanresult/controller.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch immediate-commit-check

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an early GitHub check-run update so deployment plan target “dry run” results show a processing / in_progress status on the PR as soon as planning starts (fixes #1035).

Changes:

  • Trigger MaybeUpdateTargetCheck(...) at the start of deploymentplanresult.Controller.Process when the target result has no persisted agent state yet.
  • Continue to update the check run on terminal outcomes (unsupported/errored/completed) as before.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +77 to +81
if len(result.AgentState) == 0 {
if checkErr := MaybeUpdateTargetCheck(ctx, c.getter, resultID); checkErr != nil {
span.RecordError(checkErr)
}
}
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

This initial MaybeUpdateTargetCheck call can run concurrently for multiple results belonging to the same target (worker maxConcurrency > 1 and targets can have multiple agent results). Since MaybeUpdateTargetCheck upserts via “list-by-name then create”, concurrent starts can race and create duplicate check runs / extra GitHub API traffic, and later updates may hit a non-deterministic check run ID when multiple exist. Consider adding an idempotency mechanism (e.g., persist the check_run_id per target+sha, or add a per-target lock/serialized updater, or retry create by re-listing on create failure) to ensure only one check run is created per target.

Copilot uses AI. Check for mistakes.
Comment on lines +77 to +81
if len(result.AgentState) == 0 {
if checkErr := MaybeUpdateTargetCheck(ctx, c.getter, resultID); checkErr != nil {
span.RecordError(checkErr)
}
}
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

New behavior (posting the initial in-progress GitHub check when AgentState is empty) isn’t covered by the existing unit tests in this package. Consider adding a test that asserts the “check update” path is exercised on the first Process call (e.g., have the mock Getter count calls to GetTargetContextByResultID / ListDeploymentPlanTargetResultsByTargetID and assert they’re invoked when AgentState is nil/empty).

Copilot uses AI. Check for mistakes.
@adityachoudhari26 adityachoudhari26 merged commit 6e43752 into main Apr 22, 2026
17 checks passed
@adityachoudhari26 adityachoudhari26 deleted the immediate-commit-check branch April 22, 2026 23:31
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.

Plans that are posted as github actions should show processing status

2 participants