Skip to content

fix: don't report user input errors to the Blacksmith backend - #121

Merged
piob-io merged 2 commits into
release/v2from
fix/dont-report-user-input-errors
Jul 28, 2026
Merged

fix: don't report user input errors to the Blacksmith backend#121
piob-io merged 2 commits into
release/v2from
fix/dont-report-user-input-errors

Conversation

@piob-io

@piob-io piob-io commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

The v2 API deliberately made cache-key a required input. Workflows still using the v1 invocation style hit the @actions/core required-input throw (Input required and not supplied: cache-key) inside getStickyDisk, which the setup error path then shipped to /stickydisks/report-failed as a STICKYDISK_SETUP failure. That pollutes platform failure metrics with pure user configuration errors and has been tripping the per-region failure-rate paging alert (~6k reports/day fleet-wide). useblacksmith/web#10236 currently filters this backend-side by string-matching the message; this PR fixes it at the source so no string matching is needed anywhere.

User misconfiguration is now modeled as a distinct error type instead of an error string. getStickyDisk validates cache-key itself (up front, before creating the agent client) and throws UserInputError with an actionable v2 migration message, and the reporter structurally refuses to send any UserInputError to the backend:

export async function reportBuildPushActionFailure(type, error?, event?) {
  if (error instanceof UserInputError) {
    core.debug(`Not reporting user input error to Blacksmith: ${error.message}`);
    return;
  }
  // ... report as before
}

Guarding centrally in reportBuildPushActionFailure (rather than at the setupStickyDisk call site) means every present and future call site is covered.

User-facing behavior is unchanged: the error still propagates exactly as before, so the action warns and falls back to the local builder (or fails the job when nofallback is set), just with a clearer message telling the user to add cache-key.

dist/index.js and dist/index.js.map are updated with the CI-built bundle for this source, matching repo convention.

Summary

  • New UserInputError type for workflow misconfiguration errors
  • getStickyDisk validates cache-key itself and throws UserInputError with a v2 migration hint
  • reportBuildPushActionFailure never reports UserInputError to the backend
  • Unit tests for both the validation and the reporting guard

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 04c811d. Configure here.

Comment thread .github/workflows/update-dist.yml Outdated
Comment thread .github/workflows/update-dist.yml Outdated
A missing required cache-key input (common for workflows still on the v1
invocation style) was reported to /stickydisks/report-failed as a
STICKYDISK_SETUP failure, polluting platform failure metrics and paging
alerts with what is a user configuration error.

Introduce UserInputError, throw it from our own cache-key validation
(replacing the @actions/core required-input throw), and have
reportBuildPushActionFailure skip reporting any UserInputError. User-facing
behavior is unchanged: the action still warns and falls back to a local
builder (or fails with nofallback), now with a clearer migration message.

dist/ is intentionally not rebuilt here; it is rebuilt as part of the
release process.

Co-authored-by: Codesmith Staging <[email protected]>
@piob-io
piob-io force-pushed the fix/dont-report-user-input-errors branch from 009a436 to d2fdadc Compare July 28, 2026 13:05
dist as built by CI from this exact source (commit 04c811d, produced by the since-removed update-dist workflow run with BUF_TOKEN).

Co-authored-by: Codesmith Staging <[email protected]>
@piob-io
piob-io merged commit 1e75355 into release/v2 Jul 28, 2026
8 checks 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.

2 participants