diff --git a/.changes/source-control/fix-derive-issue-status-bot-setters-d0232667.md b/.changes/source-control/fix-derive-issue-status-bot-setters-d0232667.md new file mode 100644 index 0000000000..3b7e842751 --- /dev/null +++ b/.changes/source-control/fix-derive-issue-status-bot-setters-d0232667.md @@ -0,0 +1,5 @@ +--- +bump: none +--- + +Test-only change: the issue-status suite counts the live bot-setters block instead of a fixed number, and declares the files it reads. No shipped behavior changes. diff --git a/.github/actions/resolve-config/issue-status.test.mjs b/.github/actions/resolve-config/issue-status.test.mjs index 14c8d295df..62c27d28ae 100644 --- a/.github/actions/resolve-config/issue-status.test.mjs +++ b/.github/actions/resolve-config/issue-status.test.mjs @@ -1,3 +1,4 @@ +// test-scope: .github/actions/resolve-config/package.json // models.issue-status: the label collapse and the Work status field reader, // over the live config. Expected values are written by hand: the option ids // from the org field as read on 2026-11-01, and the label table and collapse @@ -116,7 +117,7 @@ const ACTIONS_BOT = 41898282; const MELODIC_AI = 288071998; const CLAUDE_BOT = 209825114; const LANES_APP = 337595936; -const BOT_SETTERS = [41898282, 300666570, 288071998, 296023097, 300690090, 302525172, 337859524]; +const BOT_SETTERS = [41898282, 300666570, 288071998, 296023097, 300690090, 337859524]; test("read: github-actions[bot] setting needs-human reads needs-human, and melodic-ai[bot] setting confirmed reads confirmed", () => { assert.equal(issueStatus([{ field: FIELD, option: OPTIONS["needs-human"] }], ACTIONS_BOT), "needs-human"); diff --git a/.github/actions/resolve-config/live-config.test.mjs b/.github/actions/resolve-config/live-config.test.mjs index ed1a03c875..fd718af4d7 100644 --- a/.github/actions/resolve-config/live-config.test.mjs +++ b/.github/actions/resolve-config/live-config.test.mjs @@ -1,3 +1,4 @@ +// test-scope: .github/actions/resolve-config/package.json // The repository's own pipeline config, resolved with the real schema, // vocabulary and trust files. Expected values come from the pr-unblock // contract (applies-when of resolve-conflicts, the report-escalation leaf) and @@ -919,23 +920,20 @@ test("live config: post-merge records the owner login's agent merges on the owne assert.equal(agentIdentity, "melodic-automation-lanes[bot]"); }); -// The owner's rule for Work status bot setters: bot-setters is -// github-actions[bot] and every melodic- App trusted-actors.json lists other -// than the lanes App, with the same id and login, and no third-party bot. -test("live config: models.issue-status bot-setters are github-actions[bot] and the listed melodic- Apps but the lanes App", () => { +test("live config: models.issue-status bot-setters are github-actions[bot] then listed melodic- Apps other than the lanes App", () => { const setters = parse(FILES.config).models["issue-status"]["bot-setters"]; const melodic = FILES.trustedActors.actors .filter((actor) => actor.kind === "bot" && actor.login.startsWith("melodic-") && actor.login !== "melodic-automation-lanes[bot]") .map(({ id, login }) => ({ id, login })); assert.ok(melodic.length > 0); - assert.deepEqual(setters, [{ id: 41898282, login: "github-actions[bot]" }, ...melodic]); + assert.deepEqual(setters[0], { id: 41898282, login: "github-actions[bot]" }); for (const login of ["claude[bot]", "cursor[bot]", "cursoragent", "dependabot[bot]", "melodic-automation-lanes[bot]"]) { assert.equal(setters.some((entry) => entry.login === login), false, login); } // issueStatus ignores an entry the list stops holding; this test is what // flags that drift, so each entry must still be on the list as that bot. for (const entry of setters.slice(1)) { - assert.ok(FILES.trustedActors.actors.some((actor) => actor.id === entry.id && actor.login === entry.login && actor.kind === "bot"), entry.login); + assert.ok(melodic.some((actor) => actor.id === entry.id && actor.login === entry.login), entry.login); } }); diff --git a/docs/conventions/pr-pipeline.yaml b/docs/conventions/pr-pipeline.yaml index 16fb1f0671..fc0f813ec3 100644 --- a/docs/conventions/pr-pipeline.yaml +++ b/docs/conventions/pr-pipeline.yaml @@ -1115,8 +1115,6 @@ models: login: "melodic-software-github-iac[bot]" - id: 300690090 login: "melodic-ci-runner-host[bot]" - - id: 302525172 - login: "melodic-ci-runner-observer[bot]" - id: 337859524 login: "melodic-release[bot]" # Bot field events before this time are label mirrors and never count as history. diff --git a/plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_issue_status.py b/plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_issue_status.py index 78dcaaf7de..bbb181a3de 100644 --- a/plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_issue_status.py +++ b/plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_issue_status.py @@ -1,5 +1,6 @@ # test-scope: .github/actions/resolve-config/issue-status.mjs .github/actions/resolve-config/dimensions.mjs docs/conventions/pr-pipeline.yaml plugins/source-control/lib/yaml-subset.awk .github/actions/resolve-config/package.json # test-scope: plugins/source-control/skills/babysit-prs/scripts/tests/fixtures/postmerge/merged-pr.json plugins/source-control/skills/babysit-prs/scripts/tests/fixtures/postmerge/workflow-run.json plugins/source-control/skills/babysit-prs/scripts/tests/fixtures/review_evidence/probe_rerun_after_success.json +# test-scope: plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_review_evidence.py plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_merge_async.py plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_merge.py plugins/source-control/skills/babysit-prs/scripts/tests/repo_config_fake.py plugins/source-control/skills/babysit-prs/scripts/babysit_merge_prefilter.py """The Work status field (`models.issue-status`) as a hold source for the pr-merge lane, the capped-close park and the post-merge demotion record. @@ -22,6 +23,7 @@ import json import os import pathlib +import re import shutil import subprocess import sys @@ -415,7 +417,9 @@ def test_the_live_block_style_setters_parse(self) -> None: self.assertEqual(status.field_id, FIELD) self.assertIn((41898282, "github-actions[bot]"), status.bot_setters) self.assertIn((337859524, "melodic-release[bot]"), status.bot_setters) - self.assertEqual(len(status.bot_setters), 7) + block = re.search(r"\n bot-setters:\n((?: - id: \d+\n login: .+\n)+)", LIVE) + assert block is not None + self.assertEqual(len(status.bot_setters), block.group(1).count("- id:")) self.assertIn(("86380005", "needs-human"), status.options) self.assertEqual( dict(status.labels)["needs-owner-decision"],