New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JENKINS-69771 Make listSize parameter optional #20
Open
JayZ-star
wants to merge
4
commits into
jenkinsci:master
Choose a base branch
from
JayZ-star:JENKINS-69771
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
…o handle cases when listSize is not supplied (0.0.9 and earlier style call)
@huangsuoyuan can you please review this PR? |
RobinFauvel
suggested changes
Nov 6, 2023
.../com/syhuang/hudson/plugins/listgitbranchesparameter/ListGitBranchesParameterDefinition.java
Outdated
Show resolved
Hide resolved
.../com/syhuang/hudson/plugins/listgitbranchesparameter/ListGitBranchesParameterDefinition.java
Outdated
Show resolved
Hide resolved
…ter/ListGitBranchesParameterDefinition.java Co-authored-by: RobinFauvel <robin.fauvel@yahoo.fr>
…ter/ListGitBranchesParameterDefinition.java Co-authored-by: RobinFauvel <robin.fauvel@yahoo.fr>
Further fixed spacing
RobinFauvel
reviewed
Jan 23, 2024
Comment on lines
+70
to
+82
super(name, description); | ||
this.remoteURL = remoteURL; | ||
this.credentialsId = credentialsId; | ||
this.defaultValue = defaultValue; | ||
this.uuid = UUID.randomUUID(); | ||
this.sortMode = sortMode; | ||
this.selectedValue = selectedValue; | ||
this.quickFilterEnabled = quickFilterEnabled; | ||
this.listSize = DEFAULT_LIST_SIZE; | ||
|
||
setType(type); | ||
setTagFilter(tagFilter); | ||
setBranchFilter(branchFilter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
super(name, description); | |
this.remoteURL = remoteURL; | |
this.credentialsId = credentialsId; | |
this.defaultValue = defaultValue; | |
this.uuid = UUID.randomUUID(); | |
this.sortMode = sortMode; | |
this.selectedValue = selectedValue; | |
this.quickFilterEnabled = quickFilterEnabled; | |
this.listSize = DEFAULT_LIST_SIZE; | |
setType(type); | |
setTagFilter(tagFilter); | |
setBranchFilter(branchFilter); | |
this(name, description, remoteURL, credentialsId, defaultValue, sortMode, selectedValue, quickFilterEnabled, type, tagFilter, branchFilter, | |
DEFAULT_LIST_SIZE); |
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.
Fixes issue JENKINS-69771
Release 0.0.11 included fix for listSize which made the listSize parameter now functional. However the way it was implemented also meant that listSize as a new parameter must be supplied and older parameter definition setup without a listSize parameter will cause the pipeline load to fail.
This change sets up parameter overloading for ListGitBranchesParameterDefinition so that if a listSize parameter is not supplied the default DEFAULT_LIST_SIZE of 5 is used instead, making the plugin backwards compatible with older pipeline parameter definition files made with 0.0.9 and earlier versions of the plugin.
Testing done
1. Replicating the issue:
Jenkins test instance, setup with listGitBranches 0.0.13
Issue described in JENKINS-69771 recreated
Issue is due to calling listGitBranches plugin with no listSize parameter, as this pipeline was defined with release 0.0.9 in mind.
2. Running test version:
Experimental hpi compiled from this branch deployed into test Jenkins instance
Running the same job again, the job is now successful in loading jobs from pipeline files.
Submitter checklist