Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated code #1652

Merged
merged 25 commits into from Feb 23, 2024
Merged

Remove deprecated code #1652

merged 25 commits into from Feb 23, 2024

Conversation

uhafner
Copy link
Member

@uhafner uhafner commented Jan 10, 2024

Remove all deprecated methods and fields.

Based on #1649.

@uhafner uhafner added the breaking Breaking Changes label Jan 10, 2024
# Conflicts:
#	plugin/pom.xml
#	plugin/src/main/java/io/jenkins/plugins/analysis/core/steps/RecordIssuesStep.java
#	plugin/src/main/java/io/jenkins/plugins/analysis/core/steps/ScanForIssuesStep.java
#	plugin/src/test/java/io/jenkins/plugins/analysis/warnings/steps/MiscIssuesRecorderITest.java
#	plugin/src/test/java/io/jenkins/plugins/analysis/warnings/steps/StepsITest.java
import static org.mockito.Mockito.*;

/**
* Tests the class {@link QualityGate}.
*
* @author Ullrich Hafner
*/
class QualityGateTest extends SerializableTest<QualityGate> {
class QualityGateTest extends SerializableTest<WarningsQualityGate> {

Check notice

Code scanning / CodeQL

Unused classes and interfaces Note

Unused class: QualityGateTest is not referenced within this codebase. If not used as an external API it should be removed.
@uhafner uhafner merged commit 58782cc into main Feb 23, 2024
2 of 4 checks passed
@uhafner uhafner deleted the remove-deprecated branch February 23, 2024 22:34
@KalleOlaviNiemitalo
Copy link
Contributor

KalleOlaviNiemitalo commented Feb 27, 2024

I'll need to replace deprecated parameters of pipeline steps in multiple repositories and branches before I can safely upgrade warnings-ng-plugin from 10.7.0 to 11.0.0 in production. Is there a summary list of the required changes? I attempted to make one below.

  • publishIssues step (io.jenkins.plugins.analysis.core.steps.PublishIssuesStep):

    • ignoreFailedBuilds parameter: Deleted, although it had not been @Deprecated.
    • referenceBuildId parameter: Deleted, although it had not been @Deprecated.
    • referenceJobName parameter: Deleted, although it had not been @Deprecated.
    • unstableTotalAll, unstableTotalHigh, unstableNewAll, unstableTotalNormal, unstableTotalLow, unstableNewHigh, unstableNewNormal, unstableNewLow, failedTotalAll, failedTotalHigh, failedTotalNormal, failedTotalLow, failedNewAll, failedNewHigh, failedNewNormal, failedNewLow parameters: Replaced with qualityGates.
  • recordIssues step (io.jenkins.plugins.analysis.core.steps.RecordIssuesStep):

    • blameDisabled parameter: Replaced with skipBlames.
    • forensicsDisabled parameter: Deleted.
    • ignoreFailedBuilds parameter: Deleted, although it had not been @Deprecated.
    • referenceBuildId parameter: Deleted, although it had not been @Deprecated.
    • referenceJobName parameter: Deleted, although it had not been @Deprecated.
    • sourceDirectory parameter: Replaced with sourceDirectories, although it had not been @Deprecated.
    • unstableTotalAll, unstableTotalHigh, unstableNewAll, unstableTotalNormal, unstableTotalLow, unstableNewHigh, unstableNewNormal, unstableNewLow, failedTotalAll, failedTotalHigh, failedTotalNormal, failedTotalLow, failedNewAll, failedNewHigh, failedNewNormal, failedNewLow parameters: Replaced with qualityGates.
  • scanForIssues step (io.jenkins.plugins.analysis.core.steps.ScanForIssuesStep):

    • forensicsDisabled parameter: Deleted.
    • sourceDirectory parameter: Replaced with sourceDirectories, although it had not been @Deprecated.

    (This step still has a blameDisabled parameter rather than a skipBlames parameter. That will be changed in Use the correct property name skipBlames #1690.)

  • For freestyle jobs (io.jenkins.plugins.analysis.core.steps.IssuesRecorder):

    • forensicsDisabled parameter: Deleted.
    • sourceDirectory parameter: Replaced with sourceDirectories, although it had not been @Deprecated.
    • ignoreFailedBuilds parameter: Deleted, although it had not been @Deprecated.
    • referenceJobName parameter: Deleted, although it had not been @Deprecated.
    • referenceBuildId was also removed but it did not have @DataBoundSetter.
    • publishAllIssues parameter: Replaced with checksAnnotationScope, although it had not been @Deprecated. If it is deserialized from a previously saved job, it will be translated to checksAnnotationScope.

Step parameters newly deprecated in 11.0.0:

  • publishIssues step (io.jenkins.plugins.analysis.core.steps.PublishIssuesStep),
    recordIssues step (io.jenkins.plugins.analysis.core.steps.RecordIssuesStep):

    • publishAllIssues parameter: Deprecated; use checksAnnotationScope.
    • qualityGates parameter:
      • unstable property: Deprecated; use criticality.

@uhafner
Copy link
Member Author

uhafner commented Feb 27, 2024

Thanks for collecting this information! I think you found all changes. I added these steps to the release notes!

@sach-edna
Copy link

Hi, thanks for documenting these changes. Please excuse my ignorance of this information, but is there some place these changes are documented beforehand or for the future?

We use the warnings-ng plugin for taskscanner, parasoft, pylint, iar, gcc, cmaken, mypy in about 50 pipeline projects. When updating the warnings-ng plugin we got an syntax error across most of our pipelines. Is there some way we could have known this was coming (except monitoring the PR's and commits in this repo)?

Since we will have to update most of our pipelines, it would be nice if we could have an idea which breaking syntax changes are coming, to plan our maintenance accordingly.

Thanks for your hard work in maintaining this plugin!

@uhafner
Copy link
Member Author

uhafner commented Mar 13, 2024

Hi, thanks for documenting these changes. Please excuse my ignorance of this information, but is there some place these changes are documented beforehand or for the future?

We use the warnings-ng plugin for taskscanner, parasoft, pylint, iar, gcc, cmaken, mypy in about 50 pipeline projects. When updating the warnings-ng plugin we got an syntax error across most of our pipelines. Is there some way we could have known this was coming (except monitoring the PR's and commits in this repo)?

Since we will have to update most of our pipelines, it would be nice if we could have an idea which breaking syntax changes are coming, to plan our maintenance accordingly.

Thanks for your hard work in maintaining this plugin!

The required changes are typically part of the release notes (https://github.com/jenkinsci/warnings-ng-plugin/releases/tag/v11.0.0) or the pull request. Most removed attributes have been marked as deprecated for quite a while. So it makes sense to check these before doing a major version upgrade.

For some of the properties it wasn't possible to leave the property in place as I moved the functionality to a different plugin.

@sach-edna
Copy link

sach-edna commented Mar 13, 2024 via email

@uhafner
Copy link
Member Author

uhafner commented Mar 13, 2024

Thanks for this information. We will keep in mind to check the release notes for further changes. Do you have a plan/roadmap for future syntax changes? Since we have to update quite a few of them it would be helpful to know is new changes will be coming soon. If not we will update to the new syntax, otherwise we will wait a bit until the new syntax is added.

There are no major upgrades planned in the near future since my research semester is finished I am back to my normal schedule which doesn't allow to make bigger changes...

@KalleOlaviNiemitalo
Copy link
Contributor

When I was collecting data for #1652 (comment), I hoped Jenkins could be made to automatically warn about uses of deprecated parameters in pipelines; either as part of Pipeline itself, or as a separate plugin. Alas, several of the removed parameters had not been deprecated, so it would not have been possible to warn about them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking Changes
Projects
None yet
4 participants