Skip to content

fix(applier): make --fix able to land a commit - #1134

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/applier-commit-input-object
Oct 2, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
fix/applier-commit-input-object

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Until now, scripts/apply-workflow-pins-remote.sh --fix could not land a commit on any repo. That covers both the scheduled apply-workflow-pins.yml job and manual runs. A live canary on metadatastician/_pathroot found two defects:

  1. createCommitOnBranch input passed as a string. -F input=<json> makes gh send a JSON string, and GitHub rejects it: Variable $input of type CreateCommitOnBranchInput! was provided invalid value. The new commit_payload builds the whole request body with jq, and it is sent with gh api graphql --input -. The returned oid must be 40 hex characters.
  2. A 404 was read as "the branch exists". On a 404, gh api …/git/ref/heads/<b> --jq .object.sha prints the error body on stdout. The applier took that as the branch's head and never created the branch. Now only a 40-hex SHA counts.

If the commit fails, the applier now deletes the branch it just created.

Evidence

🤖 Generated with Claude Code

https://claude.ai/code/session_016L7GFo3yGQ2vK9YgKL2wsP

Two defects meant the --fix path could never land a commit on any repo
(found by a live canary on metadatastician/_pathroot, 2026-10-02):

- createCommitOnBranch received `-F input=<json>`, which gh sends as a
  STRING; GitHub rejects it as an invalid CreateCommitOnBranchInput. The
  whole request body is now built by `commit_payload` with jq and sent via
  `--input -`, and the returned oid must be 40 hex.
- On a 404 for the branch ref, gh prints the error body on stdout, so the
  branch was taken to exist and never created. Only a 40-hex SHA now counts.

A branch created for a commit that then fails is deleted again. New
known-answer control: commit_payload's input is an object with the exact
headline, body and file contents (a valid tojson mutant is caught).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016L7GFo3yGQ2vK9YgKL2wsP
@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 373f3c84-d112-4b27-999e-82208be73e88

📥 Commits

Reviewing files that changed from the base of the PR and between 11ba299 and 74194ea.

📒 Files selected for processing (1)
  • scripts/apply-workflow-pins-remote.sh
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@hyperpolymath
hyperpolymath merged commit 907bbfe into main Oct 2, 2026
48 checks passed
@hyperpolymath
hyperpolymath deleted the fix/applier-commit-input-object branch October 2, 2026 01:16
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