Repository navigation
CI: Flag repositories sharing a Scorecard slot - #404
Open
lf-releng-code-monkey-bot[bot] wants to merge 2 commits into
Open
lf-releng-code-monkey-bot[bot] wants to merge 2 commits into
lf-releng-code-monkey-bot[bot] wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Schedule parsing misses valid entries and reads commented-out cron values, producing inaccurate audits, while manual dispatch fails for personal-account forks.
4 open issues
What changed in this PR
Adds a weekly Scorecard schedule audit to help keep organisation repositories on distinct Sunday slots, including repositories created from templates.
Changes:
- Detects shared slots and non-Sunday schedules, suggests unused slots, and generates a job-summary table.
- Adds a Monday workflow to collect schedules and blame data, with owner-gated scheduling and Slack notifications.
- Adds offline regression tests and documents the audit and Slack setup.
| File | Description |
|---|---|
README.md |
Documents the audit, slot-selection rules, and notification behavior. |
.github/workflows/scorecard-slots.yaml |
Collects repository schedules and runs the weekly audit with Slack reporting. |
.github/scripts/tests/test_scorecard_slots.py |
Tests collisions, template priority, slot allocation, and input handling. |
.github/scripts/scorecard_slots.py |
Parses schedules, identifies findings, and renders suggested moves. |
Review effort: Balanced
5 tasks
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-400
branch
from
November 26, 2026 21:46
4f9cf1e to
98f093f
Compare
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-400
branch
from
November 26, 2026 22:03
98f093f to
ce71fba
Compare
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-400
branch
from
November 26, 2026 22:18
ce71fba to
461c050
Compare
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-400
branch
from
November 26, 2026 22:35
461c050 to
62a88d2
Compare
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-400
branch
from
November 26, 2026 22:51
62a88d2 to
e46ba2e
Compare
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-400
branch
from
November 26, 2026 23:09
e46ba2e to
dddfdeb
Compare
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-400
branch
from
November 26, 2026 23:28
dddfdeb to
3d807ae
Compare
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-400
branch
from
November 26, 2026 23:41
3d807ae to
ec9fb74
Compare
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-400
branch
from
November 26, 2026 23:58
ec9fb74 to
5fdfc83
Compare
Each repository runs OpenSSF Scorecard in its own Sunday slot, but a
repository created from a template inherits the template's cron line
and stays on its minute. Add a script that reads every repository's
Scorecard schedule and reports cron values two or more repositories
share, and schedules that are not weekly on Sunday.
For each repository that should move it names a free slot: the first
unused grid slot (minute-of-day 4 + 9k), or once the grid is full the
first unused minute off :00 and :30. In a shared slot a template keeps
it, then the oldest commit date of the cron line, from the blame, then
the oldest repository.
The script takes a data directory a workflow fills, so its suite runs
offline. The suite imports nothing from pytest, as the other suites in
.github/scripts do for the type-checking hooks, so it lands with the
code rather than as expected-fail tests first.
Review round 1 (Copilot) on the schedule parser:
- A cron value in a trailing YAML comment was read as a schedule.
Lines now lose any unquoted comment before they are scanned.
- A flow sequence opened on the 'schedule:' line and closed on a
later one was skipped. The parser now follows it until its
brackets close, keeping each cron's own line number.
- A '- cron:' item at the same indentation as 'schedule:', which YAML
allows, was skipped. Same-depth sequence items now count; the next
mapping key still ends the schedule.
Each has a regression case in the suite.
Review round 2 (Copilot) on the schedule parser:
- A trigger written inline, 'on: {schedule: [{cron: ...}]}', was not
read, so its repository looked unscheduled and its minute free.
'schedule:' is now found as a key inside a flow mapping too.
- A plain cron value in block context was cut at a comma, so
'- cron: 4 0 * * 0,1' read as Sunday only. A comma, '}' or ']' now
ends a plain value only inside a flow collection.
Each has a regression case in the suite.
Review round 3 (Copilot) on the schedule parser:
- A quoted key, '"schedule":' or "- 'cron': ...", was not matched,
so its schedule was skipped and its minute looked free. Single-
and double-quoted keys now match as plain ones do.
- A block scalar value, 'cron: >-' or 'cron: |' with the expression
on the next line, read as the literal '>-'. The value is now taken
from the lines indented below the key, and keeps the key's line.
- In 'on: {schedule: [...], workflow_dispatch: {inputs: {cron: ...}}}'
the dispatch input's 'cron' key was read as a schedule. Only the
schedule's own flow value is now scanned.
Each has a regression case in the suite. The schedule reader moves to
scorecard_schedule.py beside the script, which imports it as
fuzz_publish.py imports its siblings, keeping both files within
aislop's file-size limit.
Review round 4 (Copilot):
- 'schedule:' was read wherever it appeared, so a dispatch input of
that name could hide the real trigger and a YAML example in a
'run: |' script could add a cron. Only the 'schedule' key of the
top-level 'on:' mapping is read now, in block or flow style, at the
mapping's own indentation or flow depth.
- Blame dates keep the committer's offset, so sorting them as text
could pick the wrong holder of a shared slot. They are compared as
UTC instants now; an unknown date still sorts last.
Each has a regression case in the suite.
Review round 5 (Copilot): the weekly check read the cron's spelling,
not its cadence, so '4 0 * 1-12 0' or '4 0 * */1 0' was reported as
not weekly on Sunday and did not group with '4 0 * * 0'. Each field is
now expanded to the values it matches, names and steps included, so
equivalent spellings classify and group alike. A day of month must
still start with '*': cron ORs a restricted day of month with the
weekday, so '1-31' runs daily and stays a finding.
Each has a regression case in the suite.
Review round 6 (Copilot) on the schedule parser:
- A quoted cron value spread over lines, 'cron: "4 0' then an indented
'* * 0"', read as '"4 0': a false off-Sunday finding, and its
minute looked free. Such a value is now folded onto its key's line
before it is read, and keeps that line for the blame.
- An anchor or tag on a value, 'schedule: &weekly' or 'on: &trigger',
sent the reader down the flow path and it found no cron. Anchors and
tags are now skipped before block or flow parsing is chosen, on
'on', 'schedule' and 'cron' alike.
Each has a regression case in the suite.
Review round 7 (Copilot) on the schedule parser:
- A double-quoted value kept its escapes, so 'cron: "4 0\u0020* * 0"'
read as a false off-Sunday finding and missed its shared slot. YAML
escapes are now decoded, a '\' ending a line joins it to the next,
and a single-quoted value reads '' as one quote.
- A plain value spread over lines, 'cron: 4 0' then an indented
'* * 0', read as '4 0'. In block style the indented lines below the
key now complete it; in flow style, including a flow item opened in
a block sequence, the collection's lines are joined before it is
read. The cron keeps its key's line for the blame.
Each has a regression case in the suite.
Review round 8 (Copilot): an alias in place of a cron value,
'cron: *weekly' with '&weekly' on a scalar elsewhere in the file, read
as the literal '*weekly': a false off-Sunday finding, and its slot
looked free. A plain alias now reads its anchor's value, quoted,
plain, multi-line or block scalar, and keeps its cron key's line. An
aliased 'schedule: *name' reads the node its anchor marks.
Each has a regression case in the suite.
Review round 9 (Copilot) on alias resolution:
- A quoted '*weekly', 'cron: "*weekly"', was unquoted before alias
resolution and read an anchor's value, masking an invalid schedule.
A quoted value now stays quoted until it is read, so only a plain
'*name' is an alias; a block scalar's text is always literal.
- Anchor discovery searched block scalar text, so '&weekly' inside a
'DOCUMENTATION: |' value shadowed the real anchor and a later
'cron: *weekly' claimed the wrong minute. Block scalar text lines are
now found first and skipped.
- An anchored value over several lines resolved in part: a quoted
'&w "4 0' then '* * 0"' kept its quotes, and a plain flow value
stopped at the line end. Quoted values are now folded wherever a
value opens, after an anchor included, and a plain flow value runs
on to its ',', '}' or ']'.
Each has a regression case in the suite that fails on the old reader.
Review round 10 (Copilot): comments were removed before block scalar
text was found, so 'cron: |-' above '4 0 * * 0 # text' read as
'4 0 * * 0' and passed, though the scalar keeps the '#' and is not a
valid weekly cron. Comments are now removed from every line but a
block scalar's text, and the schedule reader skips that text as a key.
It has a regression case, literal and folded, that fails on the old
reader.
Co-authored-by: Copilot <[email protected]>
Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
Run scorecard_slots.py every Monday against the organisation the workflow runs in. The workflow lists the public, non-archived, non-fork repositories, fetches each Scorecard workflow file and its blame, and leaves every decision to the script, which writes the job summary. It posts to Slack, as repo-audit.yaml does, only when there is a finding. The schedule and the Slack post run only under lfreleng-actions, so a fork can dispatch the check without posting. It is a workflow of its own rather than a job in repo-audit.yaml: that workflow audits the profile README of a hard-coded organisation with no owner gating, while this one needs both a different target and the gating. Review round 1 (Copilot): a fork owned by a personal account has no /orgs/ endpoint, so a manual dispatch failed listing repositories. The step now reads the owner's account type and lists a user's own repositories through /users/. The schedule and Slack guards still test github.repository_owner. Review round 10 (Copilot): the files were read at HEAD and the blame at the default branch tip in a separate request, so a push between them could pair a cron line with another version's blame. The first query now returns the tip's oid with both files, and the blame reads that same commit. Co-authored-by: Copilot <[email protected]> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-400
branch
from
November 27, 2026 00:12
5fdfc83 to
108a603
Compare
| 'cron:' or an anchor. A block scalar's text is data, not YAML, so it | ||
| keeps any '#' it holds and is neither folded nor searched for anchors. | ||
| """ | ||
| lines, content, parent = [strip_comment(line) for line in raw], set[int](), -1 |
2 of 8 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Closes #400
Authored by an AI agent; human review required
claude-opus-5.5via GitHub Copilot CLI39799460cf292525bf1dcc85900cd3a8a827ca68uv run pytest -q tests/test_scorecard_slots.py -k hash_in_block (with fix)uv run pytest -q tests/test_scorecard_slots.py -k hash_in_block (old reader)uvx zizmor --persona auditor .github/workflows/scorecard-slots.yamlAISLOP_NO_TELEMETRY=1 bash scripts/agents/aislop-gate.sh 39799460cf292525bf1dcc85900cd3a8a827ca68 (ruff missing)uv run pytest -q testsuvx gitlint --commits 39799460..HEADAISLOP_NO_TELEMETRY=1 bash scripts/agents/aislop-gate.sh 39799460cf292525bf1dcc85900cd3a8a827ca68uvx zizmor --persona auditor .github/workflows/prek run --files .github/scripts/scorecard_schedule.py .github/scripts/tests/test_scorecard_slots.py .github/workflows/scorecard-slots.yaml (before ruff-format fix)prek run --files .github/scripts/scorecard_schedule.py .github/scripts/scorecard_slots.py .github/scripts/tests/test_scorecard_slots.py .github/workflows/scorecard-slots.yaml README.mdThe
github-code-monkey-botworkflow opened this pull request.Nobody has merged it; a maintainer must review it first.
Review findings on this pull request are answered by a later revision round of this workflow, up to ten rounds per antagonistic review round; after that a maintainer, or the next antagonistic review, takes on any finding that remains, and a maintainer reviews every round before merge.
Round 10 of revision, on its base.
Adds a weekly check for repositories that share an OpenSSF Scorecard slot (#400).
.github/scripts/scorecard_slots.pyandscorecard_schedule.pyread each repository's Scorecard schedule. They report cron values that two or more repositories share, and schedules that are not weekly on Sunday. For each repository that should move, they name a free slot. In a shared slot, a template keeps the slot first. After that, the repository with the oldest commit date on its cron line keeps it (read from the blame). The offline suite sits in.github/scripts/tests/test_scorecard_slots.py..github/workflows/scorecard-slots.yamlruns every Monday underlfreleng-actions. It fetches the repository list, the workflow files and their blame. It writes the job summary and posts to Slack only when there is a finding. A fork can dispatch it, but it does not post. It is a separate workflow rather than a job inrepo-audit.yaml, because that workflow targets a hard-coded organisation and has no owner gating.Round 10
oidalong with both workflow files. The blame query readsobject(oid:)from that same commit, so a push between the two requests can no longer pair a cron line with blame from a different version.#in block scalars (script commit): comments are now stripped from every line except block-scalar text. The schedule reader also no longer reads that text as keys. As a result,cron: |-above4 0 * * 0 # textnow reads as the whole scalar and is reported. There is a regression test covering literal and folded scalars, and it fails on the old reader.Checks run
uv run pytest -q tests(125 passed),prek run --filesover every changed file,gitlint, the aislop gate, andzizmor --persona auditor .github/workflows/all pass. I installedruffso the aislop lint engine could run.For the reviewer
Commit.file(path:)andRepository.object(oid:)are standard GitHub GraphQL fields. I could not run them against the live API from this runner, so the first dispatch is worth watching.