Skip to content

ci(migrations): a missing package fails the migration tests instead of skipping them (#20146) - #20431

Closed
mrveiss wants to merge 8 commits into
mainfrom
issue-20146-migration-skip
Closed

mrveiss wants to merge 8 commits into
mainfrom
issue-20146-migration-skip

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Closes #20146

Thinking Path

Two migration test modules used importorskip, so if alembic went missing in the gate they skipped and the job stayed green. A plain import turns that into a collection error, which fails the job, with no new mechanism.

What Changed

  • tests/migrations/test_guards.py and test_probe_ladder_selfcheck.py import alembic's submodules directly. A submodule, because autobot-backend/conftest.py stubs a missing top-level alembic with a MagicMock, which a bare import would accept.
  • repo_tests/migration_gate_missing_package_fails_not_skips_20146_test.py: the guard.

The only behaviour change outside CI: a developer without alembic sees those two modules error at collection instead of skipping.

Verification

  • The guard copies each real module to a temp directory with alembic blocked and runs pytest: non-zero exit, an error, no skip.
  • Control: the old importorskip form under the same harness gives a skip and no error, so the harness can see it. A @pytest.mark.skip with a reason still skips.
  • New guard 6 passed; the two modules 12 passed with real alembic.

Not established:

  • Absence is simulated with sys.modules['alembic'] = None, not with an environment lacking the package. The MagicMock reasoning comes from reading the code.
  • That the CI suite installs alembic is read from requirements-ci/storage.txt, not observed. This PR's run is the first check.

Model Used

Claude Sonnet 5 for implementation, Claude Opus 5.5 for direction

🤖 Generated with Claude Code

@mrveiss mrveiss added this to the M2 - Company OS workflow-ready milestone Nov 1, 2026
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between ce1bcb3 and 2d03954.

Files selected for processing: 3
  • autobot-backend/tests/migrations/test_guards.py
  • autobot-backend/tests/migrations/test_probe_ladder_selfcheck.py
  • repo_tests/migration_gate_missing_package_fails_not_skips_20146_test.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20431 (head 273536c): approve. Read only. A missing alembic is now a collection error rather than a skip, and the guard has a control. CI will show whether the python-suite job installs alembic; that was not confirmed.

@mrveiss

mrveiss commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Landed through the merge train (PR #20442), merge 09e1c80, with the content check clean. Proof: git rev-list --no-merges --count origin/main..head = 0; the head moved only by syncing main after the train froze it, and GitHub's file count is against an older merge base. Closing and deleting the branch.

@mrveiss mrveiss closed this Nov 2, 2026
@mrveiss
mrveiss deleted the issue-20146-migration-skip branch November 2, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase:M2.10 Portability, API docs, plugins and end-to-end proof

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(migrations): a missing package skips migration test modules and the job stays green

1 participant