Skip to content

Allow file indexes to start at a selected file#294

Open
adamziel wants to merge 1 commit into
trunkfrom
split/file-index-single-file
Open

Allow file indexes to start at a selected file#294
adamziel wants to merge 1 commit into
trunkfrom
split/file-index-single-file

Conversation

@adamziel

@adamziel adamziel commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

What it does

Allows endpoint_file_index() to accept list_dir pointing at a single file, not only a directory. The response emits a normal file-index entry for that selected file.

Rationale

--only file selections should be able to reuse the existing file-index / skip-defaults flow without indexing the selected file’s parent directory.

Implementation

  • Accepts readable files in the list_dir validation path.
  • Keeps directories in the traversal stack and handles explicit files separately.
  • Adds file_index_item_for_path() so direct-file entries use the same metadata shape as normal traversal.
  • Adds unit coverage for a single selected theme file.

Testing instructions

  • cd tests && ../vendor/bin/phpunit --colors=never FileIndexSkipDefaultsTest.php
  • composer analyze

@github-actions

github-actions Bot commented Jul 1, 2026

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.58 s 9.58 s ⚪ +5 ms (+0.1%) 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.77 s 3.66 s ⚪ +105 ms (+2.9%) 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.35 s 13.24 s ⚪ +110 ms (+0.8%)

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

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

@adamziel adamziel closed this Jul 2, 2026
@adamziel adamziel reopened this Jul 2, 2026
@adamziel

adamziel commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

Keeping this open: it's a prerequisite for the push stack's scoped reindex (#315, step 6) — 'reindex just the paths that changed locally' needs single-file index entries exactly like this.

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