Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"permissions": {
"allow": [
"Bash(grep -rln *)",
"Bash(grep -nA12 '\\\\[project.optional-dependencies\\\\]\\\\|optional-dependencies\\\\|\\\\[dependency-groups\\\\]' pyproject.toml)",
"Bash(grep -vE \"^$\")",
"Bash(git ls-tree *)",
"Bash(grep -E '\\\\.py$')",
"Bash(grep -v '\\\\.sample$')",
"Bash(git config *)",
"Bash(command -v gh)",
"Bash(gh api *)",
"Bash(python3 -c \"import sys,json; d=json.load\\(sys.stdin\\); print\\('protected:', d.get\\('protected'\\)\\); p=d.get\\('protection',{}\\); print\\('required_pull_request_reviews:', 'yes' if p.get\\('required_pull_request_reviews'\\) else 'no'\\); print\\('enforce_admins:', \\(p.get\\('enforce_admins'\\) or {}\\).get\\('enabled'\\)\\)\")"
]
}
}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ authorization and authentication based on a TDEI/Keycloak JWT token (see main.py

## Branch Index

* ```develop``` do your work here
* ```development``` keep this up to date with the "development" environment / dev tag
* ```develop``` merge your work here; keep this up to date with the "development" environment / dev tag
* ```staging``` keep this up to date with the "staging" environment / stage tag
* ```production``` keep this up to date with the "production" environment / prod tag

Expand Down
16 changes: 16 additions & 0 deletions alembic_task/versions/b3f8a2c91e04_add_auto_flag_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,28 @@

import sqlalchemy as sa
from alembic import op
from sqlalchemy import inspect

revision: str = "b3f8a2c91e04"
down_revision: Union[str, None] = "add6266277c7"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def _has_column(name: str) -> bool:
"""True if `workspaces.<name>` already exists.

Guards the add/drop so the migration is safe whether or not the column
was created out-of-band (e.g. by a parallel branch) — a plain
``ADD COLUMN`` would raise ``DuplicateColumnError`` otherwise.
"""
insp = inspect(op.get_bind())
return name in {c["name"] for c in insp.get_columns("workspaces")}


def upgrade() -> None:
if _has_column("autoFlagReview"):
return
with op.batch_alter_table("workspaces", schema=None) as batch_op:
batch_op.add_column(
sa.Column(
Expand All @@ -30,5 +44,7 @@ def upgrade() -> None:


def downgrade() -> None:
if not _has_column("autoFlagReview"):
return
with op.batch_alter_table("workspaces", schema=None) as batch_op:
batch_op.drop_column("autoFlagReview")
Loading