Repository navigation
Conversation
This branch has not been deployed
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.
What changed?
Parse the basename of GCS visibility object keys and compare each requested hash with its exact filename field. Validate the extension and field count, and use the Run ID and Workflow Type preconditions for their respective query predicates.
Add regression coverage for cross-field matches, partial matches, object prefixes containing underscores, malformed filenames, and all three predicates through the visibility archiver's Query method.
Why?
A record with WorkflowType='target' and WorkflowId='other' could match WorkflowId='target' because the filter searched the entire object name. Run ID and Workflow Type predicates also used the Workflow ID filter.
Fixes #12506. This branch is based on main and is independent of the pagination fix in #12494.
How did you test it?
Before the fix, each of the three Query regression cases returned three records instead of the one matching the requested field.
Passed:
go test -tags test_dep ./common/archiver/gcloud/... -count=1make lint-code-fast GOLANGCI_LINT_BASE_REV=origin/maingit diff --checkQuery tests use the real parser and filter predicates with a mocked storage connector; no live GCS validation was performed.
Potential risks
For nonempty filters, malformed object names are now excluded. The stored filename format and empty-filter behavior are unchanged.