Skip to content
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-74795] createItem API should not assign new jobs to default view #9933

Conversation

MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Nov 2, 2024

[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 the createItem API call to work within a view. Those two issues don't make the expected behavior clear when the createItem 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".

URL that created the job Primary (default) view Jenkins version Job added to primary view
/createItem All 2.474 Yes
/createItem All 2.475 Yes
/createItem b-list-view 2.474 No
/createItem b-list-view 2.475 Yes
/view/b-list-view/createItem All 2.474 Yes
/view/b-list-view/createItem All 2.475 Yes
/view/b-list-view/createItem b-list-view 2.474 Yes
/view/b-list-view/createItem b-list-view 2.475 Yes

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

  • Do not assign new jobs to the default view when using the 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

…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.
@MarkEWaite MarkEWaite added work-in-progress The PR is under active development, not ready to the final review bug For changelog: Minor bug. Will be listed after features labels Nov 2, 2024
Extend tests from ItemsTest to use a default view that does not by
default include the newly created jobs.
…view

Behavior in 2.474 and earlier was to not assign new jobs to the default
view.  Unfortunately, there was no automated test to check that case.
@MarkEWaite
Copy link
Contributor Author

Most recent push will cause 1 test to fail that still needs to be investigated. The new test failure was passing in 2.474

@MarkEWaite
Copy link
Contributor Author

@basil has the full solution in:

Thanks very much!

@MarkEWaite MarkEWaite closed this Nov 5, 2024
@MarkEWaite MarkEWaite deleted the createItem-adds-new-job-to-default-view branch November 5, 2024 23:49
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 work-in-progress The PR is under active development, not ready to the final review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant