Skip to content

fix(apps): grant permissions.cron in the cron timeout manifest fixtures - #19280

Merged
buluoray merged 1 commit into
mainfrom
fix/19278-cron-manifest-fixture-permissions
Oct 12, 2026
Merged

buluoray merged 1 commit into
mainfrom
fix/19278-cron-manifest-fixture-permissions

Conversation

@chenmingwei23

Copy link
Copy Markdown
Contributor

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:

test/test_app_cron_timeout_manifest.py::TestDeclaredTimeoutsReachTheJob::test_app_json_pair_registers_with_exact_values
test/test_app_cron_timeout_manifest.py::TestDeclaredTimeoutsReachTheJob::test_absent_fields_keep_the_scheduler_default
test/test_app_cron_timeout_manifest.py::TestInvalidValuesAreRefusedLikeTheSdk::test_a_valid_pair_passes_both

Each one asserts manifest.validate() == [] and gets:

assert ['crons is declared but permissions.cron is not: add "cron": true under "permissions" in app.json'] == []

Two PRs landed eight minutes apart and the second one's fixtures predate the
first one's rule: #19231 made permissions.cron required whenever a manifest
declares crons, and #19191 then added this test file, whose _manifest()
helper builds a manifest with no permissions block at all. Each PR was green
on 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

What changed (motivation -> approach -> change)

Symptom: three tests assert an empty error list from manifest.validate() and
receive the missing-grant refusal.

Root cause: the shared _manifest() helper in that file builds a manifest that
declares one cron and omits permissions entirely. Validation is correct to
refuse it. The fixture, not the validator, is out of date.

Change: _manifest() now sets "permissions": {"cron": True}, so the manifests
satisfy 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 crons list was read against the rule, and the apps and
cron test files were run as a set: the file in this diff was the only one
failing. The two shipped app.json manifests that declare crons already carry
"cron": true, and the app scaffold already writes the grant when it emits a
cron.

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_secs carry with a constant 0 and re-ran the file: six
tests 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:

test/test_app_cron_timeout_manifest.py
  before: 3 failed, 25 passed
  after:  28 passed

test/test_app_cron_timeout_manifest.py + test/test_app_cron_permission_required.py
  after:  52 passed

apps and cron test files as a set (14 files, including #19231's own
test_app_cron_permission_required.py and the installer path in
test_app_bridges.py / test_app_cli.py / test_app_e2e.py)
  before: 3 failed, 1391 passed, 15 skipped
  after:  1394 passed, 15 skipped

black --check, flake8 and scripts/check_comment_history.py all pass on the
changed 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

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
@chenmingwei23
chenmingwei23 requested review from a team and KiroCrewCaptain as code owners October 12, 2026 05:40
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 2922ca31f82f9f01dc40ae4992405530b2aba19b touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 2922ca31f82f9f01dc40ae4992405530b2aba19b ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Advisory — does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 2922ca31f82f9f01dc40ae4992405530b2aba19b and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 2922ca3

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 2922ca31f82f9f01dc40ae4992405530b2aba19b: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 2922ca31f82f9f01dc40ae4992405530b2aba19b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 2922ca31f82f9f01dc40ae4992405530b2aba19b — this comment is updated in place on each push.

Review details

Test-only fixture change; nothing to falsify.

No findings.

[OPUS-REVIEWED] 2922ca3

Verdict parsed from the review's SHA-scoped output markers for commit 2922ca31f82f9f01dc40ae4992405530b2aba19b.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 2922ca31f82f9f01dc40ae4992405530b2aba19b: <one-sentence reason>

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@buluoray
buluoray enabled auto-merge (squash) October 12, 2026 06:37
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 12, 2026
@buluoray
buluoray merged commit 52c3283 into main Oct 12, 2026
101 checks passed
@buluoray
buluoray deleted the fix/19278-cron-manifest-fixture-permissions branch October 12, 2026 06:52
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 12, 2026
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.

main is red: test_app_cron_timeout_manifest fixtures lack permissions.cron after the cron-permission rule landed

3 participants