Skip to content

JENKINS-75644 Cache project resolution after UUID fallback#962

Open
tzachs wants to merge 1 commit into
jenkinsci:masterfrom
tzachs:bugfix/JENKINS-75644-cache-project-resolution
Open

JENKINS-75644 Cache project resolution after UUID fallback#962
tzachs wants to merge 1 commit into
jenkinsci:masterfrom
tzachs:bugfix/JENKINS-75644-cache-project-resolution

Conversation

@tzachs
Copy link
Copy Markdown

@tzachs tzachs commented Mar 29, 2026

Cache project resolution after UUID fallback to avoid repeated scans when rendering Uno-Choice parameters.

When an AbstractScriptableParameter cannot determine its owning job from the current request or from a known project name/full name, it falls back to resolving the job by the parameter UUID. This change caches the resolved project name and full name after that fallback succeeds, so subsequent evaluations can use direct lookup instead of scanning Jenkins items again.

A focused test was added in TestProjectResolutionCaching.java. It verifies that the parameter starts with projectName and projectFullName unset, that calling getChoices() forces project resolution through the UUID path, and that the new projectNameCache and projectFullNameCache fields are populated afterward.

Testing done

  • Added automated test coverage in TestProjectResolutionCaching.java for the new caching behavior after UUID-based project resolution.
  • Verified by inspection that the test exercises the new rememberProject(...) path in AbstractScriptableParameter.java.
  • Local test execution was not completed in this environment because Maven is not installed here (mvn: command not found).

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: JENKINS-75644 #897
  • Link to relevant pull requests, esp. upstream and downstream changes: JENKINS-75644 Cache project resolution after UUID fallback #962
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@tzachs tzachs requested a review from a team as a code owner March 29, 2026 20:22
@kinow kinow force-pushed the bugfix/JENKINS-75644-cache-project-resolution branch from fccae97 to 5167218 Compare April 13, 2026 21:42
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.

1 participant