Skip to content

[JENKINS-46257] Improve Run Parameters folders support for auto-completion#26339

Open
Flamki wants to merge 1 commit intojenkinsci:masterfrom
Flamki:fix-run-parameter-autocomplete-46257
Open

[JENKINS-46257] Improve Run Parameters folders support for auto-completion#26339
Flamki wants to merge 1 commit intojenkinsci:masterfrom
Flamki:fix-run-parameter-autocomplete-46257

Conversation

@Flamki
Copy link
Contributor

@Flamki Flamki commented Feb 20, 2026

Fixes #22250

Testing done

  • Added regression test autoCompleteProjectNameInFoldersUsesLocalContext in RunParameterDefinitionTest.
  • The test covers autocomplete for a Run Parameter project name when jobs are in folders and verifies sibling resolution via local context.
  • I could not execute Maven tests locally in this environment because mvn is not installed (CommandNotFoundException); CI is expected to run full validation.

Screenshots (UI changes only)

Before

N/A

After

N/A

Proposed changelog entries

  • Use local folder context when auto-completing Run Parameter project names.

Proposed changelog category

/label rfe

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.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate. (No new public API in this PR.)
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable. (No new deprecations in this PR.)
  • 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). (No JS/UI behavior change in this PR.)
  • For dependency updates, there are links to external changelogs and, if possible, full differentials. (No dependency updates in this PR.)
  • For new APIs and extension points, there is a link to at least one consumer. (No new API/extension point in this PR.)

Desired reviewers

@jenkinsci/core-pr-reviewers

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 rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Feb 20, 2026
@Flamki
Copy link
Contributor Author

Flamki commented Feb 21, 2026

CI failure appears unrelated to this PR.\n\nAll failing jobs report SetupWizardTest.testRemoteUpdateSitePerformingValidation, which is currently tracked as a master issue in #26341 (expired test certificate).\n\nThis PR only changes RunParameter autocomplete context and adds a focused regression test. I will rebase/rerun once the upstream fix for #26341 is merged.

@Flamki
Copy link
Contributor Author

Flamki commented Feb 21, 2026

CI failure appears unrelated to this PR.

All failing jobs report SetupWizardTest.testRemoteUpdateSitePerformingValidation, which is currently broken on master due to an expired test certificate (tracked in #26341).
This PR only changes RunParameter autocomplete context + its regression test.

I will rebase and rerun once the upstream fix for #26341 is merged.

@MarkEWaite
Copy link
Contributor

CI failure appears unrelated to this PR.

That is correct. The failure is due to an expired certificate in the test. The issue is tracked as:

@Flamki Flamki force-pushed the fix-run-parameter-autocomplete-46257 branch from 762dabd to 3c02f08 Compare February 21, 2026 18:49
@Flamki Flamki force-pushed the fix-run-parameter-autocomplete-46257 branch from 3c02f08 to 4bf2987 Compare March 2, 2026 16:50
@Flamki
Copy link
Contributor Author

Flamki commented Mar 3, 2026

Rebased this PR on latest master (now at 4bf2987) and retriggered CI.

This PR remains the same functional change:

  • apply local context (@AncestorInPath) for Run Parameter project-name autocomplete
  • regression test: autoCompleteProjectNameInFoldersUsesLocalContext

Ready for review once checks complete. Thanks.

@MarkEWaite
Copy link
Contributor

Rebased this PR on latest master (now at 4bf2987) and retriggered CI.

Please don't rebase. It causes problems for reviewers. A series of commits will be squash merged and are easier for reviewers to understand the association between changes and review comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves Run Parameter project name auto-completion so it uses the local folder context, enabling sibling job resolution when jobs are organized in folders (addressing JENKINS-46257 / #22250).

Changes:

  • Update RunParameterDefinition.DescriptorImpl#doAutoCompleteProjectName to accept @AncestorInPath context (Item self, ItemGroup container) and use context-aware AutoCompletionCandidates.ofJobNames.
  • Add a regression test covering auto-completion behavior for sibling jobs inside a folder.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
core/src/main/java/hudson/model/RunParameterDefinition.java Passes Stapler ancestor context into job-name auto-completion to support folder-local resolution.
test/src/test/java/hudson/model/RunParameterDefinitionTest.java Adds a regression test ensuring folder-local auto-completion returns sibling job names.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JENKINS-46257] Improve Run Parameters folders support for auto-completion

3 participants