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

Log warning when doing bytecode analysis #529

Merged
merged 1 commit into from
Apr 23, 2024
Merged

Conversation

basil
Copy link
Member

@basil basil commented Apr 23, 2024

The use of BytecodeReadingParanamer is not sustainable in the long term, so introduce a warning to more aggressively call out plugins that are still being built with an ancient HPI/JPI toolchain. I tried this out on the plugins in BOM and none of them showed a warning. Print the warning only a single time per signature to avoid spamming log files.

The only plugin I am aware of that will trigger this warning in production is the Gradle plugin.

Testing done

Compiled Text Finder with mvn clean verify -Dmaven.compiler.parameters=false and saw these warning as expected:

o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.util.FormValidation hudson.plugins.textfinder.TextFinder$DescriptorImpl.doCheckRegexp(java.lang.String); update plugin to a version created with a newer harness
o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.util.FormValidation hudson.plugins.textfinder.TextFinder$DescriptorImpl.doCheckRegexp(java.lang.String); update plugin to a version created with a newer harness
o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.plugins.textfinder.TextFinder(java.lang.String); update plugin to a version created with a newer harness

Ensured that these warnings appeared only once even after refreshing the pages that produced them.

@basil
Copy link
Member Author

basil commented Apr 23, 2024

@jenkinsci/gradle-plugin-developers After this is released, users of the Gradle plugin will start seeing the following warnings:

o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.util.FormValidation hudson.plugins.gradle.enriched.EnrichedSummaryConfig.doCheckHttpClientTimeoutInSeconds(int); update plugin to a version created with a newer harness
o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.util.FormValidation hudson.plugins.gradle.enriched.EnrichedSummaryConfig.doCheckHttpClientMaxRetries(int); update plugin to a version created with a newer harness
o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.util.FormValidation hudson.plugins.gradle.enriched.EnrichedSummaryConfig.doCheckHttpClientDelayBetweenRetriesInSeconds(int); update plugin to a version created with a newer harness
o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.util.FormValidation hudson.plugins.gradle.injection.InjectionConfig.doCheckServer(java.lang.String); update plugin to a version created with a newer harness
o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.util.FormValidation hudson.plugins.gradle.injection.InjectionConfig.doCheckAccessKey(java.lang.String); update plugin to a version created with a newer harness
o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.util.FormValidation hudson.plugins.gradle.injection.InjectionConfig.doCheckGradlePluginVersion(java.lang.String); update plugin to a version created with a newer harness
o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.util.FormValidation hudson.plugins.gradle.injection.InjectionConfig.doCheckCcudPluginVersion(java.lang.String); update plugin to a version created with a newer harness
o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.util.FormValidation hudson.plugins.gradle.injection.InjectionConfig.doCheckGradlePluginRepositoryUrl(java.lang.String); update plugin to a version created with a newer harness
o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.util.FormValidation hudson.plugins.gradle.injection.InjectionConfig.doCheckMavenExtensionCustomCoordinates(java.lang.String); update plugin to a version created with a newer harness
o.k.s.BytecodeReadingParanamer#lookupParameterNames: Looking up parameter names for public hudson.util.FormValidation hudson.plugins.gradle.injection.InjectionConfig.doCheckCcudExtensionCustomCoordinates(java.lang.String); update plugin to a version created with a newer harness

To perform this migration, please recompile the Gradle plugin with the -parameters flag to javac. This is done automatically in recent versions of maven-hpi-plugin and I assume should also be done by gradle-jpi-plugin (or should be fixed otherwise).

@basil basil merged commit 2fdf1a5 into jenkinsci:master Apr 23, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants