Skip to content

[JENKINS-75465] Remove the support for legacyIds based directory mapping#21

Open
gbhat618 wants to merge 1 commit into
jenkinsci:masterfrom
gbhat618:JENKINS-75465-no-longer-use-legacyIds
Open

[JENKINS-75465] Remove the support for legacyIds based directory mapping#21
gbhat618 wants to merge 1 commit into
jenkinsci:masterfrom
gbhat618:JENKINS-75465-no-longer-use-legacyIds

Conversation

@gbhat618

@gbhat618 gbhat618 commented Mar 25, 2025

Copy link
Copy Markdown

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 removes RunIdMigrator from 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 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 - changelog), 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.

Original commit that introduced the code was b5f79e9#diff-a80a6b1d23fe106bf34e53c32b74caaf8bd9578f99b0b07691f940cc8ea9c41aR176-R206

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

<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.
@gbhat618 gbhat618 changed the title Remove the support for legacyIds based directory mapping [JENKINS-75465] Remove the support for legacyIds based directory mapping Mar 25, 2025
@gbhat618

gbhat618 commented Mar 25, 2025

Copy link
Copy Markdown
Author

Recommended way to get build dir, See jenkinsci/jenkins#10456 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants