All verification complete — TODO.md was already cleared in the roadmap commit; the two extra unit-test diffs are necessary fake-signature adaptations for the new keywords. Everything is green, no fixes were needed. ## Phase 89 — final verification pass: ALL GREEN **Verified (all 6 task files present in `complete/`):** - `git_sources.ignore_paths` JSONB column + migration 0013; `alembic downgrade -1 && upgrade head` round-trips (head `0013`) - Importer: `normalize_ignore_path`/`is_ignored`/`_ignore_for_root`, `ignore` in walk + progress pre-walk, `ignore_by_root` in `import_sources` - API: GET/POST carry list; admin-only `PATCH` (replace, 404/422 fixed details, anonymous 403) - Pipelines wired: `_run_sync`, `_run_upload` re-upload, `scripts/import_docs.py` - Sources-page box: dialog, §7.4 save lifecycle, `N ignored` tag, a11y; env rows get no box **Test/lint results:** - `uv run pytest` → 1808 passed - `uv run pytest --cov=app --cov-report=term-missing` → TOTAL **99%** (>90%) - `uv run pytest tests/e2e/test_source_ignore_paths.py -v --no-cov` → 6 passed (isolated, DB up) - Regressions in isolation: `test_git_sources_admin` 6, `test_archive_upload_sources` 5, `test_sync_button` 3, `test_smoke` 3 — all passed - `uv run ruff check . && uv run pyright` → clean (0 errors) **Completion criteria:** box→PATCH 200→count+GET round-trip ✅ · sync excludes `ignore/` (no docs/chunks/embeddings/summaries) + prunes newly-ignored (pruned==2) ✅ · no-mid-path rule E2E ✅ · PATCH 404/422/replace/clear/403 ✅ · full gate green ✅ · commit + phase move left to harness per rules. **Deviations:** none blocking — E2E pins `files == 4` (overview's "5" was an off-by-one vs its own 6-file tree, documented in-test); `tests/unit/test_importer.py` + `test_sync_button.py` test-double fakes extended for the new keywords (needed for the suite to stay green). **Next pending phase:** none — `todo/` holds only this phase.
49 lines
1.5 KiB
Python
49 lines
1.5 KiB
Python
"""git_sources.ignore_paths: per-source ignore-path list (phase 89)
|
|
|
|
Revision ID: 0013
|
|
Revises: 0012
|
|
Create Date: 2026-09-08
|
|
|
|
Phase 89 (per-source ignore paths: the owner types a list of
|
|
source-relative path prefixes per source — one path per line — into the
|
|
box on the Sources page; the importer never walks, embeds, or summarizes
|
|
a file whose source-relative path starts with one of them; A1 raw prefix
|
|
semantics, A4 limits, A5 replace semantics; one additive, reversible
|
|
column, A13):
|
|
|
|
* ``git_sources.ignore_paths`` — JSONB NOT NULL with server default
|
|
``'[]'``: the normalized, non-empty source-relative path prefixes. A
|
|
file is ignored when its source-relative POSIX path starts with any
|
|
entry (no mid-path matching, no globs). Existing rows read ``[]`` —
|
|
every pre-phase-89 row imports exactly as before.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects import postgresql
|
|
|
|
from alembic import op
|
|
|
|
revision = "0013"
|
|
down_revision = "0012"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column(
|
|
"git_sources",
|
|
sa.Column(
|
|
"ignore_paths",
|
|
postgresql.JSONB(astext_type=sa.Text()),
|
|
server_default=sa.text("'[]'"),
|
|
nullable=False,
|
|
),
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
# Safe order: the column is the only 0013 artefact — dropping it
|
|
# leaves 0012's schema byte-identical (A13, fully reversible).
|
|
op.drop_column("git_sources", "ignore_paths")
|