Skip to content

Fail fast with clear error when Jenkins root URL is missing - #142

Open
PiyushMalik01 wants to merge 4 commits into
jenkinsci:mainfrom
PiyushMalik01:FixIssue#142
Open

Fail fast with clear error when Jenkins root URL is missing#142
PiyushMalik01 wants to merge 4 commits into
jenkinsci:mainfrom
PiyushMalik01:FixIssue#142

Conversation

@PiyushMalik01

@PiyushMalik01 PiyushMalik01 commented Feb 1, 2026

Copy link
Copy Markdown

Fixes #114

What this PR does

When the Jenkins root URL is not configured, MCP tool calls currently fail with an unclear
serialization error that does not explain the real problem.

This PR adds an explicit check for a missing Jenkins root URL and returns a clear,
actionable error message that guides the user to fix the issue via
Manage Jenkins → Configure System.

This makes the failure easier to understand and avoids confusing low-level errors.


Testing done

Manually tested on a local Jenkins instance started with mvn hpi:run.

  • Verified that calling an MCP tool without configuring the Jenkins root URL now returns a clear, user-friendly error message
  • Verified that MCP tools continue to work as expected once the root URL is configured

No automated tests were added since this behavior depends on Jenkins runtime configuration.


Submitter checklist

  • Ensure that the pull request title represents the desired changelog entry
  • Describe what was changed
  • Manually tested the change

@PiyushMalik01
PiyushMalik01 requested a review from a team as a code owner February 1, 2026 00:48

@topikachu topikachu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you move this validation logic to the beginning of Endpoint#init so it fails fast during initialization?

Also, since this depends on the Jenkins root URL being properly configured, we should explicitly document that requirement in the README and explain how to set it.

Thanks

@PiyushMalik01

Copy link
Copy Markdown
Author

ok , I’ll push an update shortly

@PiyushMalik01

Copy link
Copy Markdown
Author

@topikachu
Thanks for the feedback! I've updated the implementation to validate the Jenkins root URL at the beginning of tool invocation, so it fails early instead of during result serialization. Please let me know if this looks good.

@PiyushMalik01

Copy link
Copy Markdown
Author

@topikachu I’ve added a section to the README documenting the Jenkins root URL requirement and how to configure it. Please let me know if the placement or wording looks good.

@PiyushMalik01
PiyushMalik01 force-pushed the main branch 2 times, most recently from 70e80dc to 0d0d2d6 Compare February 2, 2026 15:40
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.

Hidden IllegalArgumentException when Jenkins root URL is not set

2 participants