refactor(pipelines): address code review - shared get_current_user_id, aria-live, deduplicate user ID logic

- Extract _get_user_id into shared auth.get_current_user_id() used by both
  pipelines API and the assign-pipeline endpoint in files API
- Fix aria-live attribute: use two separate static containers (polite/assertive)
  instead of dynamic Alpine.js binding for correct screen reader announcements
- Fix migration comment to accurately describe batch-mode FK creation
- Remove redundant tags parameter from reorder endpoint decorator
- Rename _make_file test helper to _make_test_file_record for clarity
- Update docs/UserGuide.md and docs/API.md with full Pipelines reference

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-07 10:39:19 +00:00
parent 89e0c2fb50
commit 1203a4b75f
8 changed files with 271 additions and 29 deletions
+2 -3
View File
@@ -44,9 +44,8 @@ def upgrade() -> None:
sa.Column("updated_at", sa.DateTime(timezone=True), server_default=sa.func.now()),
)
# Use batch mode for SQLite compatibility when altering the files table.
# SQLite does not support adding FK constraints inline via ALTER TABLE, so we
# add the plain integer column and define the FK reference at the model level.
# Use batch mode (copy-and-move strategy) for SQLite compatibility.
# A named FK constraint is created so Alembic can reference it in the downgrade.
with op.batch_alter_table("files") as batch_op:
batch_op.add_column(
sa.Column("pipeline_id", sa.Integer(), nullable=True),