| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Hi @svetanis, thank you for your contribution! We appreciate you taking the time to submit this pull request. I noticed that the branch is currently out of sync with the base branch. could you please resolve the merge conflicts so we can proceed with the review? |
Sorry, something went wrong.
|
Hi @hemasekhar-p, thanks for taking a look. I've rebased the branch onto the latest main (1929be7) — it's now up to date with the base branch and still a single commit. There were no merge conflicts to resolve: the branch was simply behind main. It touches only GcsArtifactService.java and GcsArtifactServiceTest.java, and neither file was modified on main since the branch point — the two intervening commits touched RemoteA2AAgent and pom.xml. The diff is unchanged from the original submission. Ready for review whenever it's convenient. |
Sorry, something went wrong.
|
@svetanis, Thank you for the update. Currently this PR is under review by our team, we will keep you posted if any additional information is required. thank you. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
2. Or, if no issue exists, describe the change:
Problem:
GcsArtifactService.listVersions returns an empty list when the listing raises StorageException.
saveArtifactAndReturnBlob derives the next version number from that result
(versions.isEmpty() ? 0 : max(versions) + 1) and writes with no precondition. At the point where
the version number is chosen, an empty list can mean either that the artifact has no versions or
that the listing did not complete — so a 503, a 429, a timeout or IAM propagation makes the save
compute version 0 and write over the object already stored at version 0, while returning success and
version 0 to the caller.
listArtifactKeys issues the same storageClient.list(bucketName, BlobListOption.prefix(...)) call
and surfaces a failure as VerifyException. listVersions is the one whose result selects the blob
name a save writes to.
Solution:
Separate the listing from the decision about what a failed listing means. The query moves into a
private readVersions that lets StorageException propagate, and each caller applies its own
policy: listVersions catches it and returns an empty list as before, the save path catches it and
throws. Four pieces:
listVersions has three callers besides the save path — loadArtifact, deleteArtifact, and
ArtifactController in the dev module — so removing the catch outright would change
all of them as well. Leaving it in place keeps the diff to the one caller that overwrites stored
data: those three behave exactly as before, and listVersions_storageException_returnsEmptyList
passes untouched. That is a scoping choice, not a claim that the empty list is right for them; the
issue lists them as related and uncovered. If you would rather the catch went away and those callers
moved with it, say so and I will make that change instead.
Testing Plan
Unit Tests:
GcsArtifactServiceTest: Tests run: 26, Failures: 0, Errors: 0, Skipped: 0. Both new tests were
confirmed failing on unmodified main by reverting GcsArtifactService.java alone and re-running —
Tests run: 26, Failures: 2, exactly these two:
Both also verify(mockStorage).list(...), so neither can pass by failing earlier for an unrelated
reason.
Manual End-to-End (E2E) Tests:
client, then save PAYLOAD-B to the same filename — arm 1 through an identity denied
storage.objects.list, arm 2 through a client that can list. The bucket is inspected afterwards
with a privileged credential, since the restricted identity cannot list.
The control arm is unchanged by the fix in both runs — versions [0, 1], both objects kept — so the
two arms differ only in which client performs the second save.
Checklist