Skip to content

feat: allow for custamizable detailsURL in withChecks#329

Open
esatterwhite wants to merge 1 commit into
jenkinsci:masterfrom
answerbook:feature/custom-details-url
Open

feat: allow for custamizable detailsURL in withChecks#329
esatterwhite wants to merge 1 commit into
jenkinsci:masterfrom
answerbook:feature/custom-details-url

Conversation

@esatterwhite
Copy link
Copy Markdown

When using the withChecks wrapper the details url always points to the jenkins ui for the build. in cases where jenkins is behind a comany firewall or other network boundaries, this can be a bit frustrating for people outside the firewall on public facing repositories. Having the details url point to something that is accessible is very useful, but it is only possible with publishChecks.

This aims to add the same functionality through the withChecks step.

Resolves: #328

Testing done

  • I stood up a local instance of jenkins w/ this plugin
  • I created a github repo
  • added a Jenkinsfile
  • allowed the job to run against a gitub repo and publish checks with a custom url
pipeline {
    agent any

    stages {
        stage('Hello') {
            steps {
                withChecks(
                    name: 'test',
                    detailsURL: 'http://codedependant.net'
                ) {
                    echo 'Hello World'
                    echo 'ls -alh'
                }
            }
        }
    }
}

Reference build: https://github.com/esatterwhite/jenkins-checks-test/pull/1/checks?check_run_id=77236702409

It also still works with the original function signature syntax

withChecks('test') {
// more steps
}

Reference build: https://github.com/esatterwhite/jenkins-checks-test/pull/2/checks?check_run_id=77240137433

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 demonstrate the feature works or the issue is fixed

Copy link
Copy Markdown
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

not tested fully end 2 end but I've checked the UI and it looks fine.

Few minor comments.

* @return a custom destination URL template string or empty string to use the default
*/
public String getCustomDetailsUrl(final Job<?, ?> job) {
return StringUtils.EMPTY;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

don't use the empty string, just return null I think

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@timja
Should defaultURL default to null everywhere? I think I'm defaulting it to an empty string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah default to null

@esatterwhite esatterwhite force-pushed the feature/custom-details-url branch 2 times, most recently from 2115c99 to 8f759f8 Compare May 21, 2026 21:58
When using the withChecks wrapper the details url always points to the
jenkins ui for the build. in cases where jenkins is behind a comany
firewall or other network boundaries, this can be a bit frustrating for
people outside the firewall on public facing repositories. Having the
details url point to something that is accessible is very useful, but it
is only possible with publishChecks.

This aims to add the same functionality through the withChecks step.

Resolves: jenkinsci#328
@esatterwhite esatterwhite force-pushed the feature/custom-details-url branch from 8f759f8 to 8183f2d Compare May 21, 2026 22:16
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.

Allow for custom details urls

2 participants