Repository navigation
fix(apps): grant permissions.cron in the cron timeout manifest fixtures - #19280
Conversation
The cron timeout manifest tests build a manifest that declares crons with no permissions block, so validate() returns the missing-grant refusal and three tests assert an empty error list against it. Add "cron": true under "permissions" so the fixtures satisfy the grant rule and the assertions test the timeout pair they are about. Fixes #19278
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 2922ca3 Description read[DESCRIPTION-READ] 02003e2102470251f3ad88a3bd67de8c26fbf867be2f513f7d694ab8dd761869 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
buluoray
left a comment
There was a problem hiding this comment.
Approving at 2922ca3. This fixes the red on main: #19231 made validate() refuse crons without permissions.cron, and #19191 added these fixtures without the grant, so the three test_app_cron_timeout_manifest.py tests fail on main (Backend Tests 3.12 shard 1 and Windows shard 1 on 3a23b67). Adding "permissions": {"cron": True} in the shared _manifest() helper is the right fix: no test in the file relies on the grant being absent, and the refusal rule itself is untouched. CI on this head: 85 success, 12 skipped, 0 failed.
Problem / Motivation
Goal: Make the test suite pass on main again, so every open PR stops inheriting a red build it did not cause.
Three tests in the app cron timeout manifest file fail on current main:
Each one asserts
manifest.validate() == []and gets:Two PRs landed eight minutes apart and the second one's fixtures predate the
first one's rule: #19231 made
permissions.cronrequired whenever a manifestdeclares
crons, and #19191 then added this test file, whose_manifest()helper builds a manifest with no
permissionsblock at all. Each PR was greenon a merge ref built before the other landed, so neither review saw the
conflict, and #19231 never touched this file.
Why it matters
Main is red, so every open PR that rebases onto it inherits a failure unrelated
to its own change. Contributors spend review cycles on a red board that no diff
of theirs explains, and a genuinely broken rebase is indistinguishable from this
one while it lasts.
Not a goal
introduced; relaxing it to make a fixture pass would undo that change.
timeout/timeout_secshandling. The field path fix(apps): carry app.json cron timeout/timeout_secs to the job #19191added is correct and stays as it is.
What changed (motivation -> approach -> change)
Symptom: three tests assert an empty error list from
manifest.validate()andreceive the missing-grant refusal.
Root cause: the shared
_manifest()helper in that file builds a manifest thatdeclares one cron and omits
permissionsentirely. Validation is correct torefuse it. The fixture, not the validator, is out of date.
Change:
_manifest()now sets"permissions": {"cron": True}, so the manifestssatisfy the grant rule and the three assertions test the timeout pair they are
about. Seven added lines in one test file, no source change.
I checked that no other fixture has the same gap. Every test manifest that
declares a non-empty
cronslist was read against the rule, and the apps andcron test files were run as a set: the file in this diff was the only one
failing. The two shipped
app.jsonmanifests that declare crons already carry"cron": true, and the app scaffold already writes the grant when it emits acron.
Backwards compatibility
Compatible: the diff touches one test file's fixture data and no production
code, so nothing main accepts today is rejected, renamed or removed.
Removes nothing: the change only adds a key to a test manifest.
Tests
No new test is added: the three existing tests are the coverage, and this diff
restores their ability to run. The assertions they make are unchanged.
To confirm the fixture fix did not simply mask the failure, I replaced the
bridge's
timeout_secscarry with a constant0and re-ran the file: sixtests turned red, including
test_app_json_pair_registers_with_exact_values.The field path is still pinned at every layer.
Counts, with the repository's own virtualenv, on a clean checkout of main at
8f6baa05c9caba4eb1af80f26e844fe8a3a570c5:black --check,flake8andscripts/check_comment_history.pyall pass on thechanged file.
Manual verification
N/A - the failure and the fix are both observable in the test run above, and the
change is fixture data in a test file.
Related Issues
Fixes #19278
Pattern harvest
Rule candidate: review-prompt
Pattern: a PR tightens a validator while a second in-flight PR adds a fixture
that the new rule refuses, and both merge green because each merge ref predates
the other. Neither diff touches the other's file, so no review lane reading one
PR alone can see it. A review prompt that asks, for any diff making a field
required, which other open PRs add data of that shape would catch this class;
nothing in the two diffs themselves would.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)