Skip to content

docs: correct docstrings that describe a removed ref cache and wrong validation examples - #4374

Merged
max-sixty merged 1 commit into
mainfrom
nightly/clean-37275186690
Oct 6, 2026
Merged

max-sixty merged 1 commit into
mainfrom
nightly/clean-37275186690

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Comment-only change: four docstrings in src/git and src/config describe behavior the code no longer has. No code changes, so there's no regression test.

  • validate_template examples were backwards. It claimed validation catches {{ args }} in a hook and {{ target }} in a pre-start hook. Both validate: vars_available_in(Hook(_)) adds args, and the PreCreate extras include target. The new examples, {{ base }} in pre-merge and {{ args }} in --execute, are mismatches that test_validate_template_scope_rejects_out_of_scope_vars and the SwitchExecute case already assert are rejected. The ValidationScope::Hook doc now lists args too.
  • "Ambient ref→SHA cache". refactor(git): RefSnapshot — close ambient ref-keyed cache staleness class #2528 removed RepoCache::commit_shas, but comments on is_ancestor_by_sha, has_added_changes_by_sha, merge_base_by_sha, branch_diff_stats_by_sha, compute_integration_lazy, and the wt list snapshot fields still describe the _by_sha forms as bypassing it. They now say what those forms do: skip ref resolution and read the snapshot's point-in-time state.
  • is_squash_merged_via_patch_id. The docstring said it returns Ok(false) when patch-id computation fails. In fact git errors propagate through ?, and the only caller turns them into "no match" with .unwrap_or(false).

…validation examples

validate_template's examples ({{ args }} in a hook, {{ target }} in a
pre-start hook) both validate; replace them with mismatches the scope
check does reject. Comments citing the ambient ref→SHA cache describe a
cache #2528 removed. The patch-id squash check documents its error path
as Ok(false); errors propagate and the caller maps them to no match.
@worktrunk-bot worktrunk-bot added the nightly-cleanup Issues found by nightly code quality sweep label Oct 5, 2026
@worktrunk-bot

Copy link
Copy Markdown
Collaborator Author

code-coverage is red only at the Upload to codecov.io step, where ingest.codecov.io rejects TLS because its certificate expired. That's the outage tracked in #4370, not this change. Every other check passed. After Codecov renews the certificate, rerunning the job should report codecov/patch.

@max-sixty
max-sixty merged commit 5311138 into main Oct 6, 2026
37 of 49 checks passed
@max-sixty
max-sixty deleted the nightly/clean-37275186690 branch October 6, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nightly-cleanup Issues found by nightly code quality sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants