Skip to content

fix: explain builds without a root URL - #261

Merged
shenxianpeng merged 4 commits into
mainfrom
bugfix/quick-fixes
Oct 23, 2026
Merged

shenxianpeng merged 4 commits into
mainfrom
bugfix/quick-fixes

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Description

Small fixes found while testing the plugin on a local Jenkins:

  1. No root URL configured (common when Jenkins is set up without the setup wizard): explainError() threw IllegalStateException: Root URL isn't configured yet after the provider had answered, so the step returned nothing and later post steps (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 with null. Links are now made from the Jenkins root.
  2. Pipeline Graph View before 777 calls the Stages page pipeline-overview, so the Explain Error button never showed there. It does now; the page's markup is the same.
  3. includeWorkspaceContext replaced the folder and global custom context of a step that sets none. The workspace files now come on top of it.
  4. Auto-fix pull request body: $ or \ in the AI's text (${jackson.version}, $PATH, C:\tools) made buildPrBody throw after the commit, leaving the branch behind. They are kept as text.
  5. Auto-fix host detection used contains, so github.company.com or gitlab.company.com was taken for the SaaS and its token sent to api.github.com / gitlab.com when no Enterprise URL was set. Hosts are now compared exactly, and ssh://git@github.com/owner/repo.git and https://github.com:443/... are recognised instead of being taken for Bitbucket Server.
  6. Docs: the maxLines help said 0 means unlimited (it means the default, 100), and autoFixTimeoutSeconds: 0 fell back to 60 seconds while the documented default is 120.

Before / After

New tests, run against main (2a5eb46) and this branch:

Check Before After
explainError() with no root URL returns the explanation fails: IllegalStateException passes
Automatic explanation with no root URL is saved in build.xml fails: not saved passes
Step with includeWorkspaceContext still sends the global custom context fails: dropped passes
Explain Error page check accepts pipeline-overview fails passes
PR body keeps ${jackson.version}, C:\tools, $PATH fails: IllegalArgumentException passes
github.company.com, gitlab.company.com not taken for the SaaS fails: taken for GitHub/GitLab passes
ssh://git@github.com/acme/my-repo.git, github.com:443 recognised fails: BITBUCKET_SERVER passes

Pipeline Overview page of Pipeline Graph View 661 (the version the plugin declares), failed parallel build, user who may build the job:

Before After
Desktop before desktop after desktop
Mobile before mobile after mobile

After, the explanation is shown above the selected node's steps, as on the Stages page:
after explained

Related Issues

None.

Testing done

  • New NoRootUrlTest, and new cases in CustomContextTest, PipelineGraphViewDecoratorTest, AutoFixPullRequestBodyTest and ScmRepoTest; all of them fail on main and pass here.
  • mvn verify (JDK 21): 907 tests pass, SpotBugs reports no issues.
  • On a local Jenkins with an OpenAI-compatible mock and no root URL: the step returns its title, the automatic explanation is in build.xml, and the console link reads /jenkins/job/.../error-explanation/.

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

Was generative AI tooling used to co-author this PR?
  • Yes (please specify below)

… 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.
@shenxianpeng
shenxianpeng requested a review from a team as a code owner October 20, 2026 17:07
@shenxianpeng shenxianpeng added the bug For changelog: Minor bug. Will be listed after features label Oct 20, 2026
@shenxianpeng

Copy link
Copy Markdown
Member Author

The CI failure is a known issue, pls ref jenkins-infra/helpdesk#5339

@shenxianpeng shenxianpeng changed the title fix: explain builds without a root URL, on older Graph View, and with workspace context fix: explain builds without a root URL Oct 20, 2026
@shenxianpeng
shenxianpeng merged commit 6472882 into main Oct 23, 2026
18 checks passed
@shenxianpeng
shenxianpeng deleted the bugfix/quick-fixes branch October 23, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug For changelog: Minor bug. Will be listed after features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant