Repository navigation
fix: explain builds without a root URL - #261
Merged
Merged
Conversation
… workspace context - A Jenkins without a root URL configured: explainError() threw after the provider had answered, so the step returned nothing, and an automatic explanation was never saved. Links are now made from the Jenkins root. - Pipeline Graph View before 777 calls the Stages page "pipeline-overview"; the Explain Error button now shows there too. - includeWorkspaceContext no longer drops the folder or global custom context of a step that sets none. - An auto-fix pull request body keeps "$" and "\" from the AI's text instead of failing after the commit. - Auto-fix takes a self-managed host such as github.company.com for what it is instead of sending its token to github.com, and recognises ssh://git@github.com/... and hosts with a port. - The maxLines help no longer promises "0 means unlimited", and an autoFixTimeoutSeconds of 0 falls back to the documented 120 seconds.
Member
Author
|
The CI failure is a known issue, pls ref jenkins-infra/helpdesk#5339 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Small fixes found while testing the plugin on a local Jenkins:
explainError()threwIllegalStateException: Root URL isn't configured yetafter the provider had answered, so the step returned nothing and laterpoststeps (a Slack message, say) did not run. An automatic explanation was attached in memory but never saved, so it was gone after a restart, and "View failure output" links started withnull. Links are now made from the Jenkins root.pipeline-overview, so the Explain Error button never showed there. It does now; the page's markup is the same.includeWorkspaceContextreplaced the folder and global custom context of a step that sets none. The workspace files now come on top of it.$or\in the AI's text (${jackson.version},$PATH,C:\tools) madebuildPrBodythrow after the commit, leaving the branch behind. They are kept as text.contains, sogithub.company.comorgitlab.company.comwas taken for the SaaS and its token sent toapi.github.com/gitlab.comwhen no Enterprise URL was set. Hosts are now compared exactly, andssh://git@github.com/owner/repo.gitandhttps://github.com:443/...are recognised instead of being taken for Bitbucket Server.maxLineshelp said0means unlimited (it means the default, 100), andautoFixTimeoutSeconds: 0fell back to 60 seconds while the documented default is 120.Before / After
New tests, run against
main(2a5eb46) and this branch:explainError()with no root URL returns the explanationIllegalStateExceptionbuild.xmlincludeWorkspaceContextstill sends the global custom contextpipeline-overview${jackson.version},C:\tools,$PATHIllegalArgumentExceptiongithub.company.com,gitlab.company.comnot taken for the SaaSssh://git@github.com/acme/my-repo.git,github.com:443recognisedBITBUCKET_SERVERPipeline Overview page of Pipeline Graph View 661 (the version the plugin declares), failed parallel build, user who may build the job:
After, the explanation is shown above the selected node's steps, as on the Stages page:

Related Issues
None.
Testing done
NoRootUrlTest, and new cases inCustomContextTest,PipelineGraphViewDecoratorTest,AutoFixPullRequestBodyTestandScmRepoTest; all of them fail onmainand pass here.mvn verify(JDK 21): 907 tests pass, SpotBugs reports no issues.build.xml, and the console link reads/jenkins/job/.../error-explanation/.Submitter checklist
Was generative AI tooling used to co-author this PR?