Skip to content

docs(pr): require safe alembic consolidation - #21

Open
cjber wants to merge 1 commit into
mainfrom
cb/pr-consolidate-alembic
Open

docs(pr): require safe alembic consolidation#21
cjber wants to merge 1 commit into
mainfrom
cb/pr-consolidate-alembic

Conversation

@cjber

@cjber cjber commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Why

Keep unpublished migration history concise before PR handoff without rewriting revisions that may already be deployed or shared.

Summary

  • make safe Alembic revision consolidation the final repository change before verification
  • require preserved operation order, downgrade behavior, ancestry, and a single head
  • explicitly leave shipped, shared, or uncertain revisions untouched

Test plan

  • skill quick validation

Summary by Sourcery

Documentation:

  • Clarify PR workflow to include safe consolidation of unpublished Alembic revisions while preserving behavior and avoiding modifications to shipped or shared revisions.

@sourcery-ai

sourcery-ai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates the PR skill guide to require safe consolidation of unpublished Alembic migrations as the final repository change before last verification, with strict rules to preserve migration integrity and avoid touching potentially shipped or shared revisions.

Flow diagram for safe Alembic consolidation in PR workflow

flowchart TD
  Start[Before last PR verification]
  FetchMain[Fetch origin/main and merge main into task branch]
  Consolidate[Safely consolidate unpublished Alembic revisions from this PR]
  Preserve[Preserve operation order, upgrade/downgrade behavior, data backfills, ancestry, and a single head]
  CheckStatus{Revision possibly shipped/shared or status uncertain?}
  Skip[Leave revision intact and document why consolidation was unsafe]
  Verify[Run full gate and final validation]

  Start --> FetchMain --> Consolidate --> Preserve --> CheckStatus
  CheckStatus -->|Yes| Skip --> Verify
  CheckStatus -->|No| Verify
Loading

File-Level Changes

Change Details Files
Add a requirement in the PR workflow to safely consolidate unpublished Alembic revisions with strict constraints on preservation and safety.
  • Extend the 'Stay current and drive the PR green' section with a new bullet describing Alembic consolidation as the final repository change before verification.
  • Specify that consolidation must preserve operation order, upgrade/downgrade behavior, data backfills, revision ancestry, and a single head.
  • Clarify that revisions which may be shipped, shared by another branch, or have uncertain publication status must not be rewritten, and that unsafe consolidation must be documented.
codex/skills/pr/SKILL.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider clarifying what qualifies as an “unpublished” Alembic revision (e.g., not applied to any shared environment) to reduce ambiguity for contributors deciding whether consolidation is safe.
  • The phrase “minimum coherent revision set” is somewhat abstract; adding a brief, concrete criterion (e.g., no gaps, single head, no behavioral changes) would help readers consistently apply this guidance.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider clarifying what qualifies as an “unpublished” Alembic revision (e.g., not applied to any shared environment) to reduce ambiguity for contributors deciding whether consolidation is safe.
- The phrase “minimum coherent revision set” is somewhat abstract; adding a brief, concrete criterion (e.g., no gaps, single head, no behavioral changes) would help readers consistently apply this guidance.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

1 participant