Skip to content

Conversation

@twoGiants
Copy link
Member

@twoGiants twoGiants commented Jan 5, 2026

Important

WIP ==> NO NEED FOR A REVIEW YET.

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jan 5, 2026
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from twogiants after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 5, 2026
@twoGiants twoGiants changed the title Resolver cache annotation propagation and basic e2e tests. 🚧 👷 Resolver cache annotation propagation and basic e2e tests. 🏗️ 🚧 Jan 5, 2026
@twoGiants twoGiants changed the title 🚧 👷 Resolver cache annotation propagation and basic e2e tests. 🏗️ 🚧 🚧 👷 Resolver cache annotation propagation + e2e tests. 🏗️ 🚧 Jan 5, 2026
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>
@twoGiants twoGiants force-pushed the issue-9272-resolver-cache-annotation-propagation branch from dff6b58 to e14122d Compare February 7, 2026 13:50
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.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants