Skip to content

Surface early sticky disk commit denial and stop logging false commit success - #132

Merged
piob-io merged 1 commit into
mainfrom
devin/1788441779-branch-protection-readonly-notice
Sep 4, 2026
Merged

piob-io merged 1 commit into
mainfrom
devin/1788441779-branch-protection-readonly-notice

Conversation

@piob-io

@piob-io piob-io commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

CommitStickyDisk only records commit intent; the host decides whether to commit at VM teardown, after the job log is finalized. The post step nevertheless logs Successfully committed sticky disk as soon as the RPC returns, so with sticky disk branch protection enabled, jobs on untrusted triggers (pull_request, repository_dispatch, …) print a success line while the host discards their changes — which reads as "branch protection is not working".

The VM agent reports the policy outcome at mount time (FastActions/fa#5403): GetStickyDiskResponse.commit_early_deny / commit_early_deny_reason (e.g. branch protection: event "repository_dispatch" is not a trusted trigger). This PR consumes it:

  • getStickyDisk returns commit_early_deny_reason (non-empty iff commitEarlyDeny); setupStickyDisk emits core.notice("Sticky disk changes will not be committed for this job (<reason>). The build cache is used as-is and any changes to it are discarded.") and saves the reason to state (stateHelper.setCommitEarlyDenyReason). The guest can still write to the disk; only the commit is denied.
  • Post step: if the reason is set, skip commitStickyDisk and log Skipping sticky disk commit: denied for this job (<reason>); changes to the build cache are discarded. Otherwise unchanged, except the final line is now Sticky disk commit requested; applied at VM shutdown — the action only knows the request was accepted.

@buf/blacksmith_vm-agent.bufbuild_es (and its @bufbuild/protobuf peer) is bumped to the BSR build that carries the new fields; against agents that don't set them the fields decode as false/"" and behavior is unchanged. dist/ is rebuilt.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled. (Staging)


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Link to Devin session: https://app.devin.ai/sessions/fef6ace05e9346dc9b520c6f7e20590c
Open in Devin Desktop: https://app.devin.ai/desktop/session/fef6ace05e9346dc9b520c6f7e20590c?variant=devin
Requested by: @piob-io

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1788441779-branch-protection-readonly-notice branch from 2fc7a9e to f81f4d4 Compare September 3, 2026 13:52
@piob-io
piob-io marked this pull request as ready for review September 3, 2026 14:24

@shreyas-blacksmith shreyas-blacksmith 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.

The response fields are read through a structural cast, so this builds against the current @buf/blacksmith_vm-agent.* packages and is a no-op against agents that don't set them; bump the packages once fa#5403 is published. dist/ is rebuilt.

Cool pattern!

… success

The VM agent reports commit_early_deny/commit_early_deny_reason on
GetStickyDisk when it already knows the commit will be denied (branch
protection). Emit a notice at setup, save the reason to state, skip the
commit request in the post step, and stop logging a successful commit: the
RPC only records intent and the host applies it at VM shutdown.

Bumps @buf/blacksmith_vm-agent.bufbuild_es (and its @bufbuild/protobuf
peer) to the BSR build that includes the new fields.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1788441779-branch-protection-readonly-notice branch from f81f4d4 to 0ba89c7 Compare September 4, 2026 13:44
@piob-io
piob-io merged commit bbdda6f into main Sep 4, 2026
17 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