Skip to content

Conversation

@ollehu
Copy link
Contributor

@ollehu ollehu commented Jan 12, 2026

Fixes #26106

In the new experimental deferred render, getNearestAncestorUrl returns null and sends the user to an invalid URL. Use request.getContextPath to build the cloud URL in that case.

Testing done

Let me know if any UTE is desired/required here. Unsure what goes for these experimental features. I did test that the URL builds correctly with this change.

Proposed changelog entries

  • Fix cloud URL when using experimental settings redesign

Proposed changelog category

/label bug
/remove-label regression-fix

Proposed upgrade guidelines

N/A

Submitter checklist

  • The issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • [? See above] There is automated testing or an explanation as to why this change has no tests.
  • [NA] New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • [NA] New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • [NA] UI changes do not introduce regressions when enforcing the current default rules of Content Security Policy Plugin. In particular, new or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • [NA] For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • [NA] For new APIs and extension points, there is a link to at least one consumer.

Before the changes are marked as ready-for-merge:

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, be a Bug or Improvement, and either the issue or pull request must be labeled as lts-candidate to be considered.

@comment-ops-bot comment-ops-bot bot added the regression-fix Pull request that fixes a regression in one of the previous Jenkins releases label Jan 12, 2026
Copy link
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.

Thanks for the PR / issue, cc @janfaracik, we'll need to dig into and see why its returning null and causing issues now.

@ollehu
Copy link
Contributor Author

ollehu commented Jan 12, 2026

Thanks for the PR / issue, cc @janfaracik, we'll need to dig into and see why its returning null and causing issues now.

No problem. Long time Jenkins user, happy to contribute.

I traced the regression to the lazy loading introduced here: https://github.com/janfaracik/jenkins/blob/366b31bf16ec6c48e9e03e6c55cac39767b5b9e4/core/src/main/resources/lib/layout/settings-subpage.jelly#L120
With the lazy-loaded subpage, jenkins isn’t in the ancestor chain when the URL is constructed, so the base URL resolves to null. But I’m not a Java expert, and even less familiar with Apache Jelly.

@mawinter69
Copy link
Contributor

Please also see #26002 (comment). Can you test if that is sufficient?

@ollehu
Copy link
Contributor Author

ollehu commented Jan 12, 2026

Please also see #26002 (comment). Can you test if that is sufficient?

@mawinter69 Yes, setting noDefer="true" also solves this. Would you prefer that over safeguarding the URL-builder function?

@timja
Copy link
Member

timja commented Jan 12, 2026

Please also see #26002 (comment). Can you test if that is sufficient?

@mawinter69 Yes, setting noDefer="true" also solves this. Would you prefer that over safeguarding the URL-builder function?

Yes please

@ollehu ollehu marked this pull request as ready for review January 13, 2026 11:16
Copy link
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.

Thanks!

@comment-ops-bot comment-ops-bot bot added bug For changelog: Minor bug. Will be listed after features and removed regression-fix Pull request that fixes a regression in one of the previous Jenkins releases labels Jan 13, 2026
@timja timja merged commit 1ce1de6 into jenkinsci:master Jan 14, 2026
19 checks passed
@welcome
Copy link

welcome bot commented Jan 14, 2026

Congratulations on getting your very first Jenkins core pull request merged 🎉🥳

This is a fantastic achievement, and we're thrilled to have you as part of our community! Thank you for your valuable input, and we look forward to seeing more of your contributions in the future!

We would like to invite you to join the community chats and forums to meet other Jenkins contributors 😊
Don't forget to check out the participation page to learn more about how to contribute to Jenkins.


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.

Manage Jenkins -> Clouds leads to a broken URL with experimental design

4 participants