-
Notifications
You must be signed in to change notification settings - Fork 2
fix(source-control): emit worktree_lock state when arming liveness guard #2399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,22 @@ | |
| All notable changes to the `source-control` plugin are documented here. Format follows | ||
| [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this plugin uses semantic versioning. | ||
|
|
||
| ## [0.53.3] | ||
|
|
||
| ### Fixed | ||
|
|
||
| - **`fetch_pull_request_commits` fails closed when the pull-commits walk is shorter than the PR's | ||
| `commits` count (#2387).** GitHub caps that endpoint at 250 commits regardless of pagination; the | ||
| helper now compares against the PR metadata and raises instead of returning a silently truncated | ||
| list. | ||
|
Comment on lines
+6
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Important: This This entry is unrelated to the PR's stated purpose (issue #2389, worktree lock signal) and appears to be an erroneous/orphaned addition — possibly a rebase or merge artifact. It also explains why Either drop this block (if it doesn't belong in this PR) or, if the #2387 fix genuinely needs to land, implement it in |
||
|
|
||
| ## [0.53.4] | ||
|
|
||
| ### Fixed | ||
|
|
||
| - **`worktree-create.sh` emits `worktree_lock=armed|unarmed` on stderr (#2389).** Lock failures | ||
| still warn and exit 0, but orchestrators can see when the liveness guard did not arm. | ||
|
|
||
| ## [0.53.2] | ||
|
|
||
| ### Fixed | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -665,7 +665,9 @@ fi | |
| # absent (#2257). The owning lane (or cleanup, after explicit confirmation) | ||
| # disarms with `git worktree unlock <path>`. | ||
| lock_reason="worktree-create.sh: lane active on ${HOSTNAME:-$(hostname 2>/dev/null || printf 'unknown-host')} since $(date -u +%Y-%m-%dT%H:%M:%SZ); unlock when the owning lane is done" | ||
| worktree_lock_state=armed | ||
| if ! git -C "$toplevel" worktree lock --reason "$lock_reason" "$worktree_path" >&2; then | ||
| worktree_lock_state=unarmed | ||
| printf '%s: warning: could not lock the new worktree — cleanup sweeps will not see it as claimed\n' "$PROG" >&2 | ||
| fi | ||
|
|
||
|
|
@@ -702,4 +704,5 @@ if [[ -f "$include_file" ]]; then | |
| fi | ||
|
|
||
| printf '%s: created worktree on branch %q (base %s)\n' "$PROG" "$name" "$base_ref" >&2 | ||
| printf '%s: worktree_lock=%s\n' "$PROG" "$worktree_lock_state" >&2 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a matched Useful? React with 👍 / 👎.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Nit: The
|
||
| printf '%s\n' "$worktree_path" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -770,8 +770,9 @@ assert_file_absent "--root-file NUL-collapsed path never materialized" \ | |
| repo=$(mkrepo --origin "git@github.com:acme/widget.git") | ||
| root_file="$TEST_TMPDIR/rootfile-lock" | ||
| printf '%s' "$TEST_TMPDIR/wtroot18-lock" > "$root_file" | ||
| out=$(bash "$HELPER" --name feat/liveness --root-file "$root_file" --repo-dir "$repo" 2>/dev/null) | ||
| out=$(bash "$HELPER" --name feat/liveness --root-file "$root_file" --repo-dir "$repo" 2>"$TEST_TMPDIR/wt-lock-stderr") | ||
| assert_exit "lock case: creation succeeds (exit 0)" 0 "$?" | ||
| assert_contains "lock state is machine-readable on stderr" "$(cat "$TEST_TMPDIR/wt-lock-stderr")" "worktree_lock=armed" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Nit: This test only covers the |
||
| stanza=$(git -C "$repo" worktree list --porcelain | awk -v RS= -v p="acme-widget-feat-liveness" 'index($0, p)') | ||
| assert_contains "the new worktree is locked at creation" "$stanza" "locked" | ||
| assert_contains "the lock reason names the arming helper" "$stanza" "worktree-create.sh" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 0.53.4 artifact now advertises the #2387 fail-closed behavior, but
skills/babysit-prs/scripts/babysit_gh.py::fetch_pull_request_commitsstill only returns the paginated/pulls/{number}/commitsrows and never reads or compares the PR'scommitsmetadata. Consequently a PR with more than GitHub's 250-commit endpoint cap is still silently truncated, soevaluate_required_signaturescan omit unverified commits while users of this released version are told that case is held closed.Useful? React with 👍 / 👎.