8000 [JENKINS-75544] fix(webhook): use `repo.html_url` instead of `repo.url` by agilgur5 · Pull Request #404 · jenkinsci/github-plugin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[JENKINS-75544] fix(webhook): use repo.html_url instead of repo.url #404

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

Merged
merged 3 commits into from
May 5, 2025

Conversation

agilgur5
Copy link
Contributor
@agilgur5 agilgur5 commented Apr 26, 2025

Summary

Per https://github.blog/changelog/2025-04-07-changes-to-the-repository-object-in-push-webhook/, GitHub now gives an API URL in the push webhook's payload for repo.url, so the code should be adjusted to handle this

Details

Misc Notes / backstory

I stumbled upon this via a question I happened to see on Stack Overflow's Staging Ground, which I suspected was a bug (and not something the asker could fix) due to the recent breaking change from GitHub. I was able to find an existing JIRA issue on the problem and so answered the question by linking to ticket.
Seemed like a straightforward fix, so I decided to take a look myself after I saw it hadn't received a fix in a week or so.
I'm otherwise a first-time Jenkins contributor, just coincidentally stumbled upon this

Testing done

  • modified the test payload to account for GitHub's changes

Submitter checklist

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

- Per https://github.blog/changelog/2025-04-07-changes-to-the-repository-object-in-push-webhook/, GitHub now gives an API URL in the push webhook's payload for `repo.url`
  - update the test payload to account for this
  - switch the code to instead use `repo.html_url`
    - previously jenkinsci@c0c83fb added `repo.html_url` as a fallback; I'm not sure why the fallback wasn't working exactly, but it should now _always_ use `repo.html_url`
@agilgur5 agilgur5 requested a review from a team as a code owner April 26, 2025 18:20
- saw this and wanted to change it, but I forgot 😅
- add a commit with the JIRA issue # since the PR name doesn't seem to auto link?
  - (last time I used JIRA, any mention of it the issue number in a GitHub PR would auto link; possibly different settings for this repo/the Jenkins org)
Copy link
@GLDevelopment GLDevelopment left a comment

Choose a reason for hiding this comment

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

Please approve this.

@agilgur5
Copy link
Contributor Author
agilgur5 commented May 5, 2025

@KostyaSha any chance you could review this? It appears to be blocking a number of people due to a recent GH change.
(also I made a few contributing docs PRs as well in the process of making this change that could use reviews too)

@KostyaSha
Copy link
Member

lets try this change

@KostyaSha KostyaSha merged commit 6a7ad9f into jenkinsci:master May 5, 2025
17 checks passed
@agilgur5 agilgur5 deleted the fix-push-repo-url branch May 28, 2025 16:43
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.

3 participants
0