jenkinsci / docker-plugin

Jenkins cloud plugin that uses Docker
https://plugins.jenkins.io/docker-plugin/
MIT License
487 stars 322 forks source link

Replace deprecated getPastTimeString with getTimeSpanString #1007

Closed MarkEWaite closed 11 months ago

MarkEWaite commented 11 months ago

Replace deprecated getPastTimeString with getTimeSpanString

Replaced with OpenRewrite command:

mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
      -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-jenkins:RELEASE \
      -Drewrite.activeRecipes=org.openrewrite.jenkins.migrate.hudson.UtilGetPastTimeStringToGetTimeSpanString

https://github.com/jenkinsci/jenkins/pull/4174 deprecates the API in a 2019 release of Jenkins core.

https://javadoc.jenkins.io/hudson/Util.html#getPastTimeString(long) declares it deprecated.

Testing done

Confirmed automated tests continue to pass with the change and that the modified line is executed in the automated tests.

Did not confirm that there is an assertion specifically targeting the getWhenDisabledBySystemString, but the deprecation message says that the API calls are equivalent.

Submitter checklist