jenkinsci / embeddable-build-status-plugin

Embed build status of Jenkins jobs in web pages
https://plugins.jenkins.io/embeddable-build-status/
MIT License
166 stars 259 forks source link

Resolve incorrect badge examples when opened directly from URL #290

Closed sridamul closed 5 months ago

sridamul commented 7 months ago

Closes #278

Approach:

Replaced the getReferer() method with getRequestURL() (I am not sure if it is the optimal way to do it, but it fixes the issue without any flaws). Also modified the test cases to use getRequestURL() with and without badge/ at the end of the URL.

Testing done

Before: before

Now:

https://github.com/jenkinsci/embeddable-build-status-plugin/assets/107404972/76d047cb-1779-44c1-980a-95980c1c8175

### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [ ] Link to relevant pull requests, esp. upstream and downstream changes
- [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
sridamul commented 6 months ago

@MarkEWaite If possible Can you review this?

MarkEWaite commented 6 months ago

@MarkEWaite If possible Can you review this?

Thanks for the ping @sridamul . I have several other things that need my attention before I leave next week for several weeks of vacation. I'm not sure that I'll have time to review this before mid March.

sridamul commented 6 months ago

Hey @MarkEWaite, Can you review this now?

MarkEWaite commented 6 months ago

Not yet @sridamul . Other things are needing my attention this week. I may be able to review it next week

sridamul commented 5 months ago

Hey @MarkEWaite Just a reminder ping to review this PR.

MarkEWaite commented 5 months ago

Thanks very much for the fix. I introduced the bug when I added a copy button for the link examples and transitioned from defining the pages with groovy to defining them with jelly. Jelly is more widely used for page definition in Jenkins than groovy and has better support for the most recent user interface updates. The pull request that created the issue was: