-
Notifications
You must be signed in to change notification settings - Fork 1.9k
🚧 👷 Resolver cache annotation propagation + e2e tests. 🏗️ 🚧 #9280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
twoGiants
wants to merge
3
commits into
tektoncd:main
Choose a base branch
from
twoGiants:issue-9272-resolver-cache-annotation-propagation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
🚧 👷 Resolver cache annotation propagation + e2e tests. 🏗️ 🚧 #9280
twoGiants
wants to merge
3
commits into
tektoncd:main
from
twoGiants:issue-9272-resolver-cache-annotation-propagation
Conversation
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
Collaborator
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Previously, when resolvers fetched resources from remote locations, cache-related annotations (cached, cache-timestamp, cache-operation, cache-resolver-type) were only stored on the ResolutionRequest but not propagated to the resolved Task or Pipeline resources themselves. This made it difficult to track whether a resource was served from cache at the resource level. Now, the DeserializeResolvedRequest function merges resolver annotations onto the resolved resource's metadata (excluding internal kubectl annotations). This provides visibility into cache operations directly on the resources used in TaskRuns and PipelineRuns. A new UnsupportedObjectTypeError is returned if a resolved resource doesn't implement metav1.Object, ensuring type safety when applying annotations. Issue tektoncd#9272 Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>
Previously, e2e tests verified cache annotations only on ResolutionRequests by inspecting resolver pod logs and checking ResolutionRequest status. This approach was due to lack of cache annotations propagation which is now implemented. Now tests verify cache annotations directly on TaskRuns where they are propagated. Tests check for cache operation (store vs retrieve), resolver type, and timestamp annotations on the resolved resources themselves. Also refactored test helpers to use clearer naming (newBundleTaskRun vs createBundleTaskRunLocal) and added test case for nil annotations in unit tests. Issue tektoncd#9272 Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>
Before this change, when multiple resolver replicas processed massive amount of requests for the same resource simultaneously, each replica would experience race conditions (e.g., OCI registry), resulting in redundant network calls and several cache misses instead of one per replica. Now, the resolver cache uses golang.org/x/sync/singleflight to deduplicate concurrent requests for the same cache key. When multiple goroutines request the same resource, only one performs the actual fetch while others wait and receive the same result. This change also: - Removes unused resolverType parameter from ShouldUse() - Adds e2e tests validating cache behavior with 4 resolver replicas - Adds registry metrics validation to verify actual request counts - Improves test infrastructure with deployment scaling helpers - Skip category filtering when -run flag is provided Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>
dff6b58 to
e14122d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
do-not-merge/work-in-progress
Indicates that a PR should not merge because it is a work in progress.
release-note-none
Denotes a PR that doesnt merit a release note.
size/XL
Denotes a PR that changes 500-999 lines, ignoring generated files.
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.
Important
WIP ==> NO NEED FOR A REVIEW YET.