Skip to content

[JENKINS-64356] fix legacyIds missing when creating jobs via REST API or CLI#9303

Merged
MarkEWaite merged 2 commits intojenkinsci:masterfrom
mawinter69:JENKINS-64356
May 27, 2024
Merged

[JENKINS-64356] fix legacyIds missing when creating jobs via REST API or CLI#9303
MarkEWaite merged 2 commits intojenkinsci:masterfrom
mawinter69:JENKINS-64356

Conversation

@mawinter69
Copy link
Contributor

@mawinter69 mawinter69 commented May 23, 2024

When creating jobs via the rest api or cli the call to onCreatedFromScratch was missing. This can lead to long startup times when many jobs are created this way.

See JENKINS-64356.

Testing done

Unit tests are no longer ignored and succeed

Proposed changelog entries

  • Improve startup performance when jobs have been created via REST API or command line interface.

Proposed upgrade guidelines

N/A

### Submitter checklist
- [x] The Jira issue, if it exists, is well-described.
- [x] 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](https://github.com/jenkins-infra/jenkins.io/blob/master/content/_data/changelogs/weekly.yml)). Fill in the **Proposed upgrade guidelines** section only if there are breaking changes or changes that may require extra steps from users during upgrade.
- [x] There is automated testing or an explanation as to why this change has no tests.
- [x] New public classes, fields, and methods are annotated with `@Restricted` or have `@since TODO` Javadocs, as appropriate.
- [x] New deprecations are annotated with `@Deprecated(since = "TODO")` or `@Deprecated(forRemoval = true, since = "TODO")`, if applicable.
- [x] 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](https://www.jenkins.io/doc/developer/security/csp/)).
- [x] For dependency updates, there are links to external changelogs and, if possible, full differentials.
- [x] For new APIs and extension points, there is a link to at least one consumer.

Before the changes are marked as ready-for-merge:

### Maintainer checklist
- [x] There are at least two (2) approvals for the pull request and no outstanding requests for change.
- [x] Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
- [x] Changelog entries in the pull request title and/or **Proposed changelog entries** are accurate, human-readable, and in the imperative mood.
- [x] Proper changelog labels are set so that the changelog can be generated automatically.
- [x] 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](https://github.com/jenkinsci/jenkins/pull/4387)).
- [x] If it would make sense to backport the change to LTS, a Jira issue must exist, be a _Bug_ or _Improvement_, and be labeled as `lts-candidate` to be considered (see [query](https://issues.jenkins.io/issues/?filter=12146)).

… or cli

When creating jobs via the rest api or cli the call to
onCreatedFromScratch was missing. This can lead to long startup times
when many jobs are created this way.
@mawinter69 mawinter69 changed the title [JENKINS-64356] call onCreatedFromScratch after creating item via rest api or cli [JENKINS-64356] fix legacyIds missing when creating jobs via REST API or CLI May 23, 2024
@mawinter69 mawinter69 marked this pull request as ready for review May 23, 2024 23:00
@MarkEWaite MarkEWaite added rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted bug For changelog: Minor bug. Will be listed after features and removed bug For changelog: Minor bug. Will be listed after features labels May 25, 2024
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Thanks!

@MarkEWaite
Copy link
Contributor

This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback.

/label ready-for-merge

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label May 25, 2024
@MarkEWaite MarkEWaite merged commit c46dc4b into jenkinsci:master May 27, 2024
@mawinter69 mawinter69 deleted the JENKINS-64356 branch January 31, 2025 13:46
gbhat618 added a commit to gbhat618/jenkins that referenced this pull request Mar 25, 2025
This test was written as originally the legacyIds were missing when the job was created from CLI or REST API.
https://github.com/jenkinsci/jenkins/pull/8758/files

Later after the issue was fixed, ensuring CLI and REST API jobs also have legacyIds files, the test was made active,
jenkinsci#9303

Now as the entire RunMigrator itself is going away there is no need for this test anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback 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.

3 participants