Repository navigation
feat(search): match docker image tags by property (prop:KEY=VALUE) - #469
Merged
Merged
Conversation
The web UI stores a docker tag's properties under the id of the tag's row in the package listing (catalog dockerBranch: t.id), which is docker_tags.id, the id of the docker search row. The tag upsert keeps that id when the tag is pushed again. Drop the s.format <> 'docker' exclusion and add a docker_tags half to the id-array shape (matchedArtifacts), joined on the same repository with the lowercase UUID match of openartifact#467; the EXISTS shape already compares s.id::text. Tests: a docker repository in the prop world (a tagged tag, a deleted tag, a tag id stored in another repository, an upper-case stored id), both shapes. The plan test gets 2000 filler files, tags and properties so it is costed over more than a dozen rows; the EXISTS case now asserts the per-row probe with a selective name. With the whole table tagged the planner picks a hash semi-join on main too (300k files: 92-104 ms on main, 66-77 ms with 100k tagged docker tags added). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #466 and #467:
prop:KEY=VALUEnow matches docker image tags as well as files.Why the ids line up
primaryFile(entry).id, theidof the row in the package listing.dockerBranchininternal/database/catalog_branches.go, and its id ist.id, i.e.docker_tags.id.dockerSearchBranch) uses the same id,dt.id.UpsertDockerTagisON CONFLICT ... DO UPDATE, so pushing a tag again keeps its id, and properties stay attached.Change
s.format <> 'docker'exclusion is gone.matchedArtifacts, formerlymatchedFiles) has adocker_tagshalf. It joins on the same repository and uses the lowercase UUID match from fix(search): consistent UUID match and single planning for prop filters #467. The outers.id = ANY(...)probesdocker_tags_pkey.s.id::textwith the stored path.api.md, the OpenAPIpropdescription andproperties.mdnow say docker tags match.docs/referenceandopenapi.json.gz.Tests
newPropWorldgains a docker repositorydwith:a, which must not match;TestSearchByPropertycases cover both shapes.TestPropFilterPlans):docker_tags_pkey.EXPLAIN ANALYZE on the 300k-file probe database (every file tagged) with 100k tagged docker tags added:
status=approvedstatus=approved+ selective nameformat:docker status=approvedNot in this PR
The per-repository
GET .../artifacts/searchstill names only file ids. A docker tag id comes back with justartifact_id, as documented under "Any other id". Naming tags there would be a separate change.Checks
golangci-lint runpasses, with and without-tags integration.go test -shortpasses forinternal/{search,api,mcp}.-tags integration ./internal/searchpasses three times in a row (-count=3).make docs-checkpasses.-tags noai,nomcpbuild passes.🤖 Generated with Claude Code