[JENKINS-75465] Remove the support for legacyIds based directory mapping#21
Open
gbhat618 wants to merge 1 commit into
Open
[JENKINS-75465] Remove the support for legacyIds based directory mapping#21gbhat618 wants to merge 1 commit into
gbhat618 wants to merge 1 commit into
Conversation
<details><summary>Background</summary> Jenkins previously changed the naming convention for build directories from a date-time-based format to a build number-based format. To facilitate this transition, an automated migrator, `RunIdMigrator`, was introduced to rename existing build folders accordingly. [jenkinsci/jenkins/pull/10456](jenkinsci/jenkins#10456) removes `RunIdMigrator` from Jenkins core, meaning direct upgrades from Jenkins 1.596 (or earlier) to the latest version will no longer be supported. Users must first upgrade to an intermediate version before upgrading to the latest release. </details> **Why is it no longer necessary to check legacyIds mapping in this plugin?** The method `recalculateBasePath` previously translated a base path like: `/path/to/jhome/jobs/my-job/builds/2014-12-01-00-01-01/tcreports` to `/path/to/jhome/jobs/my-job/builds/10/tcreports`; where `2014-12-01-00-01-01` mapped to build number `10` using the `legacyIds` file. However, since Jenkins `1.597` (released on 2015-01-19), new jobs no longer populate the `legacyIds` file, it simply empty. This means for any job created in the last 10+ years, the method has been effectively returning `basePath` unchanged. Given that virtually all jobs and controllers in use today fall into this category, the legacy lookup is no longer needed, and this removal simplifies the code while maintaining expected behavior.
14 tasks
Author
|
Recommended way to get build dir, See jenkinsci/jenkins#10456 (comment) |
jglick
approved these changes
Mar 25, 2025
This file contains hidden or 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
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.
See JENKINS-75465.
Background
Jenkins previously changed the naming convention for build directories from a date-time-based format to a build number-based format. To facilitate this transition, an automated migrator,
RunIdMigrator, was introduced to rename existing build folders accordingly. jenkinsci/jenkins/pull/10456 removesRunIdMigratorfrom Jenkins core, meaning direct upgrades from Jenkins 1.596 (or earlier) (10 yr old version) to the latest version will no longer be supported. Users must first upgrade to an intermediate version before upgrading to the latest release.Why is it no longer necessary to check legacyIds mapping in this plugin?
The method
recalculateBasePathpreviously translated a base path like:/path/to/jhome/jobs/my-job/builds/2014-12-01_00-01-01/tcreportsto
/path/to/jhome/jobs/my-job/builds/10/tcreports;where
2014-12-01_00-01-01mapped to build number10using thelegacyIdsfile.However, since Jenkins
1.597(released on 2015-01-19 - changelog), new jobs no longer populate thelegacyIdsfile, it simply empty. This means for any job created in the last 10 years, the method has been effectively returningbasePathunchanged.Given that virtually all jobs and controllers in use today fall into this category, the legacy lookup is no longer needed, and this removal simplifies the code while maintaining expected behavior.
Original commit that introduced the code was b5f79e9#diff-a80a6b1d23fe106bf34e53c32b74caaf8bd9578f99b0b07691f940cc8ea9c41aR176-R206
Testing done
Submitter checklist