Skip to content

Conversation

@richardlt
Copy link

@richardlt richardlt commented Nov 3, 2025

This PR add some missing fields on local and remote repository structs. The Ansible implmentation was also added.
Another changes that is introduced here is removing some omitempty tags. Without removing this tags it seems impossible to empty some fields when updating the repositories config.

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • This pull request is on the master branch.
  • I used gofmt for formatting the code before submitting the pull request.

@ehl-jf ehl-jf added the safe to test Approve running integration tests on a pull request label Nov 3, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Nov 3, 2025
Signed-off-by: richard.le-terrier <[email protected]>
@ehl-jf ehl-jf added the safe to test Approve running integration tests on a pull request label Nov 3, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Nov 3, 2025
@richardlt
Copy link
Author

Work in progress to adapt unit tests.

@RemiBou
Copy link
Contributor

RemiBou commented Nov 3, 2025

please check CI failures

@fluxxBot
Copy link

fluxxBot commented Nov 3, 2025

Please update description and also provide appropriate labels

type HelmRemoteRepositoryParams struct {
RemoteRepositoryBaseParams
ChartsBaseUrl string `json:"chartsBaseUrl,omitempty"`
ChartsBaseUrl string `json:"chartsBaseUrl"` // do not set omitempty to be able to empty the value when updating
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if let's say this used for updating, are we making sure any empty value sent to the server is not updated in the database?

Copy link
Author

@richardlt richardlt Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the implementation in the Artifactory API since I don't have the source for it. But in the client updating local and remote repositories config will result in a call to the method https://github.com/jfrog/jfrog-client-go/blob/master/artifactory/services/repository.go#L28 that will marshal the struct (remove the empty values from the body) and send a POST request. Maybe the POST is implemented like a PATCH on the server and ignore missing fields.

Copy link
Author

@richardlt richardlt Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also what strange in that performRequest function is that the update will run a POST while the create will do a PUT.

setCacheVirtualRepositoryParams(&tvp.CommonCacheVirtualRepositoryParams, true)

err = testsUpdateVirtualRepositoryService.Terraform(tvp)
assert.NoError(t, err, "Failed to update "+repoKey)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this assertion valid? Is it possible to provide proper comment in the codebase why it was decided to be removed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this two lines because there are the same assertions at line 680.


err = testsUpdateVirtualRepositoryService.Terraform(tvp)
assert.NoError(t, err, "Failed to update "+repoKey)
validateRepoConfig(t, repoKey, tvp)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@ehl-jf ehl-jf added the safe to test Approve running integration tests on a pull request label Nov 5, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Nov 5, 2025
Signed-off-by: richard.le-terrier <[email protected]>
@ehl-jf ehl-jf added the safe to test Approve running integration tests on a pull request label Nov 5, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Nov 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

👍 Frogbot scanned this pull request and did not find any new security issues.


@richardlt richardlt changed the title fix: missing fields and fixes for Terraform, Cargo, Nuget, Helm and … fix: new fields and fixes for Terraform, Cargo, Nuget, Helm, Ansible Nov 6, 2025
@richardlt richardlt requested a review from fluxxBot November 12, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants