fix: credential check, step summary, fetch hardening, case-insensitive repo match
- drafter: claude with neither CLAUDE_CODE_OAUTH_TOKEN nor ANTHROPIC_API_KEY set posts the stage 1 flags with the note 'drafter: claude but no Claude credential is set' and fails, without starting Claude. - total_cost_usd and num_turns are printed and appended to GITHUB_STEP_SUMMARY. - git.fetch puts --end-of-options before the branch; run_pr and run_monthly use it. - The bot's own PRs match head.repo.full_name case-insensitively. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ade847ba5b
commit
a1f061ca6c
9 files changed
+112
-6
No files matched your search
@@ -136,6 +136,24 @@ class TestGitHardening(unittest.TestCase):
|
||||
git.run(["status"], self.repo)
|
||||
self.assertNotIn("GIT_CONFIG_COUNT", calls[-1][1])
|
||||
|
||||
def test_fetch_ends_options_before_the_branch(self):
|
||||
git.run(["push", "-q", "origin", "main"], self.repo)
|
||||
calls = self._record()
|
||||
git.fetch("main", self.repo)
|
||||
argv, _ = calls[-1]
|
||||
self.assertEqual(argv[-2:], [git.EOO, "main"])
|
||||
self.assertEqual(git.run(["rev-parse", "FETCH_HEAD"], self.repo).strip(),
|
||||
git.run(["rev-parse", "main"], self.repo).strip())
|
||||
out = Path(self._tmp.name) / "x"
|
||||
with self.assertRaises(git.GitError):
|
||||
git.fetch(f"--upload-pack=touch {out}", self.repo)
|
||||
self.assertFalse(out.exists())
|
||||
|
||||
def test_flows_fetch_only_through_the_helper(self):
|
||||
from docs_review import run_monthly, run_pr
|
||||
for module in (run_pr, run_monthly):
|
||||
self.assertNotIn('["fetch"', inspect.getsource(module))
|
||||
|
||||
def test_push_without_token_adds_no_header(self):
|
||||
calls = self._record()
|
||||
git.push("main", self.repo, None)
|
||||
|
||||
Reference in new issue
Block a user