Skip to content

Mark skipped-earlier file tails complete before delta re-pulls - #269

Merged
adamziel merged 1 commit into
pull/studio-single-invocationfrom
pull-complete-skipped-earlier-tail
Jun 19, 2026
Merged

Mark skipped-earlier file tails complete before delta re-pulls#269
adamziel merged 1 commit into
pull/studio-single-invocationfrom
pull-complete-skipped-earlier-tail

Conversation

@adamziel

Copy link
Copy Markdown
Collaborator

What it does

Marks a successful files-pull --filter=skipped-earlier tail as status=complete before returning.

This lets the existing mid-flight --filter guard keep its original shape: later pull --filter=essential-files runs see the previous files sync as complete instead of bypassing the guard for completed pull pipelines.

Rationale

PR #268 correctly identifies that a delta re-pull can be blocked after deferred files are fetched. The root cause is the deferred skipped-earlier tail reopening a completed files-pull with status=in_progress and then returning without restoring the completed status after a successful fetch.

That leaves stale lifecycle state behind. Fixing the state transition keeps one source of truth: completed work is recorded as complete, and the generic filter guard does not need a pull-specific exception.

Implementation

After run_files_sync_pipeline() handles the fetch-skipped stage, run_files_sync() now:

  1. returns unchanged when the pipeline saved status=partial for an interrupted fetch;
  2. otherwise restores status=complete and saves state before returning.

The pull-level test now models the truthful post-tail state, and a new files-sync test drives the skipped-earlier tail through a no-network file_fetch test double.

Testing instructions

php -l packages/reprint-importer/src/import.php
php -l tests/Import/FilesSyncStateTest.php
php -l tests/Import/PullFilterOptionTest.php
git diff --check
cd tests && ../vendor/bin/phpunit Import/PullFilterOptionTest.php Import/FilesSyncStateTest.php
@github-actions

Copy link
Copy Markdown
Contributor

Pull pipeline performance — large-directory

Site: large-directory · 2,000+ plus targeted file-transfer scenarios files · 10,000 posts · 25,000 postmeta · PHP 8.5.7

Stage PR trunk Δ Status Details
playground-sqlite-db-pull 9.69 s 9.34 s ⚪ +350 ms (+3.7%) condition=db-pull in PHP.wasm
runtime=php.wasm 8.3
wp_mysql_parser=enabled
mode=lexer
native_lexer=verified
native_token_stream=WP_MySQL_Native_Token_Stream
native_token_count=18
native_parser=selected
trunk: condition=db-pull in PHP.wasm
runtime=php.wasm 8.3
wp_mysql_parser=enabled
mode=lexer
native_lexer=verified
native_token_stream=WP_MySQL_Native_Token_Stream
native_token_count=18
native_parser=selected
playground-sqlite-db-apply 3.59 s 3.55 s ⚪ +43 ms (+1.2%) condition=db-apply to SQLite in PHP.wasm
runtime=php.wasm 8.3
wp_mysql_parser=enabled
mode=parser
native_lexer=verified
native_token_stream=WP_MySQL_Native_Token_Stream
native_token_count=18
native_parser=verified
native_ast=WP_MySQL_Native_Parser_Node
sqlite_driver_parser=verified
trunk: condition=db-apply to SQLite in PHP.wasm
runtime=php.wasm 8.3
wp_mysql_parser=enabled
mode=parser
native_lexer=verified
native_token_stream=WP_MySQL_Native_Token_Stream
native_token_count=18
native_parser=verified
native_ast=WP_MySQL_Native_Parser_Node
sqlite_driver_parser=verified
Total 13.28 s 12.89 s ⚪ +392 ms (+3.0%)

Numbers carry runner noise; treat single-run deltas as directional, not authoritative.

📈 Trunk performance history — commit-by-commit timeline.

@adamziel
adamziel marked this pull request as ready for review June 19, 2026 15:23
@adamziel
adamziel merged commit bd19678 into pull/studio-single-invocation Jun 19, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant