-
Notifications
You must be signed in to change notification settings - Fork 422
Revert five squash merges landed outside the merge triage round #1858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,21 +20,16 @@ | |
|
|
||
| def upgrade() -> None: | ||
| bind = op.get_bind() | ||
| inspector = sa.inspect(bind) | ||
| table_exists = inspector.has_table(_TABLE) | ||
| if not table_exists: | ||
| op.create_table( | ||
| _TABLE, | ||
| sa.Column("file_id", sa.String(), nullable=False), | ||
| sa.Column("account_id", sa.String(), nullable=False), | ||
| sa.Column("expires_at", sa.DateTime(timezone=True), nullable=False), | ||
| sa.PrimaryKeyConstraint("file_id"), | ||
| ) | ||
| index_exists = table_exists and "ix_file_account_pins_expires_at" in { | ||
| index["name"] for index in inspector.get_indexes(_TABLE) if index.get("name") | ||
| } | ||
| if not index_exists: | ||
| op.create_index("ix_file_account_pins_expires_at", _TABLE, ["expires_at"], unique=False) | ||
| if sa.inspect(bind).has_table(_TABLE): | ||
| return | ||
|
Comment on lines
+23
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 8 'file_account_pins|ix_file_account_pins_expires_at' app tests
git log --all --oneline -- app/db/alembic/versions/20260813_000000_add_file_account_pins.py
rg -n -C 5 'postgresql|mysql|sqlite' .Repository: Soju06/codex-lb Length of output: 50372 🏁 Script executed: #!/bin/bash
set -euo pipefail
migration="$(fd -t f '20260813_000000_add_file_account_pins.py' . | head -n 1)"
printf '%s\n' "MIGRATION=$migration"
cat -n "$migration"
printf '%s\n' '--- model definition ---'
rg -n -C 12 'file_account_pins|ix_file_account_pins_expires_at' app/db/models.py
printf '%s\n' '--- migration-specific references ---'
rg -n -C 8 '20260813_000000_add_file_account_pins|file_account_pins|ix_file_account_pins_expires_at' tests app/db/alembic --glob '*.py' --glob '*.md' --glob '*.yml' --glob '*.yaml' | head -n 500
printf '%s\n' '--- neighboring migration patterns ---'
fd -t f . app/db/alembic/versions | sort | tail -n 20 | while read -r f; do
if rg -q 'has_table|has_index|drop_index|create_index' "$f"; then
printf '%s\n' "--- $f"
cat -n "$f" | head -n 100
fi
doneRepository: Soju06/codex-lb Length of output: 50371 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- migration runner transaction configuration ---'
rg -n -C 12 'context.configure|transaction_per_migration|begin_transaction|command.upgrade|command.downgrade|render_as_batch' app/db tests --glob '*.py' | head -n 500
printf '%s\n' '--- supported database and migration setup ---'
rg -n -C 8 'sqlite|postgresql|alembic' app/db/migrate.py app/db/session.py pyproject.toml
printf '%s\n' '--- standalone migration control-flow verifier ---'
python3 - <<'PY'
import ast
from pathlib import Path
path = Path("app/db/alembic/versions/20260813_000000_add_file_account_pins.py")
tree = ast.parse(path.read_text(encoding="utf-8"))
functions = {
node.name: node
for node in tree.body
if isinstance(node, ast.FunctionDef)
}
upgrade = functions["upgrade"]
downgrade = functions["downgrade"]
def calls(function, name):
return [
node for node in ast.walk(function)
if isinstance(node, ast.Call)
and (
(isinstance(node.func, ast.Attribute) and node.func.attr == name)
or (isinstance(node.func, ast.Name) and node.func.id == name)
)
]
upgrade_has_table = [
node for node in ast.walk(upgrade)
if isinstance(node, ast.Call)
and isinstance(node.func, ast.Attribute)
and node.func.attr == "has_table"
]
upgrade_create_index = calls(upgrade, "create_index")
downgrade_has_table = [
node for node in ast.walk(downgrade)
if isinstance(node, ast.Call)
and isinstance(node.func, ast.Attribute)
and node.func.attr == "has_table"
]
downgrade_drop_index = calls(downgrade, "drop_index")
print({
"upgrade_has_table_checks": len(upgrade_has_table),
"upgrade_create_index_calls": len(upgrade_create_index),
"downgrade_has_table_checks": len(downgrade_has_table),
"downgrade_drop_index_calls": len(downgrade_drop_index),
})
# A pre-existing table with no index follows the early-return branch.
# The migration source contains no upgrade index-existence check.
assert len(upgrade_has_table) == 1
assert len(upgrade_create_index) == 1
assert len(downgrade_has_table) == 1
assert len(downgrade_drop_index) == 1
print("A table-present/index-missing state skips upgrade index creation and reaches downgrade drop_index.")
PYRepository: Soju06/codex-lb Length of output: 50372 Repair the index when 🤖 Prompt for AI Agents
Comment on lines
+23
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If an interrupted or partially applied file-pin migration leaves AGENTS.md reference: AGENTS.md:L114-L118 Useful? React with 👍 / 👎. |
||
| op.create_table( | ||
| _TABLE, | ||
| sa.Column("file_id", sa.String(), nullable=False), | ||
| sa.Column("account_id", sa.String(), nullable=False), | ||
| sa.Column("expires_at", sa.DateTime(timezone=True), nullable=False), | ||
| sa.PrimaryKeyConstraint("file_id"), | ||
| ) | ||
| op.create_index("ix_file_account_pins_expires_at", _TABLE, ["expires_at"], unique=False) | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deployments stamped with
20260814_020000_merge_identity_and_warmup_headsby the retired August build can no longer start: removing this remap makesinspect_migration_state()classify the stamp as schema-ahead, and_run_upgrade_locked()raises before Alembic can upgrade it. The deleted forward repair is also needed to apply the skipped file-pin, sticky-session, account, API-key, and model-source migrations and remove the retired artifacts, so these installations require manual stamp surgery without this path.AGENTS.md reference: AGENTS.md:L114-L118
Useful? React with 👍 / 👎.