Skip to content

[JENKINS-75465] Delete RunIdMigrator as it has been 10 years since this migration#10456

Merged
krisstern merged 12 commits intojenkinsci:masterfrom
gbhat618:JENKINS-75465-remove-run-migrator
Apr 4, 2025
Merged

[JENKINS-75465] Delete RunIdMigrator as it has been 10 years since this migration#10456
krisstern merged 12 commits intojenkinsci:masterfrom
gbhat618:JENKINS-75465-remove-run-migrator

Conversation

@gbhat618
Copy link
Contributor

@gbhat618 gbhat618 commented Mar 24, 2025

See JENKINS-75465.


This PR proposes to remove RunIdMigrator, which was required when upgrading the controller from version 1.596 (or earlier) to 1.597 (or later).

In Jenkins 1.597, build directories started using build numbers instead of the previous datetime format (yyyy-MM-dd_HH-mm-ss) for directory naming. Since these versions were released long ago, the migration logic is no longer necessary.

  • Jenkins 1.596 – Released on 2015-01-04 (changelog)
  • Jenkins 1.597 – Released on 2015-01-19 (changelog)
All related PRs of various changes around RunIdMigration

how did the migration work

RunIdMigrator handled migration of old build directories to the new format by:

  • Deleted the build number symlink pointing to datetime format (yyyy-MM-dd_HH-mm-ss) directory. Renaming build directories from datetime format to build numbers.
  • Updating build.xml by changing the <id> field from datetime format to numerical ID and storing the original datetime in the <timestamp> field. Removed the <number> field as it is not longer required the directory itself is the build number.
  • Recording migrated builds in a legacyIds marker file.
  • Providing a delete method to remove entries from legacyIds when a build is deleted.
legacyIds marker file
  • On Job Load: First time after upgrade to 1.597 or higher, all builds with the old folder format were migrated, and their IDs were recorded in legacyIds (for supported downgrading and undo migration).
  • On New Job Creation: An empty legacyIds file was created. This applied to any job created on Jenkins 1.597 or later, including current versions.
  • For Jobs with legacyIds Present: These jobs were considered migrated, and no further migration was applied.

Plan for legacyIds Marker File in Existing Jobs

  • Newly created jobs will no longer contain the legacyIds marker file.
  • legacyIds marker file will be deleted upon Jenkins upgrade to reduce inode usage.

This results in a changelog entry and upgrade guideline warning about downgrading may cause potential slowness in Jenkins startup.

Testing done

Verify code usages

Find usages of legacyIds: search jenkinsci org found in 4 places


Manual testing

Test job execution works after upgrade and later downgrade
  • Create a hello-world job in jenkins 2.502 run two builds.
  • Upgrade to a version after RunIdMigrator removal 2.503-snapshot, trigger new builds, and verify functionality.
  • Create a new job in 2.503-snapshot, run two builds.
  • Downgrade to 2.502, trigger builds, and verify functionality.
Marker file creation no longer happens for now jobs
gbhat@gbhat-MacBook-Pro jobs ±|test ✗|→ ls -l
total 0
drwxr-xr-x@ 5 gbhat  gbhat  160 Mar 24 16:52 fjob_2_502
drwxr-xr-x@ 5 gbhat  gbhat  160 Mar 24 16:52 fjob_2_503
drwxr-xr-x@ 5 gbhat  gbhat  160 Mar 24 16:52 job_2_502
drwxr-xr-x@ 5 gbhat  gbhat  160 Mar 24 16:52 job_2_503
gbhat@gbhat-MacBook-Pro jobs ±|test ✗|→ find . -type f -name "legacyIds"
gbhat@gbhat-MacBook-Pro jobs ±|test ✗|→
Old jobs' marker file is deleted in first startup upon upgrade
2025-03-25 05:33:41.971+0000 [id=41]	INFO	h.p.b.g.GlobalTimeOutConfiguration#load: global timeout not set
2025-03-25 05:33:42.285+0000 [id=40]	INFO	jenkins.InitReactorRunner$1#onAttained: System config loaded
2025-03-25 05:33:42.285+0000 [id=40]	INFO	jenkins.InitReactorRunner$1#onAttained: System config adapted
2025-03-25 05:33:42.291+0000 [id=39]	INFO	hudson.model.Job#onLoad: Deleting legacyIds file in /.../jhome/jobs/fjob_2_502/builds. See https://issues.jenkins.io/browse/JENKINS-75465 for more information.
2025-03-25 05:33:42.291+0000 [id=44]	INFO	hudson.model.Job#onLoad: Deleting legacyIds file in /.../jhome/jobs/job_2_502/builds. See https://issues.jenkins.io/browse/JENKINS-75465 for more information.
2025-03-25 05:33:42.310+0000 [id=45]	INFO	jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2025-03-25 05:33:42.313+0000 [id=54]	INFO	jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
2025-03-25 05:33:42.324+0000 [id=33]	INFO	jenkins.InitReactorRunner$1#onAttained: Completed initialization
2025-03-25 05:33:42.342+0000 [id=26]	INFO	hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running

Marker file gets created for all jobs when downgraded - from 2.503-snapshot to 2.502

The file is getting created in

2025-03-25 06:33:48.253+0000 [id=34]	INFO	jenkins.InitReactorRunner$1#onAttained: System config loaded
2025-03-25 06:33:48.253+0000 [id=34]	INFO	jenkins.InitReactorRunner$1#onAttained: System config adapted
2025-03-25 06:33:48.259+0000 [id=54]	INFO	jenkins.model.RunIdMigrator#migrate: Migrating build records in /.../jhome/jobs/fjob_2_503/builds. See https://www.jenkins.io/redirect/build-record-migration for more information.
2025-03-25 06:33:48.259+0000 [id=36]	INFO	jenkins.model.RunIdMigrator#migrate: Migrating build records in /.../jhome/jobs/fjob_2_502/builds. See https://www.jenkins.io/redirect/build-record-migration for more information.
2025-03-25 06:33:48.259+0000 [id=51]	INFO	jenkins.model.RunIdMigrator#migrate: Migrating build records in /.../jhome/jobs/job_2_503/builds. See https://www.jenkins.io/redirect/build-record-migration for more information.
2025-03-25 06:33:48.259+0000 [id=50]	INFO	jenkins.model.RunIdMigrator#migrate: Migrating build records in /.../jhome/jobs/job_2_502/builds. See https://www.jenkins.io/redirect/build-record-migration for more information.
2025-03-25 06:33:48.284+0000 [id=55]	INFO	jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2025-03-25 06:33:48.287+0000 [id=42]	INFO	jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
2025-03-25 06:33:48.296+0000 [id=41]	INFO	jenkins.InitReactorRunner$1#onAttained: Completed initialization
2025-03-25 06:33:48.313+0000 [id=26]	INFO	hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running
Tested that CloudBees KB article's script works during downgrade, and no migration done if `legacyIds` is precreated

command execution

gbhat@gbhat-MacBook-Pro jobs ±|test ✗|→ #!/bin/bash

if [ ! -d "${JENKINS_HOME}/jobs" ]; then
    echo "JENKINS_HOME=${JENKINS_HOME} seems wrong"
fi

# gfind all Job builds directory with a missing 'legacyIds' file.
gcomm -1 -3 --zero-terminated \
  <(gfind ${JENKINS_HOME}/jobs -depth -type f -iname 'legacyIds' -printf '%h\0' | sort -z) \
  <(gfind ${JENKINS_HOME}/jobs -depth -type d -iname 'builds' -prune -print0 | sort -z) | while read -d $'\0' file;
do
  echo "Migrating build records in ${file}"
  touch "${file}/legacyIds"
done
Migrating build records in /Users/gbhat/CBNotes/general/tasks/t36-runidmigrator-delete/jhome/jobs/fjob_2_502/builds
Migrating build records in /Users/gbhat/CBNotes/general/tasks/t36-runidmigrator-delete/jhome/jobs/fjob_2_503/builds
Migrating build records in /Users/gbhat/CBNotes/general/tasks/t36-runidmigrator-delete/jhome/jobs/job_2_502/builds
Migrating build records in /Users/gbhat/CBNotes/general/tasks/t36-runidmigrator-delete/jhome/jobs/job_2_503/builds

jenkins startup logs

2025-03-25 06:50:47.456+0000 [id=26]	INFO	jenkins.model.Jenkins#<init>: Starting version 2.502
2025-03-25 06:50:47.484+0000 [id=33]	INFO	jenkins.InitReactorRunner$1#onAttained: Started initialization
2025-03-25 06:50:47.554+0000 [id=35]	INFO	jenkins.InitReactorRunner$1#onAttained: Listed all plugins
2025-03-25 06:50:48.610+0000 [id=51]	INFO	jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
2025-03-25 06:50:48.616+0000 [id=48]	INFO	jenkins.InitReactorRunner$1#onAttained: Started all plugins
2025-03-25 06:50:48.617+0000 [id=54]	INFO	jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
2025-03-25 06:50:48.701+0000 [id=50]	INFO	h.p.b.g.GlobalTimeOutConfiguration#load: global timeout not set
2025-03-25 06:50:49.019+0000 [id=33]	INFO	jenkins.InitReactorRunner$1#onAttained: System config loaded
2025-03-25 06:50:49.019+0000 [id=33]	INFO	jenkins.InitReactorRunner$1#onAttained: System config adapted
2025-03-25 06:50:49.040+0000 [id=54]	INFO	jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2025-03-25 06:50:49.044+0000 [id=45]	INFO	jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
2025-03-25 06:50:49.053+0000 [id=34]	INFO	jenkins.InitReactorRunner$1#onAttained: Completed initialization
2025-03-25 06:50:49.071+0000 [id=26]	INFO	hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running

Proposed changelog entries

  • New jobs will no longer create an empty legacyIds marker file in the builds directory, and existing jobs' legacyIds files will be deleted upon upgrade to reduce inode usage.

Proposed changelog category

/label removed

Proposed upgrade guidelines

No action is required. On the first startup after upgrading, you will see an info log: hudson.model.Job#onLoad: Deleting legacyIds file in /.../JENKINS_HOME/jobs/my-job/builds. See https://issues.jenkins.io/browse/JENKINS-75465 for more information.. However, if you plan to downgrade after upgrading, you may want to manually create the legacyIds file in the builds directory to prevent a potential slow startup. This is because the older version will perform migration checks when the file is missing. For reference, see this CloudBees KB workaround bash script.

Submitter checklist

  • The Jira issue, if it exists, is well-described.
  • 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). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • 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).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

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

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • 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).
  • 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).

@jglick
Copy link
Member

jglick commented Mar 24, 2025

Introducing code to remove it would add technical debt.

A bit, but very small, just something along the lines of

Files.deleteIfExists(buildDir.resolve("legacyIds"));

which I think is justified by reducing the number of inodes consumed by job directories.

@jglick
Copy link
Member

jglick commented Mar 24, 2025

testcomplete-plugin (code ref)

It is difficult to follow what the purpose of this code was (no plugin should ever have needed to know about the format of build directory names since Run.getRootDir supplies the same for you), but at any rate so far as I can tell the behavior of this method is identical whether legacyIds exists and is empty or if it does not exist: it will return basePath (whatever that is).

@jglick
Copy link
Member

jglick commented Mar 24, 2025

Looks like you missed some files

$ git ls-files|fgrep RunIdMigrator
core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index.jelly
core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index_bg.properties
core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index_de.properties
core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index_it.properties
core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index_pt_BR.properties
core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index_sr.properties
core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index_sv_SE.properties
core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index_zh_TW.properties
test/src/test/java/jenkins/model/RunIdMigratorTest.java

@jglick
Copy link
Member

jglick commented Mar 24, 2025

(Not sure about that last one; there are two RunIdMigratorTest.javas, one unit test in core and one JenkinsRule in test. Maybe Git was getting them mixed up.)

@jglick
Copy link
Member

jglick commented Mar 24, 2025

Also double-check

git ls-files -z | xargs -0 fgrep RunIdMigrator

The unmigrator and associated jelly file was added in jenkinsci@711b332#diff-0d6badde279147be675402c9ace9f24434ba7942c2bb83ce79f069d0dc5a5eb2
In March 2024, the  unmigrator was deleted via jenkinsci#9092; however it appears to have missed to remove the Jelly files. Now deleting the jelly file and other resources.
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.
As the arg is of type `String` it is not gauranteed if a non number comes somehow.
See https://github.com/jenkinsci/jenkins/pull/10456/files#r2010184507
See jenkinsci#10456 (comment),
deleting the legacyIds file help reduce the number of inodes.
But when doing the downgrade not having the legacyIds file may impact significantly as mentioned in https://issues.jenkins.io/browse/JENKINS-64356

Currently upon upgrade first time start up will have mesages like,
```
2025-03-25 05:33:41.971+0000 [id=41]	INFO	h.p.b.g.GlobalTimeOutConfiguration#load: global timeout not set
2025-03-25 05:33:42.285+0000 [id=40]	INFO	jenkins.InitReactorRunner$1#onAttained: System config loaded
2025-03-25 05:33:42.285+0000 [id=40]	INFO	jenkins.InitReactorRunner$1#onAttained: System config adapted
2025-03-25 05:33:42.291+0000 [id=39]	INFO	hudson.model.Job#onLoad: Deleting legacyIds file in /.../jhome/jobs/fjob_2_502/builds. See https://issues.jenkins.io/browse/JENKINS-75465 for more information.
2025-03-25 05:33:42.291+0000 [id=44]	INFO	hudson.model.Job#onLoad: Deleting legacyIds file in /.../jhome/jobs/job_2_502/builds. See https://issues.jenkins.io/browse/JENKINS-75465 for more information.
2025-03-25 05:33:42.310+0000 [id=45]	INFO	jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2025-03-25 05:33:42.313+0000 [id=54]	INFO	jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
2025-03-25 05:33:42.324+0000 [id=33]	INFO	jenkins.InitReactorRunner$1#onAttained: Completed initialization
2025-03-25 05:33:42.342+0000 [id=26]	INFO	hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running
```
if (Files.deleteIfExists(buildDirPath.resolve("legacyIds"))) {
LOGGER.info("Deleting legacyIds file in " + buildDirPath + ". See https://issues.jenkins"
+ ".io/browse/JENKINS-75465 for more information.");
}
Copy link
Contributor Author

@gbhat618 gbhat618 Mar 25, 2025

Choose a reason for hiding this comment

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

(👋 @jglick)
Continuing from this comment - legacyIds deletion:

JENKINS-64356 discusses slow startup caused by a missing legacyIds file. This appears to happen because runIdMigrator.migrate(buildDir, Jenkins.get().getRootDir()) iterates through all builds to check for necessary migrations.

CloudBees provided a KB article with a workaround to recreate the legacyIds file when it's missing.

Since the legacyIds file is deleted here, downgrading to an earlier version could result in slow startup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wrote a note in changelog and upgrade guidelines to mention about downgrading.

@gbhat618
Copy link
Contributor Author

Looks like you missed some files ...
Also double-check...

Nice thanks for these commands, they will be helpful to me forever 😄 thank you. Currently all usages removed.

Noted down the past PRs (or commits) that introduced code around RunIdMigrator in the JIRA comment

gbhat618 added a commit to gbhat618/testcomplete-plugin that referenced this pull request Mar 25, 2025
<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
Copy link
Contributor Author

testcomplete-plugin

the behavior of this method is identical whether legacyIds exists and is empty or if it does not exist: it will return basePath (whatever that is)

right, I tried to check and clean it up, filed jenkinsci/testcomplete-plugin#21

@gbhat618
Copy link
Contributor Author

gbhat618 commented Mar 25, 2025

The changelog and upgrade guidelines seem too verbose. Should I shorten them, perhaps by removing details about requiring an intermediate update? Upgrading from such an old version to the latest may not even be possible due to significant changes over the years.

any suggestions about changelog and upgrade guidelines section?

@gbhat618
Copy link
Contributor Author

gbhat618 commented Mar 25, 2025

The two test failures are correct that they are using the builds with previous names. These are zip files, looking into it 👀

  • hudson.model.JobTest.getArtifactsUpTo

    getArtifactsUpTo.zip
     Archive:  getArtifactsUpTo.zip
       inflating: config.xml
        creating: jobs/
        creating: jobs/testJob/
        creating: jobs/testJob/builds/
        creating: jobs/testJob/builds/2010-04-28_08-26-00/
        creating: jobs/testJob/builds/2010-04-28_08-26-00/archive/
        creating: jobs/testJob/builds/2010-04-28_08-26-00/archive/foo/
        creating: jobs/testJob/builds/2010-04-28_08-26-00/archive/foo/bar/
      extracting: jobs/testJob/builds/2010-04-28_08-26-00/archive/foo/bar/two.txt
        creating: jobs/testJob/builds/2010-04-28_08-26-00/archive/sub/
        creating: jobs/testJob/builds/2010-04-28_08-26-00/archive/sub/dir/
      extracting: jobs/testJob/builds/2010-04-28_08-26-00/archive/sub/dir/one.txt
      extracting: jobs/testJob/builds/2010-04-28_08-26-00/archive/three.txt
       inflating: jobs/testJob/builds/2010-04-28_08-26-00/build.xml
      extracting: jobs/testJob/builds/2010-04-28_08-26-00/log
       inflating: jobs/testJob/config.xml
    
  • hudson.tasks.FingerprinterTest.actionSerialization

    actionSerialization.zip
     Archive:  actionSerialization.zip
        creating: jobs/
        creating: jobs/j/
        creating: jobs/j-windows/
        creating: jobs/j-windows/builds/
        creating: jobs/j-windows/builds/2013-06-05_14-30-12/
        creating: jobs/j-windows/builds/2013-06-05_14-30-12/archive/
      extracting: jobs/j-windows/builds/2013-06-05_14-30-12/archive/a
       inflating: jobs/j-windows/builds/2013-06-05_14-30-12/build.xml
      extracting: jobs/j-windows/builds/2013-06-05_14-30-12/changelog.xml
       inflating: jobs/j-windows/builds/2013-06-05_14-30-12/log
       inflating: jobs/j-windows/config.xml
      extracting: jobs/j-windows/nextBuildNumber
        creating: jobs/j/builds/
        creating: jobs/j/builds/2013-06-05_14-30-12/
        creating: jobs/j/builds/2013-06-05_14-30-12/archive/
      extracting: jobs/j/builds/2013-06-05_14-30-12/archive/a
       inflating: jobs/j/builds/2013-06-05_14-30-12/build.xml
      extracting: jobs/j/builds/2013-06-05_14-30-12/changelog.xml
       inflating: jobs/j/builds/2013-06-05_14-30-12/log
       inflating: jobs/j/config.xml
      extracting: jobs/j/nextBuildNumber
    

Will also look for all other zip files for similar 👀


Edit:
I have updated the mentioned 2 zip files above, and accordingly commented on them. Also looked at the entire repo, no more such old build directory names. ✅

Command

find . -type d -name "target" -prune -o -type f -path "*/resources/*.zip" -exec sh -c 'echo "Contents of: {}"; unzip -l "{}"; echo ""' \;
output
Contents of: ./test/src/test/resources/hudson/init/impl/GroovyInitScriptTest/errorsHandled.zip
Archive:  ./test/src/test/resources/hudson/init/impl/GroovyInitScriptTest/errorsHandled.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       58  05-13-2013 19:26   init.groovy
---------                     -------
       58                     1 file

Contents of: ./test/src/test/resources/hudson/tasks/maven-empty.zip
Archive:  ./test/src/test/resources/hudson/tasks/maven-empty.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      400  11-03-2009 06:36   pom.xml
---------                     -------
      400                     1 file

Contents of: ./test/src/test/resources/hudson/tasks/BatchFileTest/canLoadUnstableReturnFromDisk.zip
Archive:  ./test/src/test/resources/hudson/tasks/BatchFileTest/canLoadUnstableReturnFromDisk.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       91  01-11-2017 05:06   canLoadUnstableReturnFromDisk.zip
        0  01-11-2017 05:06   jobs/
        0  01-11-2017 05:06   jobs/batch/
      642  01-11-2017 05:05   jobs/batch/config.xml
---------                     -------
      733                     4 files

Contents of: ./test/src/test/resources/hudson/tasks/FingerprinterTest/actionSerialization.zip
Archive:  ./test/src/test/resources/hudson/tasks/FingerprinterTest/actionSerialization.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  03-25-2025 15:49   jobs/
        0  02-11-2017 21:51   jobs/j-windows/
        2  06-05-2013 11:30   jobs/j-windows/nextBuildNumber
        0  03-25-2025 15:48   jobs/j-windows/builds/
        0  03-25-2025 15:48   jobs/j-windows/builds/2/
        0  02-11-2017 21:51   jobs/j-windows/builds/2/archive/
       20  02-11-2017 22:01   jobs/j-windows/builds/2/archive/a
     1015  03-25-2025 15:48   jobs/j-windows/builds/2/build.xml
      448  06-05-2013 11:30   jobs/j-windows/builds/2/log
        6  06-05-2013 11:30   jobs/j-windows/builds/2/changelog.xml
     1002  02-11-2017 21:51   jobs/j-windows/config.xml
        0  02-11-2017 21:50   jobs/j/
        2  06-05-2013 11:30   jobs/j/nextBuildNumber
        0  03-25-2025 15:46   jobs/j/builds/
        0  03-25-2025 15:46   jobs/j/builds/2/
        0  06-05-2013 11:30   jobs/j/builds/2/archive/
       12  06-05-2013 11:30   jobs/j/builds/2/archive/a
     1015  03-25-2025 15:46   jobs/j/builds/2/build.xml
      448  06-05-2013 11:30   jobs/j/builds/2/log
        6  06-05-2013 11:30   jobs/j/builds/2/changelog.xml
      993  06-05-2013 11:30   jobs/j/config.xml
---------                     -------
     4969                     21 files

Contents of: ./test/src/test/resources/hudson/tasks/ShellTest/canLoadUnstableReturnFromDisk.zip
Archive:  ./test/src/test/resources/hudson/tasks/ShellTest/canLoadUnstableReturnFromDisk.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       91  01-11-2017 05:20   canLoadUnstableReturnFromDisk.zip
        0  01-11-2017 04:45   jobs/
        0  01-11-2017 04:30   jobs/test/
      697  01-11-2017 04:30   jobs/test/config.xml
---------                     -------
      788                     4 files

Contents of: ./test/src/test/resources/hudson/tasks/ArtifactArchiverTest/latestOnlyMigration.zip
Archive:  ./test/src/test/resources/hudson/tasks/ArtifactArchiverTest/latestOnlyMigration.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      815  07-21-2014 14:45   jobs/sample/config.xml
---------                     -------
      815                     1 file

Contents of: ./test/src/test/resources/hudson/tasks/ArtifactArchiverTest/followSymlinksEnabledForOldConfig.zip
Archive:  ./test/src/test/resources/hudson/tasks/ArtifactArchiverTest/followSymlinksEnabledForOldConfig.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  03-02-2020 19:07   jobs/
        0  03-01-2020 16:55   jobs/sample/
     1356  03-02-2020 19:23   jobs/sample/config.xml
        0  03-02-2020 19:07   jobs/sample-windows/
     1361  03-02-2020 19:22   jobs/sample-windows/config.xml
---------                     -------
     2717                     5 files

Contents of: ./test/src/test/resources/hudson/tasks/ArtifactArchiverTest/fingerprintMigration.zip
Archive:  ./test/src/test/resources/hudson/tasks/ArtifactArchiverTest/fingerprintMigration.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  02-11-2017 12:45   jobs/
        0  02-11-2017 12:45   jobs/sample/
        0  02-11-2017 12:45   jobs/sample-windows/
     1052  02-11-2017 12:46   jobs/sample-windows/config.xml
     1043  07-21-2014 16:09   jobs/sample/config.xml
---------                     -------
     2095                     5 files

Contents of: ./test/src/test/resources/hudson/util/RobustReflectionConverterTest/randomExceptionsReported.zip
Archive:  ./test/src/test/resources/hudson/util/RobustReflectionConverterTest/randomExceptionsReported.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      177  12-16-2013 23:49   jobs/j/config.xml
---------                     -------
      177                     1 file

Contents of: ./test/src/test/resources/hudson/ClassicPluginStrategyTest/testMaskResourceClassLoader.zip
Archive:  ./test/src/test/resources/hudson/ClassicPluginStrategyTest/testMaskResourceClassLoader.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      528  07-14-2010 01:51   config.xml
        0  03-08-2015 17:48   plugins/
   206287  03-09-2015 10:21   plugins/foo1.hpi
   292764  03-09-2015 01:03   plugins/foo2.hpi
---------                     -------
   499579                     4 files

Contents of: ./test/src/test/resources/hudson/ClassicPluginStrategyTest/testDisabledDependencyClassLoader.zip
Archive:  ./test/src/test/resources/hudson/ClassicPluginStrategyTest/testDisabledDependencyClassLoader.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  03-05-2021 12:24   plugins/
     2136  03-05-2021 12:23   plugins/foo4.hpi
      528  07-13-2010 08:51   config.xml
---------                     -------
     2664                     3 files

Contents of: ./test/src/test/resources/hudson/ClassicPluginStrategyTest/testDependencyClassLoader.zip
Archive:  ./test/src/test/resources/hudson/ClassicPluginStrategyTest/testDependencyClassLoader.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      528  07-14-2010 05:21   config.xml
        0  10-05-2013 03:43   plugins/
     2578  10-05-2013 03:41   plugins/foo1.hpi
     2656  10-05-2013 03:43   plugins/foo3.hpi
     2641  10-05-2013 03:42   plugins/foo2.hpi
---------                     -------
     8403                     5 files

Contents of: ./test/src/test/resources/hudson/model/QueueTest/recover_from_legacy_list.zip
Archive:  ./test/src/test/resources/hudson/model/QueueTest/recover_from_legacy_list.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
     1526  02-09-2015 02:53   config.xml
      152  02-09-2015 02:53   hudson.model.UpdateCenter.xml
     1680  02-09-2015 02:53   identity.key.enc
      188  02-09-2015 02:53   jenkins.model.JenkinsLocationConfiguration.xml
        0  02-09-2015 02:53   jobs/
        0  02-09-2015 02:53   jobs/test/
        0  02-09-2015 02:53   jobs/test/builds/
        0  02-09-2015 02:53   jobs/test/builds/legacyIds
      468  02-09-2015 02:53   jobs/test/config.xml
      907  02-09-2015 02:53   nodeMonitors.xml
      611  02-09-2015 17:14   queue.xml
       64  02-09-2015 02:53   secret.key
        0  02-09-2015 02:53   secret.key.not-so-secret
        0  02-09-2015 02:53   secrets/
        0  02-09-2015 02:53   secrets/filepath-filters.d/
     2182  02-09-2015 02:53   secrets/filepath-filters.d/30-default.conf
      272  02-09-2015 02:53   secrets/hudson.util.Secret
       48  02-09-2015 02:53   secrets/jenkins.security.ApiTokenProperty.seed
      256  02-09-2015 02:53   secrets/master.key
      272  02-09-2015 02:53   secrets/org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
        0  02-09-2015 02:53   secrets/whitelisted-callables.d/
      953  02-09-2015 02:53   secrets/whitelisted-callables.d/default.conf
        0  02-09-2015 02:53   userContent/
       84  02-09-2015 02:53   userContent/readme.txt
---------                     -------
     9663                     24 files

Contents of: ./test/src/test/resources/hudson/model/ParametersAction2Test/backwardCompatibility.zip
Archive:  ./test/src/test/resources/hudson/model/ParametersAction2Test/backwardCompatibility.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  02-10-2017 20:14   jobs/
        0  04-27-2016 11:28   jobs/parameterized/
        0  02-10-2017 20:14   jobs/parameterized-windows/
        0  02-10-2017 20:14   jobs/parameterized-windows/builds/
        0  02-10-2017 20:14   jobs/parameterized-windows/builds/1/
     1350  02-10-2017 21:23   jobs/parameterized-windows/builds/1/build.xml
        6  04-27-2016 11:28   jobs/parameterized-windows/builds/1/changelog.xml
      465  04-27-2016 11:28   jobs/parameterized-windows/builds/1/log
     1214  02-10-2017 20:15   jobs/parameterized-windows/config.xml
        0  02-10-2017 20:14   jobs/parameterized-windows/lastStable/
     1154  04-27-2016 11:28   jobs/parameterized-windows/lastStable/build.xml
        6  04-27-2016 11:28   jobs/parameterized-windows/lastStable/changelog.xml
      465  04-27-2016 11:28   jobs/parameterized-windows/lastStable/log
        0  02-10-2017 20:14   jobs/parameterized-windows/lastSuccessful/
     1154  04-27-2016 11:28   jobs/parameterized-windows/lastSuccessful/build.xml
        6  04-27-2016 11:28   jobs/parameterized-windows/lastSuccessful/changelog.xml
      465  04-27-2016 11:28   jobs/parameterized-windows/lastSuccessful/log
        2  04-27-2016 11:28   jobs/parameterized-windows/nextBuildNumber
        0  04-27-2016 12:02   jobs/parameterized/builds/
        0  04-27-2016 11:58   jobs/parameterized/builds/1/
     1342  04-27-2016 11:58   jobs/parameterized/builds/1/build.xml
        6  04-27-2016 11:28   jobs/parameterized/builds/1/changelog.xml
      465  04-27-2016 11:28   jobs/parameterized/builds/1/log
     1204  04-27-2016 11:28   jobs/parameterized/config.xml
        0  04-27-2016 11:28   jobs/parameterized/lastStable/
     1154  04-27-2016 11:28   jobs/parameterized/lastStable/build.xml
        6  04-27-2016 11:28   jobs/parameterized/lastStable/changelog.xml
      465  04-27-2016 11:28   jobs/parameterized/lastStable/log
        0  04-27-2016 11:28   jobs/parameterized/lastSuccessful/
     1154  04-27-2016 11:28   jobs/parameterized/lastSuccessful/build.xml
        6  04-27-2016 11:28   jobs/parameterized/lastSuccessful/changelog.xml
      465  04-27-2016 11:28   jobs/parameterized/lastSuccessful/log
        2  04-27-2016 11:28   jobs/parameterized/nextBuildNumber
        0  02-10-2017 21:22   workspace/
        0  04-27-2016 11:28   workspace/parameterized/
        0  04-27-2016 11:28   workspace/parameterized-windows/
---------                     -------
    12556                     36 files

Contents of: ./test/src/test/resources/hudson/model/ItemGroupMixInTest/xmlFileReadExceptionOnLoad.zip
Archive:  ./test/src/test/resources/hudson/model/ItemGroupMixInTest/xmlFileReadExceptionOnLoad.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  01-07-2015 13:32   jobs/
        0  01-07-2015 13:32   jobs/d/
       36  12-10-2013 15:27   jobs/d/config.xml
        0  01-07-2015 14:24   jobs/d/jobs/
        0  01-07-2015 13:59   jobs/d/jobs/badBuildStep/
      544  01-07-2015 13:59   jobs/d/jobs/badBuildStep/config.xml
        0  01-07-2015 14:27   jobs/d/jobs/badBuildTrigger/
      549  01-07-2015 14:27   jobs/d/jobs/badBuildTrigger/config.xml
        0  01-07-2015 13:35   jobs/d/jobs/badBuildWrapper/
      510  01-07-2015 13:35   jobs/d/jobs/badBuildWrapper/config.xml
        0  01-07-2015 14:20   jobs/d/jobs/badPublisher/
      637  01-07-2015 14:20   jobs/d/jobs/badPublisher/config.xml
        0  01-07-2015 13:32   jobs/d/jobs/valid/
       11  12-10-2013 15:27   jobs/d/jobs/valid/config.xml
---------                     -------
     2287                     14 files

Contents of: ./test/src/test/resources/hudson/model/ItemGroupMixInTest/xmlFileReadCannotResolveClassException.zip
Archive:  ./test/src/test/resources/hudson/model/ItemGroupMixInTest/xmlFileReadCannotResolveClassException.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  12-11-2013 04:57   jobs/
        0  12-11-2013 04:57   jobs/d/
       36  12-11-2013 04:57   jobs/d/config.xml
        0  12-11-2013 04:57   jobs/d/jobs/
        0  12-11-2013 04:57   jobs/d/jobs/valid/
       11  12-11-2013 04:57   jobs/d/jobs/valid/config.xml
        0  12-11-2013 04:58   jobs/d/jobs/invalid/
       23  12-11-2013 04:58   jobs/d/jobs/invalid/config.xml
---------                     -------
       70                     8 files

Contents of: ./test/src/test/resources/hudson/model/DependencyGraphTest/testItemReadPermission.zip
Archive:  ./test/src/test/resources/hudson/model/DependencyGraphTest/testItemReadPermission.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      597  01-14-2010 00:54   config.xml
        0  01-14-2010 00:57   jobs/
        0  01-14-2010 00:59   jobs/hiddenDownstream/
      539  01-14-2010 00:59   jobs/hiddenDownstream/config.xml
        0  01-14-2010 00:59   jobs/hiddenUpstream/
      796  01-14-2010 00:59   jobs/hiddenUpstream/config.xml
        0  01-14-2010 01:00   jobs/testJob/
      612  01-14-2010 01:00   jobs/testJob/config.xml
---------                     -------
     2544                     8 files

Contents of: ./test/src/test/resources/hudson/model/update-center.json.zip
Archive:  ./test/src/test/resources/hudson/model/update-center.json.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
   735861  11-16-2022 22:15   update-center.json
---------                     -------
   735861                     1 file

Contents of: ./test/src/test/resources/hudson/model/JobTest/getArtifactsUpTo.zip
Archive:  ./test/src/test/resources/hudson/model/JobTest/getArtifactsUpTo.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      528  11-11-2009 07:05   config.xml
        0  11-10-2009 06:38   jobs/
        0  04-28-2010 20:55   jobs/testJob/
        0  03-25-2025 15:56   jobs/testJob/builds/
        0  03-25-2025 15:56   jobs/testJob/builds/1/
        0  04-28-2010 20:59   jobs/testJob/builds/1/archive/
        0  04-28-2010 20:59   jobs/testJob/builds/1/archive/three.txt
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/sub/
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/sub/dir/
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/sub/dir/one.txt
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/foo/
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/foo/bar/
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/foo/bar/two.txt
      273  03-25-2025 15:56   jobs/testJob/builds/1/build.xml
        0  04-28-2010 20:57   jobs/testJob/builds/1/log
      311  04-28-2010 20:55   jobs/testJob/config.xml
---------                     -------
     1112                     16 files

Contents of: ./test/src/test/resources/hudson/model/JobTest/configDotXmlPermission.zip
Archive:  ./test/src/test/resources/hudson/model/JobTest/configDotXmlPermission.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      528  11-11-2009 07:05   config.xml
        0  11-10-2009 06:38   jobs/
        0  11-11-2009 07:11   jobs/testJob/
      745  11-11-2009 07:11   jobs/testJob/config.xml
        0  11-11-2009 07:58   userContent/
      176  11-11-2009 07:30   userContent/post.html
---------                     -------
     1449                     6 files

Contents of: ./test/src/test/resources/hudson/model/ViewTest/testAllViewNotCreatedIfPrimary.zip
Archive:  ./test/src/test/resources/hudson/model/ViewTest/testAllViewNotCreatedIfPrimary.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      391  07-27-2016 13:55   config.xml
---------                     -------
      391                     1 file

Contents of: ./test/src/test/resources/hudson/model/ViewTest/testAllViewCreatedIfNoPrimary.zip
Archive:  ./test/src/test/resources/hudson/model/ViewTest/testAllViewCreatedIfNoPrimary.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      354  07-27-2016 13:00   config.xml
---------                     -------
      354                     1 file

Contents of: ./test/src/test/resources/hudson/FilePathTest/ZipSlipSamePathPrefix/evil.zip
Archive:  ./test/src/test/resources/hudson/FilePathTest/ZipSlipSamePathPrefix/evil.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  07-08-2021 16:48   good.txt
        0  07-08-2021 16:48   ../foo_evil.txt
---------                     -------
        0                     2 files

Contents of: ./test/src/test/resources/hudson/FilePathTest/ZipSlipSamePathPrefix/evil-win.zip
Archive:  ./test/src/test/resources/hudson/FilePathTest/ZipSlipSamePathPrefix/evil-win.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  07-08-2021 16:48   good.txt
        0  07-08-2021 16:48   ..\foo_evil.txt
---------                     -------
        0                     2 files

Contents of: ./test/src/test/resources/hudson/FilePathTest/zip_with_relative/zip-slip.zip
Archive:  ./test/src/test/resources/hudson/FilePathTest/zip_with_relative/zip-slip.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       19  04-16-2018 00:34   good.txt
       20  04-15-2018 22:04   ../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../tmp/evil.txt
---------                     -------
       39                     2 files

Contents of: ./test/src/test/resources/hudson/FilePathTest/zip_with_relative/zip-slip-win.zip
Archive:  ./test/src/test/resources/hudson/FilePathTest/zip_with_relative/zip-slip-win.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       19  04-16-2018 00:34   good.txt
       20  04-15-2018 22:04   ..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\Temp\evil.txt
---------                     -------
       39                     2 files

Contents of: ./test/src/test/resources/hudson/FilePathTest/zip_with_relative/zip-with-folder.zip
Archive:  ./test/src/test/resources/hudson/FilePathTest/zip_with_relative/zip-with-folder.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  04-08-2019 09:35   child/
        8  04-08-2019 09:35   child/simple2.txt
        8  04-08-2019 09:35   simple1.txt
---------                     -------
       16                     3 files

Contents of: ./test/src/test/resources/hudson/FilePathTest/zip_with_relative/zip-rel-one-up.zip
Archive:  ./test/src/test/resources/hudson/FilePathTest/zip_with_relative/zip-rel-one-up.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        8  04-08-2019 13:45   ../simple3.txt
        8  04-08-2019 13:44   simple1.txt
        8  04-08-2019 13:45   child/simple2.txt
---------                     -------
       24                     3 files

Contents of: ./test/src/test/resources/hudson/diagnosis/OldDataMonitorTest/robustness.zip
Archive:  ./test/src/test/resources/hudson/diagnosis/OldDataMonitorTest/robustness.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  03-21-2014 17:45   jobs/
        0  03-21-2014 18:01   jobs/busted/
      125  03-21-2014 18:01   jobs/busted/config.xml
---------                     -------
      125                     3 files

Contents of: ./test/src/test/resources/simple-projects.zip
Archive:  ./test/src/test/resources/simple-projects.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      488  01-14-2016 03:07   build.xml
      479  01-14-2016 03:07   pom.xml
---------                     -------
      967                     2 files

Contents of: ./test/src/test/resources/jenkins/install/LoadDetachedPluginsTest/installDetachedDependencies/example.zip
Archive:  ./test/src/test/resources/jenkins/install/LoadDetachedPluginsTest/installDetachedDependencies/example.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  04-20-2019 00:56   example/
     1120  04-19-2019 22:59   example/pom.xml
        0  04-20-2019 00:55   example/src/
        0  04-19-2019 22:57   example/src/main/
        0  04-19-2019 22:56   example/src/main/java/
        0  04-19-2019 22:56   example/src/main/java/io/
        0  04-19-2019 22:56   example/src/main/java/io/jenkins/
        0  04-19-2019 22:58   example/src/main/java/io/jenkins/plugins/
        0  04-19-2019 22:58   example/src/main/java/io/jenkins/plugins/example/
      214  04-19-2019 23:00   example/src/main/java/io/jenkins/plugins/example/Caller.java
---------                     -------
     1334                     10 files

Contents of: ./test/src/test/resources/jenkins/security/ApiTokenPropertyTest/migrationFromLegacyToken.zip
Archive:  ./test/src/test/resources/jenkins/security/ApiTokenPropertyTest/migrationFromLegacyToken.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      879  03-21-2018 15:45   config.xml
        0  03-20-2018 14:35   users/
        0  03-21-2018 11:57   users/admin/
     1658  03-21-2018 15:31   users/admin/config.xml
---------                     -------
     2537                     4 files

Contents of: ./test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/buildDiscarderField.zip
Archive:  ./test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/buildDiscarderField.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      728  11-14-2015 03:50   jobs/p/config.xml
---------                     -------
      728                     1 file

…mat build dirs

Two archives
---------------
1. actionSerialization.zip

Before
```
→ unzip -l actionSerialization.zip
Archive:  actionSerialization.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  02-11-2017 21:51   jobs/
        0  02-11-2017 21:50   jobs/j/
        0  02-11-2017 21:51   jobs/j-windows/
        0  02-11-2017 21:51   jobs/j-windows/builds/
        0  02-11-2017 21:51   jobs/j-windows/builds/2013-06-05_14-30-12/
        0  02-11-2017 21:51   jobs/j-windows/builds/2013-06-05_14-30-12/archive/
       20  02-11-2017 22:01   jobs/j-windows/builds/2013-06-05_14-30-12/archive/a
      996  02-11-2017 22:05   jobs/j-windows/builds/2013-06-05_14-30-12/build.xml
        6  06-05-2013 11:30   jobs/j-windows/builds/2013-06-05_14-30-12/changelog.xml
      448  06-05-2013 11:30   jobs/j-windows/builds/2013-06-05_14-30-12/log
     1002  02-11-2017 21:51   jobs/j-windows/config.xml
        2  06-05-2013 11:30   jobs/j-windows/nextBuildNumber
        0  02-11-2017 21:50   jobs/j/builds/
        0  06-05-2013 11:30   jobs/j/builds/2013-06-05_14-30-12/
        0  06-05-2013 11:30   jobs/j/builds/2013-06-05_14-30-12/archive/
       12  06-05-2013 11:30   jobs/j/builds/2013-06-05_14-30-12/archive/a
      996  06-05-2013 11:30   jobs/j/builds/2013-06-05_14-30-12/build.xml
        6  06-05-2013 11:30   jobs/j/builds/2013-06-05_14-30-12/changelog.xml
      448  06-05-2013 11:30   jobs/j/builds/2013-06-05_14-30-12/log
      993  06-05-2013 11:30   jobs/j/config.xml
        2  06-05-2013 11:30   jobs/j/nextBuildNumber
---------                     -------
     4931                     21 files
```

After
```
Archive:  actionSerialization.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  03-25-2025 15:49   jobs/
        0  02-11-2017 21:51   jobs/j-windows/
        2  06-05-2013 11:30   jobs/j-windows/nextBuildNumber
        0  03-25-2025 15:48   jobs/j-windows/builds/
        0  03-25-2025 15:48   jobs/j-windows/builds/2/
        0  02-11-2017 21:51   jobs/j-windows/builds/2/archive/
       20  02-11-2017 22:01   jobs/j-windows/builds/2/archive/a
     1015  03-25-2025 15:48   jobs/j-windows/builds/2/build.xml
      448  06-05-2013 11:30   jobs/j-windows/builds/2/log
        6  06-05-2013 11:30   jobs/j-windows/builds/2/changelog.xml
     1002  02-11-2017 21:51   jobs/j-windows/config.xml
        0  02-11-2017 21:50   jobs/j/
        2  06-05-2013 11:30   jobs/j/nextBuildNumber
        0  03-25-2025 15:46   jobs/j/builds/
        0  03-25-2025 15:46   jobs/j/builds/2/
        0  06-05-2013 11:30   jobs/j/builds/2/archive/
       12  06-05-2013 11:30   jobs/j/builds/2/archive/a
     1015  03-25-2025 15:46   jobs/j/builds/2/build.xml
      448  06-05-2013 11:30   jobs/j/builds/2/log
        6  06-05-2013 11:30   jobs/j/builds/2/changelog.xml
      993  06-05-2013 11:30   jobs/j/config.xml
---------                     -------
     4969                     21 files
```

2. getArtifactsUpTo.zip

Before
```
Archive:  getArtifactsUpTo.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      528  11-11-2009 07:05   config.xml
        0  11-10-2009 06:38   jobs/
        0  04-28-2010 20:55   jobs/testJob/
        0  04-28-2010 20:56   jobs/testJob/builds/
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/
        0  04-28-2010 20:59   jobs/testJob/builds/2010-04-28_08-26-00/archive/
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/archive/foo/
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/archive/foo/bar/
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/archive/foo/bar/two.txt
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/archive/sub/
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/archive/sub/dir/
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/archive/sub/dir/one.txt
        0  04-28-2010 20:59   jobs/testJob/builds/2010-04-28_08-26-00/archive/three.txt
      255  04-28-2010 20:57   jobs/testJob/builds/2010-04-28_08-26-00/build.xml
        0  04-28-2010 20:57   jobs/testJob/builds/2010-04-28_08-26-00/log
      311  04-28-2010 20:55   jobs/testJob/config.xml
---------                     -------
     1094                     16 files
```

After
```
Archive:  getArtifactsUpTo.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      528  11-11-2009 07:05   config.xml
        0  11-10-2009 06:38   jobs/
        0  04-28-2010 20:55   jobs/testJob/
        0  03-25-2025 15:56   jobs/testJob/builds/
        0  03-25-2025 15:56   jobs/testJob/builds/1/
        0  04-28-2010 20:59   jobs/testJob/builds/1/archive/
        0  04-28-2010 20:59   jobs/testJob/builds/1/archive/three.txt
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/sub/
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/sub/dir/
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/sub/dir/one.txt
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/foo/
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/foo/bar/
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/foo/bar/two.txt
      273  03-25-2025 15:56   jobs/testJob/builds/1/build.xml
        0  04-28-2010 20:57   jobs/testJob/builds/1/log
      311  04-28-2010 20:55   jobs/testJob/config.xml
---------                     -------
     1112                     16 files
```

Git Diffs
----------
1. actionSerialization.zip
```
diff --git a/j-windows/builds/2013-06-05_14-30-12/archive/a b/j-windows/builds/2/archive/a
similarity index 100%
rename from j-windows/builds/2013-06-05_14-30-12/archive/a
rename to j-windows/builds/2/archive/a
diff --git a/j-windows/builds/2013-06-05_14-30-12/build.xml b/j-windows/builds/2/build.xml
similarity index 95%
rename from j-windows/builds/2013-06-05_14-30-12/build.xml
rename to j-windows/builds/2/build.xml
index 0ecfb2f..fc4d2fc 100644
--- a/j-windows/builds/2013-06-05_14-30-12/build.xml
+++ b/j-windows/builds/2/build.xml
@@ -16,7 +16,7 @@
       </record>
     </hudson.tasks.Fingerprinter_-FingerprintAction>
   </actions>
-  <number>2</number>
+  <timestamp>1370422812000</timestamp>
   <startTime>1370457012935</startTime>
   <result>SUCCESS</result>
   <duration>178</duration>
@@ -27,4 +27,4 @@
   <hudsonVersion>1.519-SNAPSHOT (private-06/05/2013 00:16 GMT-jglick)</hudsonVersion>
   <scm class="hudson.scm.NullChangeLogParser"/>
   <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
-</build>
\ No newline at end of file
+</build>
diff --git a/j-windows/builds/2013-06-05_14-30-12/changelog.xml b/j-windows/builds/2/changelog.xml
similarity index 100%
rename from j-windows/builds/2013-06-05_14-30-12/changelog.xml
rename to j-windows/builds/2/changelog.xml
diff --git a/j-windows/builds/2013-06-05_14-30-12/log b/j-windows/builds/2/log
similarity index 100%
rename from j-windows/builds/2013-06-05_14-30-12/log
rename to j-windows/builds/2/log
diff --git a/j/builds/2013-06-05_14-30-12/archive/a b/j/builds/2/archive/a
similarity index 100%
rename from j/builds/2013-06-05_14-30-12/archive/a
rename to j/builds/2/archive/a
diff --git a/j/builds/2013-06-05_14-30-12/build.xml b/j/builds/2/build.xml
similarity index 95%
rename from j/builds/2013-06-05_14-30-12/build.xml
rename to j/builds/2/build.xml
index 0a4480b..96bc7f2 100644
--- a/j/builds/2013-06-05_14-30-12/build.xml
+++ b/j/builds/2/build.xml
@@ -16,7 +16,7 @@
       </record>
     </hudson.tasks.Fingerprinter_-FingerprintAction>
   </actions>
-  <number>2</number>
+  <timestamp>1370422812000</timestamp>
   <startTime>1370457012935</startTime>
   <result>SUCCESS</result>
   <duration>178</duration>
@@ -27,4 +27,4 @@
   <hudsonVersion>1.519-SNAPSHOT (private-06/05/2013 00:16 GMT-jglick)</hudsonVersion>
   <scm class="hudson.scm.NullChangeLogParser"/>
   <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
-</build>
\ No newline at end of file
+</build>
diff --git a/j/builds/2013-06-05_14-30-12/changelog.xml b/j/builds/2/changelog.xml
similarity index 100%
rename from j/builds/2013-06-05_14-30-12/changelog.xml
rename to j/builds/2/changelog.xml
diff --git a/j/builds/2013-06-05_14-30-12/log b/j/builds/2/log
similarity index 100%
rename from j/builds/2013-06-05_14-30-12/log
rename to j/builds/2/log
```

2. getArtifactsUpTo.zip
```
diff --git a/builds/2010-04-28_08-26-00/archive/foo/bar/two.txt b/builds/1/archive/foo/bar/two.txt
similarity index 100%
rename from builds/2010-04-28_08-26-00/archive/foo/bar/two.txt
rename to builds/1/archive/foo/bar/two.txt
diff --git a/builds/2010-04-28_08-26-00/archive/sub/dir/one.txt b/builds/1/archive/sub/dir/one.txt
similarity index 100%
rename from builds/2010-04-28_08-26-00/archive/sub/dir/one.txt
rename to builds/1/archive/sub/dir/one.txt
diff --git a/builds/2010-04-28_08-26-00/archive/three.txt b/builds/1/archive/three.txt
similarity index 100%
rename from builds/2010-04-28_08-26-00/archive/three.txt
rename to builds/1/archive/three.txt
diff --git a/builds/2010-04-28_08-26-00/build.xml b/builds/1/build.xml
similarity index 85%
rename from builds/2010-04-28_08-26-00/build.xml
rename to builds/1/build.xml
index 8764092..c65adfe 100644
--- a/builds/2010-04-28_08-26-00/build.xml
+++ b/builds/1/build.xml
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <build>
   <actions/>
-  <number>1</number>
+  <timestamp>1272423360000</timestamp>
   <result>SUCCESS</result>
   <duration>100</duration>
   <keepLog>false</keepLog>
diff --git a/builds/2010-04-28_08-26-00/log b/builds/1/log
similarity index 100%
rename from builds/2010-04-28_08-26-00/log
rename to builds/1/log
```
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change

  • rename the build directory from timestamp to build number
  • update the build.xml: removed <number> field, added <timestamp> field.
unzip -l actionSerialization.zip

Before

→ unzip -l actionSerialization.zip
Archive:  actionSerialization.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  02-11-2017 21:51   jobs/
        0  02-11-2017 21:50   jobs/j/
        0  02-11-2017 21:51   jobs/j-windows/
        0  02-11-2017 21:51   jobs/j-windows/builds/
        0  02-11-2017 21:51   jobs/j-windows/builds/2013-06-05_14-30-12/
        0  02-11-2017 21:51   jobs/j-windows/builds/2013-06-05_14-30-12/archive/
       20  02-11-2017 22:01   jobs/j-windows/builds/2013-06-05_14-30-12/archive/a
      996  02-11-2017 22:05   jobs/j-windows/builds/2013-06-05_14-30-12/build.xml
        6  06-05-2013 11:30   jobs/j-windows/builds/2013-06-05_14-30-12/changelog.xml
      448  06-05-2013 11:30   jobs/j-windows/builds/2013-06-05_14-30-12/log
     1002  02-11-2017 21:51   jobs/j-windows/config.xml
        2  06-05-2013 11:30   jobs/j-windows/nextBuildNumber
        0  02-11-2017 21:50   jobs/j/builds/
        0  06-05-2013 11:30   jobs/j/builds/2013-06-05_14-30-12/
        0  06-05-2013 11:30   jobs/j/builds/2013-06-05_14-30-12/archive/
       12  06-05-2013 11:30   jobs/j/builds/2013-06-05_14-30-12/archive/a
      996  06-05-2013 11:30   jobs/j/builds/2013-06-05_14-30-12/build.xml
        6  06-05-2013 11:30   jobs/j/builds/2013-06-05_14-30-12/changelog.xml
      448  06-05-2013 11:30   jobs/j/builds/2013-06-05_14-30-12/log
      993  06-05-2013 11:30   jobs/j/config.xml
        2  06-05-2013 11:30   jobs/j/nextBuildNumber
---------                     -------
     4931                     21 files

After

Archive:  actionSerialization.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  03-25-2025 15:49   jobs/
        0  02-11-2017 21:51   jobs/j-windows/
        2  06-05-2013 11:30   jobs/j-windows/nextBuildNumber
        0  03-25-2025 15:48   jobs/j-windows/builds/
        0  03-25-2025 15:48   jobs/j-windows/builds/2/
        0  02-11-2017 21:51   jobs/j-windows/builds/2/archive/
       20  02-11-2017 22:01   jobs/j-windows/builds/2/archive/a
     1015  03-25-2025 15:48   jobs/j-windows/builds/2/build.xml
      448  06-05-2013 11:30   jobs/j-windows/builds/2/log
        6  06-05-2013 11:30   jobs/j-windows/builds/2/changelog.xml
     1002  02-11-2017 21:51   jobs/j-windows/config.xml
        0  02-11-2017 21:50   jobs/j/
        2  06-05-2013 11:30   jobs/j/nextBuildNumber
        0  03-25-2025 15:46   jobs/j/builds/
        0  03-25-2025 15:46   jobs/j/builds/2/
        0  06-05-2013 11:30   jobs/j/builds/2/archive/
       12  06-05-2013 11:30   jobs/j/builds/2/archive/a
     1015  03-25-2025 15:46   jobs/j/builds/2/build.xml
      448  06-05-2013 11:30   jobs/j/builds/2/log
        6  06-05-2013 11:30   jobs/j/builds/2/changelog.xml
      993  06-05-2013 11:30   jobs/j/config.xml
---------                     -------
     4969                     21 files
git-diff of the change
diff --git a/j-windows/builds/2013-06-05_14-30-12/archive/a b/j-windows/builds/2/archive/a
similarity index 100%
rename from j-windows/builds/2013-06-05_14-30-12/archive/a
rename to j-windows/builds/2/archive/a
diff --git a/j-windows/builds/2013-06-05_14-30-12/build.xml b/j-windows/builds/2/build.xml
similarity index 95%
rename from j-windows/builds/2013-06-05_14-30-12/build.xml
rename to j-windows/builds/2/build.xml
index 0ecfb2f..fc4d2fc 100644
--- a/j-windows/builds/2013-06-05_14-30-12/build.xml
+++ b/j-windows/builds/2/build.xml
@@ -16,7 +16,7 @@
       </record>
     </hudson.tasks.Fingerprinter_-FingerprintAction>
   </actions>
-  <number>2</number>
+  <timestamp>1370422812000</timestamp>
   <startTime>1370457012935</startTime>
   <result>SUCCESS</result>
   <duration>178</duration>
@@ -27,4 +27,4 @@
   <hudsonVersion>1.519-SNAPSHOT (private-06/05/2013 00:16 GMT-jglick)</hudsonVersion>
   <scm class="hudson.scm.NullChangeLogParser"/>
   <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
-</build>
\ No newline at end of file
+</build>
diff --git a/j-windows/builds/2013-06-05_14-30-12/changelog.xml b/j-windows/builds/2/changelog.xml
similarity index 100%
rename from j-windows/builds/2013-06-05_14-30-12/changelog.xml
rename to j-windows/builds/2/changelog.xml
diff --git a/j-windows/builds/2013-06-05_14-30-12/log b/j-windows/builds/2/log
similarity index 100%
rename from j-windows/builds/2013-06-05_14-30-12/log
rename to j-windows/builds/2/log
diff --git a/j/builds/2013-06-05_14-30-12/archive/a b/j/builds/2/archive/a
similarity index 100%
rename from j/builds/2013-06-05_14-30-12/archive/a
rename to j/builds/2/archive/a
diff --git a/j/builds/2013-06-05_14-30-12/build.xml b/j/builds/2/build.xml
similarity index 95%
rename from j/builds/2013-06-05_14-30-12/build.xml
rename to j/builds/2/build.xml
index 0a4480b..96bc7f2 100644
--- a/j/builds/2013-06-05_14-30-12/build.xml
+++ b/j/builds/2/build.xml
@@ -16,7 +16,7 @@
       </record>
     </hudson.tasks.Fingerprinter_-FingerprintAction>
   </actions>
-  <number>2</number>
+  <timestamp>1370422812000</timestamp>
   <startTime>1370457012935</startTime>
   <result>SUCCESS</result>
   <duration>178</duration>
@@ -27,4 +27,4 @@
   <hudsonVersion>1.519-SNAPSHOT (private-06/05/2013 00:16 GMT-jglick)</hudsonVersion>
   <scm class="hudson.scm.NullChangeLogParser"/>
   <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
-</build>
\ No newline at end of file
+</build>
diff --git a/j/builds/2013-06-05_14-30-12/changelog.xml b/j/builds/2/changelog.xml
similarity index 100%
rename from j/builds/2013-06-05_14-30-12/changelog.xml
rename to j/builds/2/changelog.xml
diff --git a/j/builds/2013-06-05_14-30-12/log b/j/builds/2/log
similarity index 100%
rename from j/builds/2013-06-05_14-30-12/log
rename to j/builds/2/log

Copy link
Member

@jglick jglick Mar 25, 2025

Choose a reason for hiding this comment

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

BTW @LocalData supports unpacked directories, which is easier to review changes to going forward.

For that matter, perhaps we should drop support for ZIPped directories, since they are inherently unreviewable. (tukaani-project/xz@e93e13c)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change

  • rename the build directory from timestamp to build number
  • update the build.xml: removed field, added field.
unzip -l getArtifactsUpTo.zip

Before

Archive:  getArtifactsUpTo.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      528  11-11-2009 07:05   config.xml
        0  11-10-2009 06:38   jobs/
        0  04-28-2010 20:55   jobs/testJob/
        0  04-28-2010 20:56   jobs/testJob/builds/
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/
        0  04-28-2010 20:59   jobs/testJob/builds/2010-04-28_08-26-00/archive/
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/archive/foo/
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/archive/foo/bar/
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/archive/foo/bar/two.txt
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/archive/sub/
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/archive/sub/dir/
        0  04-28-2010 20:58   jobs/testJob/builds/2010-04-28_08-26-00/archive/sub/dir/one.txt
        0  04-28-2010 20:59   jobs/testJob/builds/2010-04-28_08-26-00/archive/three.txt
      255  04-28-2010 20:57   jobs/testJob/builds/2010-04-28_08-26-00/build.xml
        0  04-28-2010 20:57   jobs/testJob/builds/2010-04-28_08-26-00/log
      311  04-28-2010 20:55   jobs/testJob/config.xml
---------                     -------
     1094                     16 files

After

Archive:  getArtifactsUpTo.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      528  11-11-2009 07:05   config.xml
        0  11-10-2009 06:38   jobs/
        0  04-28-2010 20:55   jobs/testJob/
        0  03-25-2025 15:56   jobs/testJob/builds/
        0  03-25-2025 15:56   jobs/testJob/builds/1/
        0  04-28-2010 20:59   jobs/testJob/builds/1/archive/
        0  04-28-2010 20:59   jobs/testJob/builds/1/archive/three.txt
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/sub/
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/sub/dir/
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/sub/dir/one.txt
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/foo/
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/foo/bar/
        0  04-28-2010 20:58   jobs/testJob/builds/1/archive/foo/bar/two.txt
      273  03-25-2025 15:56   jobs/testJob/builds/1/build.xml
        0  04-28-2010 20:57   jobs/testJob/builds/1/log
      311  04-28-2010 20:55   jobs/testJob/config.xml
---------                     -------
     1112                     16 files
git-diff of the change
diff --git a/builds/2010-04-28_08-26-00/archive/foo/bar/two.txt b/builds/1/archive/foo/bar/two.txt
similarity index 100%
rename from builds/2010-04-28_08-26-00/archive/foo/bar/two.txt
rename to builds/1/archive/foo/bar/two.txt
diff --git a/builds/2010-04-28_08-26-00/archive/sub/dir/one.txt b/builds/1/archive/sub/dir/one.txt
similarity index 100%
rename from builds/2010-04-28_08-26-00/archive/sub/dir/one.txt
rename to builds/1/archive/sub/dir/one.txt
diff --git a/builds/2010-04-28_08-26-00/archive/three.txt b/builds/1/archive/three.txt
similarity index 100%
rename from builds/2010-04-28_08-26-00/archive/three.txt
rename to builds/1/archive/three.txt
diff --git a/builds/2010-04-28_08-26-00/build.xml b/builds/1/build.xml
similarity index 85%
rename from builds/2010-04-28_08-26-00/build.xml
rename to builds/1/build.xml
index 8764092..c65adfe 100644
--- a/builds/2010-04-28_08-26-00/build.xml
+++ b/builds/1/build.xml
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <build>
   <actions/>
-  <number>1</number>
+  <timestamp>1272423360000</timestamp>
   <result>SUCCESS</result>
   <duration>100</duration>
   <keepLog>false</keepLog>
diff --git a/builds/2010-04-28_08-26-00/log b/builds/1/log
similarity index 100%
rename from builds/2010-04-28_08-26-00/log
rename to builds/1/log

throws IOException {
super.onLoad(parent, name);

// see https://github.com/jenkinsci/jenkins/pull/10456#issuecomment-2748112449
Copy link
Member

Choose a reason for hiding this comment

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

return getByNumber(Integer.parseInt(id));
try {
return getByNumber(Integer.parseInt(id));
} catch (NumberFormatException e) { // see https://issues.jenkins.io/browse/JENKINS-75476
Copy link
Member

Choose a reason for hiding this comment

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

@gbhat618 gbhat618 marked this pull request as ready for review March 26, 2025 07:12
File is: test/src/test/resources/hudson/model/QueueTest/recover_from_legacy_list.zip
Found it by `git ls-files -z | xargs -0 fgrep legacyIds`
Also verified there are no plain files in the repo `find . -type f -name 'legacyIds'`.

Before
```
Archive:  recover_from_legacy_list.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
     1526  02-09-2015 02:53   config.xml
      152  02-09-2015 02:53   hudson.model.UpdateCenter.xml
     1680  02-09-2015 02:53   identity.key.enc
      188  02-09-2015 02:53   jenkins.model.JenkinsLocationConfiguration.xml
        0  02-09-2015 02:53   jobs/
        0  02-09-2015 02:53   jobs/test/
        0  02-09-2015 02:53   jobs/test/builds/
        0  02-09-2015 02:53   jobs/test/builds/legacyIds
      468  02-09-2015 02:53   jobs/test/config.xml
      907  02-09-2015 02:53   nodeMonitors.xml
      611  02-09-2015 17:14   queue.xml
       64  02-09-2015 02:53   secret.key
        0  02-09-2015 02:53   secret.key.not-so-secret
        0  02-09-2015 02:53   secrets/
        0  02-09-2015 02:53   secrets/filepath-filters.d/
     2182  02-09-2015 02:53   secrets/filepath-filters.d/30-default.conf
      272  02-09-2015 02:53   secrets/hudson.util.Secret
       48  02-09-2015 02:53   secrets/jenkins.security.ApiTokenProperty.seed
      256  02-09-2015 02:53   secrets/master.key
      272  02-09-2015 02:53   secrets/org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
        0  02-09-2015 02:53   secrets/whitelisted-callables.d/
      953  02-09-2015 02:53   secrets/whitelisted-callables.d/default.conf
        0  02-09-2015 02:53   userContent/
       84  02-09-2015 02:53   userContent/readme.txt
---------                     -------
     9663                     24 files
```

After
```
Archive:  recover_from_legacy_list.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
     1526  02-09-2015 02:53   config.xml
      152  02-09-2015 02:53   hudson.model.UpdateCenter.xml
     1680  02-09-2015 02:53   identity.key.enc
      188  02-09-2015 02:53   jenkins.model.JenkinsLocationConfiguration.xml
        0  02-09-2015 02:53   jobs/
        0  02-09-2015 02:53   jobs/test/
        0  03-26-2025 14:58   jobs/test/builds/
      468  02-09-2015 02:53   jobs/test/config.xml
      907  02-09-2015 02:53   nodeMonitors.xml
      611  02-09-2015 17:14   queue.xml
       64  02-09-2015 02:53   secret.key
        0  02-09-2015 02:53   secret.key.not-so-secret
        0  02-09-2015 02:53   secrets/
      272  02-09-2015 02:53   secrets/hudson.util.Secret
        0  02-09-2015 02:53   secrets/filepath-filters.d/
     2182  02-09-2015 02:53   secrets/filepath-filters.d/30-default.conf
       48  02-09-2015 02:53   secrets/jenkins.security.ApiTokenProperty.seed
      256  02-09-2015 02:53   secrets/master.key
        0  02-09-2015 02:53   secrets/whitelisted-callables.d/
      953  02-09-2015 02:53   secrets/whitelisted-callables.d/default.conf
      272  02-09-2015 02:53   secrets/org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
        0  02-09-2015 02:53   userContent/
       84  02-09-2015 02:53   userContent/readme.txt
---------                     -------
     9663                     23 files
```
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Found the legacyIds inside of this after running,

git ls-files -z | xargs -0 fgrep legacyIds
find . -type f -name 'legacyIds'

fixed now.

unzip -l recover_from_legacy_list.zip

Before

Archive:  recover_from_legacy_list.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
     1526  02-09-2015 02:53   config.xml
      152  02-09-2015 02:53   hudson.model.UpdateCenter.xml
     1680  02-09-2015 02:53   identity.key.enc
      188  02-09-2015 02:53   jenkins.model.JenkinsLocationConfiguration.xml
        0  02-09-2015 02:53   jobs/
        0  02-09-2015 02:53   jobs/test/
        0  02-09-2015 02:53   jobs/test/builds/
        0  02-09-2015 02:53   jobs/test/builds/legacyIds
      468  02-09-2015 02:53   jobs/test/config.xml
      907  02-09-2015 02:53   nodeMonitors.xml
      611  02-09-2015 17:14   queue.xml
       64  02-09-2015 02:53   secret.key
        0  02-09-2015 02:53   secret.key.not-so-secret
        0  02-09-2015 02:53   secrets/
        0  02-09-2015 02:53   secrets/filepath-filters.d/
     2182  02-09-2015 02:53   secrets/filepath-filters.d/30-default.conf
      272  02-09-2015 02:53   secrets/hudson.util.Secret
       48  02-09-2015 02:53   secrets/jenkins.security.ApiTokenProperty.seed
      256  02-09-2015 02:53   secrets/master.key
      272  02-09-2015 02:53   secrets/org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
        0  02-09-2015 02:53   secrets/whitelisted-callables.d/
      953  02-09-2015 02:53   secrets/whitelisted-callables.d/default.conf
        0  02-09-2015 02:53   userContent/
       84  02-09-2015 02:53   userContent/readme.txt
---------                     -------
     9663                     24 files

After

Archive:  recover_from_legacy_list.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
     1526  02-09-2015 02:53   config.xml
      152  02-09-2015 02:53   hudson.model.UpdateCenter.xml
     1680  02-09-2015 02:53   identity.key.enc
      188  02-09-2015 02:53   jenkins.model.JenkinsLocationConfiguration.xml
        0  02-09-2015 02:53   jobs/
        0  02-09-2015 02:53   jobs/test/
        0  03-26-2025 14:58   jobs/test/builds/
      468  02-09-2015 02:53   jobs/test/config.xml
      907  02-09-2015 02:53   nodeMonitors.xml
      611  02-09-2015 17:14   queue.xml
       64  02-09-2015 02:53   secret.key
        0  02-09-2015 02:53   secret.key.not-so-secret
        0  02-09-2015 02:53   secrets/
      272  02-09-2015 02:53   secrets/hudson.util.Secret
        0  02-09-2015 02:53   secrets/filepath-filters.d/
     2182  02-09-2015 02:53   secrets/filepath-filters.d/30-default.conf
       48  02-09-2015 02:53   secrets/jenkins.security.ApiTokenProperty.seed
      256  02-09-2015 02:53   secrets/master.key
        0  02-09-2015 02:53   secrets/whitelisted-callables.d/
      953  02-09-2015 02:53   secrets/whitelisted-callables.d/default.conf
      272  02-09-2015 02:53   secrets/org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
        0  02-09-2015 02:53   userContent/
       84  02-09-2015 02:53   userContent/readme.txt
---------                     -------
     9663                     23 files

@gbhat618
Copy link
Contributor Author

gbhat618 commented Mar 26, 2025

Failing test hudson.model.FileParameterValueTest.fileParameter_canStillUse_internalHierarchy (ref ci test report)
seems like a flake as only failed in JDK17, same test is also failing in other PR (ref ci test report)

checking 👀

Edit: checking in #10471

gbhat618 added a commit to gbhat618/jenkins that referenced this pull request Mar 26, 2025
…archy Test failure

The test `hudson.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy` failed in CI with error,
<details><summary>failure log</summary>

```
java.lang.NullPointerException: Cannot invoke "org.htmlunit.html.DomElement.getHtmlElementDescendants()" because "doc" is null
	at org.htmlunit.html.HtmlPage.executeDeferredScriptsIfNeeded(HtmlPage.java:1466)
	at org.htmlunit.html.HtmlPage.initialize(HtmlPage.java:265)
	at org.htmlunit.WebClient.loadWebResponseInto(WebClient.java:701)
	at org.htmlunit.WebClient.loadWebResponseInto(WebClient.java:575)
	at org.htmlunit.WebClient.getPage(WebClient.java:493)
	at org.htmlunit.WebClient.getPage(WebClient.java:402)
	at org.htmlunit.WebClient.getPage(WebClient.java:538)
	at org.htmlunit.WebClient.getPage(WebClient.java:520)
	at org.jvnet.hudson.test.JenkinsRule$WebClient.getPage(JenkinsRule.java:2740)
	at org.jvnet.hudson.test.JenkinsRule.after(JenkinsRule.java:519)
	at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:677)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.lang.Thread.run(Thread.java:840)
```
</details>

This is noticed in couple of PRs failing currently,
* jenkinsci#10456 ([ref failed test result](https://ci.jenkins.io/job/Core/job/jenkins/job/PR-10456/7/testReport/))
* jenkinsci#10467 ([ref failed test result](https://ci.jenkins.io/job/Core/job/jenkins/job/PR-10467/2/testReport/))

I haven't been able to reproduce in local, but theory is these below mentioned delays could be the cause,
* there is a slowness noticed in calls `wc.goTo(p.getUrl()...)` taking `~10s`.
* And once the test is complete the stopping is taking another `10s`.
<details><summary>log</summary>

```
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running hudson.model.FileParameterValueTest
=== Starting fileParameter_canStillUse_internalHierarchy(hudson.model.FileParameterValueTest)
   0.047 [id=21]	INFO	o.jvnet.hudson.test.WarExploder#explode: Using jenkins.war resources from /.../jenkins/war/target/jenkins
   0.304 [id=21]	INFO	o.jvnet.hudson.test.JenkinsRule#createWebServer2: Running on http://localhost:64862/jenkins/
   0.367 [id=21]	INFO	jenkins.model.Jenkins#<init>: Starting version 2.504-SNAPSHOT
   0.421 [id=36]	INFO	jenkins.InitReactorRunner$1#onAttained: Started initialization
   1.002 [id=46]	INFO	hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/command-launcher.jpi as a dependency of gradle
   1.012 [id=46]	INFO	hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/apache-httpcomponents-client-4-api.jpi as a dependency of gradle
   1.034 [id=46]	INFO	hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/jdk-tool.jpi as a dependency of gradle
   1.052 [id=46]	INFO	hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/trilead-api.jpi as a dependency of gradle
   1.079 [id=46]	INFO	hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/eddsa-api.jpi as a dependency of gradle
   1.084 [id=46]	INFO	hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/gson-api.jpi as a dependency of gradle
   1.098 [id=46]	INFO	hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/mina-sshd-api-common.jpi as a dependency of gradle
   1.109 [id=46]	INFO	hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/mina-sshd-api-core.jpi as a dependency of gradle
   1.134 [id=46]	INFO	hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/sshd.jpi as a dependency of gradle
   1.353 [id=41]	INFO	jenkins.InitReactorRunner$1#onAttained: Listed all plugins
   1.362 [id=37]	INFO	j.b.api.BouncyCastlePlugin#start: /.../jenkins/test/target/j h15288515834251035408/plugins/bouncycastle-api/WEB-INF/optional-lib not found; for non RealJenkinsRule this is fine and can be ignored.
   1.931 [id=53]	INFO	jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
   1.937 [id=34]	INFO	jenkins.InitReactorRunner$1#onAttained: Started all plugins
   1.937 [id=47]	INFO	jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
   2.254 [id=53]	INFO	jenkins.InitReactorRunner$1#onAttained: System config loaded
   2.255 [id=53]	INFO	jenkins.InitReactorRunner$1#onAttained: System config adapted
   2.255 [id=37]	INFO	jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
   2.255 [id=37]	INFO	jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
   2.307 [id=50]	INFO	jenkins.InitReactorRunner$1#onAttained: Completed initialization
   2.466 [test0 jenkinsci#1] Started by user SYSTEM
   2.466 [test0 jenkinsci#1] Running as SYSTEM
   2.466 [test0 jenkinsci#1] Building in workspace /.../jenkins/test/target/j h15288515834251035408/workspace/test0
   2.466 [test0 jenkinsci#1] Copying file to direct-child1.txt
   2.466 [test0 jenkinsci#1] Copying file to parent/child2.txt
   2.899 [test0 jenkinsci#1] Finished: SUCCESS
   3.046 [id=21]	INFO	h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: getting ws
  14.449 [id=21]	INFO	h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: got htmlunit for ws
  14.450 [id=21]	INFO	h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: got ws
  14.452 [id=21]	INFO	h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: getting ws/parent
  24.720 [id=21]	INFO	h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: got htmlunit for ws/parent
  24.733 [id=21]	INFO	h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: got ws/parent
  24.733 [id=21]	INFO	h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: completed
  34.767 [id=21]	INFO	hudson.lifecycle.Lifecycle#onStatusUpdate: Stopping Jenkins
WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.
  34.799 [id=21]	INFO	hudson.lifecycle.Lifecycle#onStatusUpdate: Jenkins stopped
  34.840 [id=21]	INFO	o.j.h.t.TemporaryDirectoryAllocator#dispose: deleting /.../jenkins/test/target/j h15288515834251035408
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 35.15 s -- in hudson.model.FileParameterValueTest
```
</details>
@timja timja changed the title [FIXED JENKINS-75465] Delete RunIdMigrator as it has been 10 years since this migration [JENKINS-75465] Delete RunIdMigrator as it has been 10 years since this migration Mar 26, 2025
@timja
Copy link
Member

timja commented Mar 26, 2025

The changelog and upgrade guidelines seem too verbose. Should I shorten them, perhaps by removing details about requiring an intermediate update? Upgrading from such an old version to the latest may not even be possible due to significant changes over the years.

any suggestions about changelog and upgrade guidelines section?

From my PoV the changelog entry is far too long.

This is fine:

Removed migration support for upgrading directly from Jenkins 1.596 (2015) or earlier to 1.597+

Or possibly

Removed migration support for upgrading directly from Jenkins 1.596 (2015) or earlier to this version

Upgrade guide can be longer although personally I think only the downgrade instructions are needed after 10 years...

@gbhat618
Copy link
Contributor Author

From my PoV the changelog entry is far too long ... Upgrade guide can be longer although personally I think only the downgrade instructions are needed after 10 years

Thank you for this. I made the changelog smaller, and fixed the upgrade guidelines by only keeping a note about downgrade recommendation.

Just checked Jenkins stats (https://stats.jenkins.io/statistics) for versions older than 1.596—about 30 are still in use! 😄 No direct link, so here’s a quick screenshot.

jenkins older to 1.596, stats Oct 2024

image

@gbhat618
Copy link
Contributor Author

gbhat618 commented Mar 28, 2025

Once #10471 is merged, update this branch to trigger the CI build, which is expected to pass.

Edit: this branch is updated after the mentioned PR merged.

@krisstern krisstern requested a review from a team April 2, 2025 16:13
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

/label ready-for-merge


This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@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 Apr 2, 2025
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 removed This PR removes a feature or a public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants