Skip to content

Commit 9a01cd0

Browse files
committed
refactor: remove proto comments, keep explanation in cache.go only
Signed-off-by: Aman-Cool <aman017102007@gmail.com>
1 parent 3f53c0f commit 9a01cd0

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

api/v2alpha1/cache_key.proto

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ import "google/protobuf/struct.proto";
2121
import "pipeline_spec.proto";
2222

2323
message CacheKey {
24-
// Input artifact identifiers. Each string in ArtifactNameList now uses the format
25-
// "name@uri" to include both the artifact name and URI, ensuring different data
26-
// sources produce different cache keys. Previously only names were used, which
27-
// caused incorrect cache reuse when artifacts had the same name but different URIs.
2824
map<string, ArtifactNameList> inputArtifactNames = 1;
2925
map<string, Value> inputParameters = 2 [deprecated = true];
3026
map<string, RuntimeArtifact> outputArtifactsSpec = 3;
@@ -40,8 +36,5 @@ message ContainerSpec {
4036
}
4137

4238
message ArtifactNameList {
43-
// Artifact identifiers. Format: "name@uri" when URI is present, or just "name"
44-
// when URI is empty. This format ensures cache keys differ for artifacts with
45-
// the same name but different data sources.
4639
repeated string artifactNames = 1;
4740
}

backend/src/v2/cacheutils/cache.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,8 @@ func (c *client) GenerateCacheKey(
187187
for inputArtifactName, inputArtifactList := range inputs.GetArtifacts() {
188188
inputArtifactNameList := cachekey.ArtifactNameList{ArtifactNames: make([]string, 0)}
189189
for _, artifact := range inputArtifactList.Artifacts {
190-
// CRITICAL FIX: Include both name AND URI in the cache key identifier.
191-
// Previously only the name was used, which caused incorrect cache reuse
192-
// when different data sources had artifacts with the same logical name.
193-
// The format "name@uri" ensures different URIs produce different cache keys.
190+
// Include artifact URI in the cache key to prevent incorrect cache reuse
191+
// when different data sources share the same artifact name. Format: "name@uri".
194192
artifactIdentifier := artifact.GetName()
195193
if uri := artifact.GetUri(); uri != "" {
196194
artifactIdentifier = artifact.GetName() + "@" + uri

0 commit comments

Comments
 (0)