Skip to content
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

normalize Artifactory URL #477

Merged
merged 4 commits into from
Feb 23, 2024

Conversation

crhntr
Copy link
Contributor

@crhntr crhntr commented Feb 23, 2024

This is based on #472. That PR won't get tested because it is from a fork. This PR also rebases on main.


We were blocked from using kiln with other Artifactory servers, in our case development servers, due to find-release-version and update-release-version behaving differently from fetch for artifactory release sources.

The issue was found in internal/component/artifactory.go DownloadRelease where /artifactory is always appended to the server url:

downloadURL := ars.ArtifactoryHost + "/artifactory/" + ars.Repo + "/" + remoteRelease.RemotePath

find-release fails if we don't include /artifactory in the Kilnfile artifactory_host variable

failing

➜  hello-tile git:(feat/artifactory-source) ✗ :workspace/hello-tile$ kiln find-release-version --release hello-release --no-download -vr artifactory_username="admin" -vr artifactory_password="password" -vr artifactory_host="localhost:8082"
2024/01/23 10:31:03 could not execute "find-release-version": not found

working

➜  hello-tile git:(feat/artifactory-source) ✗ :workspace/hello-tile$ kiln find-release-version --release hello-release --no-download -vr artifactory_username="admin" -vr artifactory_password="password" -vr artifactory_host="localhost:8082/artifactory"
[Artifactory release source] 2024/01/23 10:31:07 Getting hello-release file info from artifactory
{"version":"0.2.5","remote_path":"compiled-releases/hello-release/hello-release-0.2.5-ubuntu-jammy-1.260.tgz","source":"artifactory","sha":"2c40c91568fd98a815c246916aa2b8ee80bce8cd"}

fetch, however automatically appends /artifactory, causing 404s due to requests containing /artifactory/artifactory:

failing

➜  hello-tile git:(feat/artifactory-source) ✗ :workspace/hello-tile$ kiln fetch -vr artifactory_username="admin" -vr artifactory_password="password" -vr artifactory_host="localhost:8082/artifactory"
Warning: The "allow-only-publishable-releases" flag was not set. Some fetched releases may be intended for development/testing only. EXERCISE CAUTION WHEN PUBLISHING A TILE WITH THESE RELEASES!
Gathering releases...
Found 2 missing releases to download
[Artifactory release source] 2024/01/23 10:31:36 downloading hello-release from artifactory release source artifactory
2024/01/23 10:31:36 could not execute "fetch": download failed: error from release source "artifactory": failed to download hello-release release from artifactory with error code 404

working

➜  hello-tile git:(feat/artifactory-source) ✗ :workspace/hello-tile$ kiln fetch -vr artifactory_username="admin" -vr artifactory_password="password" -vr artifactory_host="localhost:8082"
Warning: The "allow-only-publishable-releases" flag was not set. Some fetched releases may be intended for development/testing only. EXERCISE CAUTION WHEN PUBLISHING A TILE WITH THESE RELEASES!
Gathering releases...
Found 2 missing releases to download
[Artifactory release source] 2024/01/23 10:32:29 downloading hello-release from artifactory release source artifactory
[Artifactory release source] 2024/01/23 10:32:30 downloading bpm from artifactory release source artifactory
...

Thank you

Co-authored-by: Nick Rohn <nrohn@vmware.com>
Co-authored-by: Nick Rohn <nrohn@vmware.com>
Co-authored-by: Nick Rohn <nrohn@vmware.com>
Co-authored-by: Nick Rohn <nrohn@vmware.com>
@cf-gitbot
Copy link
Member

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

@crhntr crhntr added the tas-slingshots Created by https://github.com/orgs/pivotal-cf/teams/tas-strategic-initiatives-slingshot label Feb 23, 2024
@crhntr crhntr changed the base branch from main to slingshots-bake-changes February 23, 2024 21:46
@crhntr crhntr merged commit e2c7b31 into slingshots-bake-changes Feb 23, 2024
3 checks passed
@crhntr crhntr deleted the fix/artifactory-url-normalization branch February 23, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tas-slingshots Created by https://github.com/orgs/pivotal-cf/teams/tas-strategic-initiatives-slingshot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants