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

Update Plugin to Support Separate URL's for API and Frontend - Links to Projects do not work without this #22

Closed
JBlandHV opened this issue Jan 17, 2021 · 9 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@JBlandHV
Copy link

I'm running Dependency Track v4.0.1 using Docker where you have a separate URL for the API and another one for the Front End. To get this Jenkins plugin to work with the API you need to specify that URL, this works fine and details are shown in Jenkins on the job.

However the link that suggests to go to Dependency Track for more information, the Project link does not work because it goes to the API URL and not the Frontend URL.

My URL's are as follows:

API: dependency-check-api.domain.com
Frontend: dependency-check.domain.com

I think we just need an option to add in a second FrontEnd URL so the links in the builds will work.

Environment Information

  • Plugin Version: 3.0.2
  • Jenkins Version: 2.263.2
  • Java Version for Jenkins: openjdk 11.0.9.1 2020-11-04
  • Type of Jenkins Job: declarative pipeline
  • Dependency-Track Version: 4.0.1

To Reproduce

Steps to reproduce the behavior:

  1. Go to a build which has used Dependency Track
  2. Click on 'Dependency-Track Project'
  3. Link will fail because it has gone to the API URL, the only one it knows about

Expected behavior

Opens up the Dependency Track UI at the correct project.

NOTE: This can be done manually by editing the URL to change it from the API to FrontEnd link but will be solved by having a second FrontEnd URL to be entered in the settings for the plugin

@JBlandHV JBlandHV added the bug Something isn't working label Jan 17, 2021
@sephiroth-j sephiroth-j added enhancement New feature or request and removed bug Something isn't working labels Jan 17, 2021
@jonbrohauge
Copy link

jonbrohauge commented Jan 18, 2021

Is anyone looking at this?
I'm trying to hack my way through this, but I'm no Jenkins-plugin expert.

@jonbrohauge
Copy link

@sephiroth-j Could you take a look to see if it's something remotely useful?
PR: #23

@sephiroth-j
Copy link
Member

@jonbrohauge, thanks for the PR, I will look at it within the next days.

@sephiroth-j sephiroth-j self-assigned this Jan 18, 2021
@sephiroth-j sephiroth-j added this to the v3.1.0 milestone Jan 22, 2021
@sephiroth-j
Copy link
Member

Separating Frontend and Backend was already possible in version 3.8. The bundled distribution is still available with v4.0 but deprecated. The new setting will therefore be optional.

sephiroth-j added a commit that referenced this issue Jan 23, 2021
The frontend may be hosted on a different server and links in the log or result actions will not work in this case.

references #22
@sephiroth-j
Copy link
Member

@jonbrohauge , @JBlandHV : Please give this build a try. It contains the proposed fix this issue.
https://github.com/jenkinsci/dependency-track-plugin/suites/1886262418/artifacts/36865613

@jonbrohauge
Copy link

@sephiroth-j Works on my machine 😉

@JBlandHV
Copy link
Author

@sephiroth-j This also works for me. I noticed on jobs that have already run it doesn't as I guess those URL's are already generated but new ones work like a champ. I'm not worried about the older jobs and ultimately imagine nothing much to be done about it, they'll drop out of the system over time anyway.

Appreciate the fast fix on this.

@sephiroth-j
Copy link
Member

Thanks for testing. 😃

@sephiroth-j This also works for me. I noticed on jobs that have already run it doesn't as I guess those URL's are already generated but new ones work like a champ.

Yes, that is correct, the new URL is only used for new build jobs. This is because the URL can be specific to a job run and is therefore persisted along with the job result.

@JBlandHV
Copy link
Author

No problems. That makes sense :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants