Skip to content

testbot: include the test rules in the prompt, default to Opus 5 - #1276

Merged
jiaenren merged 4 commits into
mainfrom
jiaenr/testbot-lint-verification
Aug 8, 2026
Merged

testbot: include the test rules in the prompt, default to Opus 5#1276
jiaenren merged 4 commits into
mainfrom
jiaenr/testbot-lint-verification

Conversation

@jiaenren

@jiaenren jiaenren commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Description

Two changes to the testbot harness.

1. Put the test rules in the prompt. Testbot PRs keep failing ci-internal on pylint — #1253 opened with 9 errors, #1184 needed a "fix pylint failures" follow-up, #1245 a lint-fix commit.

TESTBOT_PROMPT.md told the generator to read TESTBOT_RULES.md, which is the only place documenting the bazel test <target>-pylint verification step and the "Test PUBLIC behavior only. Never call underscore-prefixed methods" rule. In the trace for run/30499270675 the generator made 23 Read calls and opened that file in none of them, so it followed neither.

The workflow now passes the rules in with the prompt, the same way coverage targets already are. No change to the rules themselves.

2. Default to Opus 5. bedrock-claude-opus-4-7bedrock-claude-opus-5 across the testbot generate and respond paths (workflow input default, both ANTHROPIC_MODEL fallbacks, testbot-respond.yaml, select_targets_agent.py, respond.py, README). draft-release-notes.yaml still defaults to 4-7 and is unchanged.

Issue - None

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests

    • Improved automated test generation with documented quality and verification requirements.
    • Clarified that project coding standards are applied automatically when generating tests.
    • Updated automated test generation, target selection, and review responses to use Claude Opus 5 by default.
  • Documentation

    • Updated test automation documentation to reflect the new default model and configuration options.

PR #1253 opened with 9 pylint errors (8x W0212 protected-access on
_upload_worker_input_generator, 1x C2801 unnecessary-dunder-call) and
failed ci-internal on //src/lib/data/storage/tests:test_uploading-pylint.
It is not the first: #1184 needed a "fix pylint failures" follow-up and
#1245 a lint-fix commit.

The generator trace for run/30499270675 shows why. Of its 12 Bash calls,
none contained "pylint" -- it ran `bazel test <single target>`, which
runs the test but not the sibling `-pylint` target that osmo_py_test
generates and that PR CI runs. Its own TodoWrite plan had no style step
at all. And of its 23 Read calls, none opened TESTBOT_RULES.md, the only
place that documents either the lint command or the "test PUBLIC
behavior only" rule that the W0212s violate.

Two fixes, both removing the need for the model to remember something:

1. TESTBOT_RULES.md now says to run `bazel test //<package>:all` instead
   of naming a single target. The lint sibling lives in the same package,
   so one command covers both and there is no second step to skip. This
   matches what the coverage step already tells the agent to do
   (`bazel coverage //src/<package>:all`). Also documents the two pylint
   failures generated tests actually hit.

2. The workflow now splices TESTBOT_RULES.md into the prompt instead of
   referencing it by path, the same way coverage targets are inlined. An
   instruction nothing verifies is followed only sometimes.

Verified: `bazel query 'tests(//src/lib/data/storage/tests:all)'` lists
test_uploading-pylint, so :all would have caught #1253 before the PR
existed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jiaenren
jiaenren requested a review from a team as a code owner August 7, 2026 22:33
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The testbot workflows and scripts now default to Claude Opus 5. The generation workflow appends TESTBOT_RULES.md to the Claude prompt. The prompt and README document these updates.

Changes

Testbot configuration and prompts

Layer / File(s) Summary
Prompt rules wiring
src/scripts/testbot/TESTBOT_PROMPT.md, .github/workflows/testbot.yaml
The prompt documents the appended test rules. The workflow inserts TESTBOT_RULES.md before coverage targets.
Workflow model defaults
.github/workflows/testbot.yaml
Manual dispatch, target selection, and test generation now default to Claude Opus 5.
Script and documentation defaults
.github/workflows/testbot-respond.yaml, src/scripts/testbot/respond.py, src/scripts/testbot/select_targets_agent.py, src/scripts/testbot/README.md
The response workflow, scripts, and README examples now use Claude Opus 5.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: adelbertc, aruns-nv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main changes: including test rules in the prompt and defaulting testbot to Opus 5.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jiaenr/testbot-lint-verification

Comment @coderabbitai help to get the list of available commands.

Wording only, no behavior change. The rationale for the change lives in
the previous commit message and PR #1276; the inline comment and prompt
text only need to say what to do.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Revert the TESTBOT_RULES.md verification changes and trim the added
comment and prompt wording. The remaining change is the minimum fix:
the prompt carries the rules instead of referencing them by path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jiaenren jiaenren changed the title testbot: run lint with the test, and inline the rules into the prompt testbot: include the test rules in the generator prompt Aug 7, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Aug 7, 2026
3 tasks
Switch the testbot generate and respond paths from
bedrock-claude-opus-4-7 to bedrock-claude-opus-5. draft-release-notes
still defaults to 4-7 and is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jiaenren jiaenren changed the title testbot: include the test rules in the generator prompt testbot: include the test rules in the prompt, default to Opus 5 Aug 7, 2026
@jiaenren
jiaenren enabled auto-merge (squash) August 7, 2026 23:55
@jiaenren
jiaenren merged commit 232f164 into main Aug 8, 2026
12 checks passed
@jiaenren
jiaenren deleted the jiaenr/testbot-lint-verification branch August 8, 2026 00:09
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.

3 participants