Skip to content

fix(deploy): improve build-watch timeout and cancellation error reporting - #94

Merged
ealogar merged 5 commits into
mainfrom
fix/build-watch-deadline-alignment
Sep 10, 2026
Merged

ealogar merged 5 commits into
mainfrom
fix/build-watch-deadline-alignment

Conversation

@ealogar

@ealogar ealogar commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Replace the generic "context exceeds deadline" error in WatchDeployment with
actionable messages that include the package ID, suggest --timeout, and wrap the
underlying context error. Cancellations and deadline-exceeded are now reported
with distinct messages so users are not misled.

Clarify the --timeout flag help text to explain it is the overall command
deadline (including build time), and document the default in the timeout
constant comment.

Changes:

  • Distinguish context.Canceled from context.DeadlineExceeded in
    WatchDeployment, returning a specific message for each case.
  • Wrap ctx.Err() so callers can inspect the cause with errors.Is().
  • Reword --timeout help: "Overall deadline for the command, including
    waiting for a build to finish (e.g. 20m)".
  • Add unit tests covering both the deadline-exceeded and cancellation
    paths in WatchDeployment.

Copilot AI lite review requested due to automatic review settings September 4, 2026 13:41
@ealogar ealogar added the patch release Label for patch release of application label Sep 4, 2026
@vonage-ai-assistant vonage-ai-assistant Bot added the ai-generated Over 80% AI contribution label Sep 4, 2026
@vonage-ai-assistant

vonage-ai-assistant Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

AI Code: 100%
Estimated Cost

AI Adoption Report

Lines %
AI-generated 14 100%
Human 0 0%
Untracked 117 —
Total 131

💰 Cost Breakdown

Agent Model AI Lines Input Tokens Output Tokens Cost Source
kiro auto 12 140 42 $0.0010 📐 estimated
GitHub Copilot github-copilot 2 23 7 $0.0000 🤖 Copilot (subscription)

Total Estimated Cost: $0.0010

Data Sources:

  • 📐 2 commits with estimated tokens (~3.5 tokens/line)

Bedrock pricing: eu-central-1 region

Per-commit breakdown (5 commits)
Commit Message Added AI Human AI %
1b1d294 fix(deploy): improve build-watch timeout error and keep defa 12 12 0 100%
da4e8ba fix: add gitignore 3 — — untracked
c7d7fe9 test(deploy): cover WatchDeployment ctx.Done() timeout and c 99 — — untracked
be205d9 Potential fix for pull request finding 2 2 0 🤖 100% (Copilot)
7b7910e fix(deploy): align build-watch deadline with server-side bui 15 — — untracked

Warning

The following commits have no Git AI authorship notes — AI adoption cannot be tracked for these changes.
Install git-ai locally (curl -sSL https://usegitai.com/install.sh | bash) to enable automatic tracking.
An automation that cannot run git-ai can declare its own attribution instead, by putting #ai-attribution-NNN in the commit message, where NNN is a whole number from 0 to 100.

  • da4e8ba fix: add gitignore
  • c7d7fe9 test(deploy): cover WatchDeployment ctx.Done() timeout and c
  • 7b7910e fix(deploy): align build-watch deadline with server-side bui

Powered by Git AI Standard v3.0.0 — authorship data from refs/notes/ai (supports sessions-v2 format)

Copilot AI 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.

🟡 Changes recommended

The new ctx.Done() error path in WatchDeployment mislabels cancellations as timeouts and the new behavior isn’t covered by unit tests.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adjusts the CLI’s global timeout behavior and deployment build-watch error reporting so long-running (10–15m) builds don’t fail client-side before the server-side build deadline is reached.

Changes:

  • Increased the root command default timeout from 10m to 16m to exceed the server-side build cap.
  • Updated --timeout help text to clarify it is a whole-command deadline (including build watching).
  • Replaced the generic build-watch timeout error with an actionable, wrapped error that includes ctx.Err().
File summaries
File Description
vcr/root/root.go Raises the global default timeout and clarifies the --timeout flag’s semantics.
pkg/api/deployment.go Improves the error returned when the build watch exits due to ctx.Done().
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/api/deployment.go
Comment thread pkg/api/deployment.go
Comment thread vcr/root/root.go Outdated

@gorkarevilla gorkarevilla 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.

LGTM

ealogar and others added 4 commits September 10, 2026 18:50
The CLI's global command deadline defaulted to 10m while deployment-api
caps builds via BUILDER_ACTIVE_DEADLINE_SECONDS (default 15m). Builds
taking 10-15m tripped the client-side deadline and surfaced as
"failed to watch deployment ... context exceeds deadline" even though
the build was still progressing server-side.

- Raise defaultTimeout to 16m so the server-side build limit is always
  reached first and the CLI reports the real build outcome.
- Replace the bare "context exceeds deadline" error with an actionable
  message that names the package, notes the build may still be running,
  and wraps ctx.Err().
- Clarify the --timeout flag help text.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The build-wait timeout error path (ctx.Done() in WatchDeployment) is
user-visible but was previously untested. Add a table-driven test that
drives the watch with a short context deadline and with a cancellation,
asserting the exact error message and that it wraps context.DeadlineExceeded
and context.Canceled respectively (via errors.Is).
@ealogar
ealogar force-pushed the fix/build-watch-deadline-alignment branch from 007fb78 to da4e8ba Compare September 10, 2026 16:53
Comment thread vcr/root/root.go Outdated
Comment thread vcr/root/root.go Outdated
Comment thread pkg/api/deployment.go
…imeout

Address PR #94 review feedback:
- Keep the global default --timeout at 10m; users raise it with -t for
  longer builds.
- Remove internal platform details from the timeout rationale and the
  user-facing error message (public repo).
- Distinguish context cancellation from deadline-exceeded in
  WatchDeployment so cancellations are not mislabelled as timeouts.
- Update WatchDeployment ctx.Done() tests to match the new messages.
@ealogar
ealogar merged commit f4b9df0 into main Sep 10, 2026
9 checks passed
@ealogar
ealogar deleted the fix/build-watch-deadline-alignment branch September 10, 2026 17:23
@ealogar ealogar changed the title fix(deploy): align build-watch deadline with server-side build limit fix(deploy): improve build-watch timeout and cancellation error reporting Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Over 80% AI contribution patch release Label for patch release of application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants