Skip to content

Address review: drop unsafe fetch-missing area filtering, avoid double file read - #23

Merged
aersam merged 3 commits into
mainfrom
area-tagging
Sep 7, 2026
Merged

Address review: drop unsafe fetch-missing area filtering, avoid double file read#23
aersam merged 3 commits into
mainfrom
area-tagging

Conversation

@aersam

@aersam aersam commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

aersam and others added 3 commits September 7, 2026 16:38
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPDh1XcpTJT48Tw27fD7Ms
A migration file or database/ code file can now declare one or more
areas via a `-- area: NAME[, NAME...]` comment in its leading header
block. `pgdb compare`, `pgdb fetch-missing`, `pgdb migrate check`, and
`pgdb migrate apply` gain repeatable `--area`/`--exclude-area` options
(and the underlying migrate/parser/fetch_missing library functions gain
`areas`/`exclude_areas` kwargs) so a caller can restrict to specific
areas or drop specific areas, while untagged files always stay in scope
as shared/common.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPDh1XcpTJT48Tw27fD7Ms
…e file read

find_missing_objects diffs the *full* live database against scripts
with report_extra_db=True to find genuinely untracked objects.
Filtering the scripts side by area there would make every object
tracked only under a different area look "missing" too, and --write
would reconstruct a duplicate file for something that already exists
— so pgdb fetch-missing no longer takes --area/--exclude-area.

pgdb compare's default (no --report-extra-db) doesn't have this
problem, since it never computes "missing in scripts"; combining
--report-extra-db with an area filter still can, so the CLI now warns
when both are passed together, and the README documents the caveat.

Also stop parse_directory from reading each candidate file twice
(once to check its area tag, once to parse it) when a filter is
active, by checking the area directly off the content it already read
instead of pre-filtering the path list.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPDh1XcpTJT48Tw27fD7Ms
@aersam
aersam merged commit a581b04 into main Sep 7, 2026
1 of 2 checks passed
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