[JENKINS-74795] createItem API should not assign new jobs to default view #9933
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.
[JENKINS-74795] createItem API should not assign new jobs to default view
Prior to Jenkins 2.475, jobs that were created with the
createItem
API were not automatically assigned to the default view. Jenkins 2.475 changed that behavior so that newly created jobs are always assigned to the default view.This test checks that behavior. The test will need to be adapted when the fix is applied. Fix is intended to be included in this pull request as a later change.
See JENKINS-74795.
JENKINS-9264 shows that it is intentional that a user can create a new job using the
createItem
API call under a view and JENKINS-41128 indicates that users expect thecreateItem
API call to work within a view. Those two issues don't make the expected behavior clear when thecreateItem
API call is used to create a new item from the Jenkins base URL but the default view ("primary view") is configured to not show that newly created job. In that case, 2.474 would create the job and not show it in the view, while 2.475 would create the job and add it to the view.In the table below, the job being created has a name that will not cause it to be shown in the view "b-list-view".
/createItem
/createItem
/createItem
/createItem
/view/b-list-view/createItem
/view/b-list-view/createItem
/view/b-list-view/createItem
/view/b-list-view/createItem
Testing done
Confirmed with interactive testing and bisect that the createItem behavior changed for 2.475. The command line interface behavior did not change, only the createItem API.
Proposed changelog entries
createItem
API from the root URL.Proposed upgrade guidelines
N/A
Submitter checklist
Desired reviewers
N/A
Before the changes are marked as
ready-for-merge
:Maintainer checklist