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

Prevent [ab][0-9] in commit hashes from being treated as alpha or beta #24

Merged
merged 2 commits into from
Dec 28, 2021

Conversation

jglick
Copy link
Member

@jglick jglick commented Dec 28, 2021

Fixes jenkins-infra/jenkins.io#4783 by converting (e.g.) 852b473a2b8c which parses as 852-beta-473-alpha-2-beta-8-c to 852b_473a_2b_8c which parses as 852-b_-473-a_-2-b_-8-c. A bit ugly but I did not see a better approach. Tried just capitalizing the hash, but this does not work—the comparisons are apparently case-insensitive.

Could probably be more conservative and only replace [ab] when these are not surrounded by other letters ([a-f]); not sure if anyone cares.

As in jenkins-infra/incrementals-publisher#14, at least https://github.com/jenkins-infra/incrementals-publisher/blob/00be8881121de3bb26ba91605aafedeecbba7435/lib/pipeline.js#L70 would likely need to be amended as well for JEP-305 deployments (should be irrelevant for JEP-229).

@jglick jglick requested a review from basil December 28, 2021 15:30
@jglick jglick added the bug Something isn't working label Dec 28, 2021
Copy link
Member

@jetersen jetersen left a comment

Choose a reason for hiding this comment

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

Fine workaround :)

@jglick
Copy link
Member Author

jglick commented Dec 28, 2021

Released as 1.3. Ought to start showing up in Dependabot soon.

@MarkEWaite
Copy link

MarkEWaite commented Dec 31, 2021

Thanks for this improvement.

I think there may be a further change needed in order to allow ci.jenkins.io to publish incrementals. The tip of the master branch of the git client plugin has changes that I wanted to test in my development environment. The build is successful, but incrementals were not published, even though it is the tip of the master branch.

The message in the log says:

10:02:25  [Pipeline] {
10:02:25  [Pipeline] httpRequest
10:02:25  HttpMethod: POST
10:02:25  URL: https://incrementals.jenkins.io/
10:02:25  Content-Type: application/json
10:02:25  Authorization: *****
10:02:25  Sending request to url: https://incrementals.jenkins.io/
10:02:26  Response Code: HTTP/1.1 200 OK
10:02:26  Response: 
10:02:26  Skipping deployment as no artifacts were found with the expected path, typically due to a PR merge build not up to date with its base branch: https://ci.jenkins.io/job/Plugins/job/git-client-plugin/job/master/728/artifact/**/*0409ea938a3a*/*0409ea938a3a*/*zip*/archive.zip
10:02:26  
10:02:26  Success: Status code 200 is in the accepted range: 100:599
10:02:26  [Pipeline] }

I think that the issue is related to the use of $version in the archiveartifacts call of prepareToPublishIncrementals. Unfortunately, I'm not sure of the best way to resolve that.

My workaround was simple. I downloaded the git-client.hpi file from the Jenkins job and stored it in my dev repository. However, I suspect most people don't store plugin binaries in their source repositories. I do that because I need some reason to test Git LFS.

Submitted as issue #25

@jetersen
Copy link
Member

jetersen commented Dec 31, 2021

@timja
Copy link
Member

timja commented Dec 31, 2021

Builds are failing all over the place on infra.ci.jenkins.io atm with

java.io.IOException: Timed out waiting for websocket connection. You should increase the value of system property org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator.websocketConnectionTimeout currently set at 60 seconds

so the automated PRs haven't been triggered for updating this

MarkEWaite added a commit to MarkEWaite/clover-plugin that referenced this pull request Jan 5, 2022
The release reports generated by sites like https://mvrepository.com
seem to apply the same version number parsing rules as Apache Maven.
That causes those sites to see version numbers that contain the letter
'a' or the letter 'b' followed by an alphanumeric character as a
designator for an alpha or a beta release.

See jenkinsci/incrementals-tools#24 for the
rationale for that specific change and
https://github.com/jenkinsci/bom#readme for the details of the bom and
https://github.com/jenkinsci/jep/blob/master/jep/229/README.adoc for
the version number details.
@basil
Copy link
Member

basil commented Jan 7, 2022

@timja
Copy link
Member

timja commented Jan 27, 2022

@basil
Copy link
Member

basil commented Apr 24, 2022

Causes problems with revapi-maven-plugin in jenkinsci/checks-api-plugin#163:

[ERROR] Failed to execute goal org.revapi:revapi-maven-plugin:0.14.6:check (run-revapi) on project checks-api: Failed to execute the API analysis.: Failed to analyze archives: Extension revapi.semver.ignore failed to initialize: Could not parse the version string '1.7.3-rc257.84b_9587d5195'. It does not follow the semver schema. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.revapi:revapi-maven-plugin:0.14.6:check (run-revapi) on project checks-api: Failed to execute the API analysis.
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:306)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to execute the API analysis.
    at org.revapi.maven.CheckMojo.doExecute (CheckMojo.java:153)
    at org.revapi.maven.AbstractRevapiMojo.execute (AbstractRevapiMojo.java:397)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to analyze archives
    at org.revapi.maven.Analyzer.analyze (Analyzer.java:447)
    at org.revapi.maven.AbstractRevapiMojo.analyze (AbstractRevapiMojo.java:416)
    at org.revapi.maven.CheckMojo.doExecute (CheckMojo.java:97)
    at org.revapi.maven.AbstractRevapiMojo.execute (AbstractRevapiMojo.java:397)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalStateException: Extension revapi.semver.ignore failed to initialize: Could not parse the version string '1.7.3-rc257.84b_9587d5195'. It does not follow the semver schema.
    at org.revapi.Revapi.lambda$analyze$2 (Revapi.java:197)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
    at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet.lambda$entryConsumer$0 (Collections.java:1576)
    at java.util.HashMap$EntrySpliterator.forEachRemaining (HashMap.java:1764)
    at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntrySetSpliterator.forEachRemaining (Collections.java:1601)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining (Streams.java:734)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining (Streams.java:735)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining (Streams.java:735)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining (Streams.java:735)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:497)
    at org.revapi.Revapi.analyze (Revapi.java:189)
    at org.revapi.maven.Analyzer.analyze (Analyzer.java:445)
    at org.revapi.maven.AbstractRevapiMojo.analyze (AbstractRevapiMojo.java:416)
    at org.revapi.maven.CheckMojo.doExecute (CheckMojo.java:97)
    at org.revapi.maven.AbstractRevapiMojo.execute (AbstractRevapiMojo.java:397)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalArgumentException: Could not parse the version string '1.7.3-rc257.84b_9587d5195'. It does not follow the semver schema.
    at org.revapi.basic.SemverIgnoreTransform$Version.parse (SemverIgnoreTransform.java:234)
    at org.revapi.basic.SemverIgnoreTransform.initialize (SemverIgnoreTransform.java:165)
    at org.revapi.Revapi.lambda$analyze$2 (Revapi.java:193)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
    at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet.lambda$entryConsumer$0 (Collections.java:1576)
    at java.util.HashMap$EntrySpliterator.forEachRemaining (HashMap.java:1764)
    at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntrySetSpliterator.forEachRemaining (Collections.java:1601)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining (Streams.java:734)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining (Streams.java:735)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining (Streams.java:735)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining (Streams.java:735)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:497)
    at org.revapi.Revapi.analyze (Revapi.java:189)
    at org.revapi.maven.Analyzer.analyze (Analyzer.java:445)
    at org.revapi.maven.AbstractRevapiMojo.analyze (AbstractRevapiMojo.java:416)
    at org.revapi.maven.CheckMojo.doExecute (CheckMojo.java:97)
    at org.revapi.maven.AbstractRevapiMojo.execute (AbstractRevapiMojo.java:397)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

basil added a commit to basil/checks-api-plugin that referenced this pull request Apr 24, 2022
@uhafner
Copy link
Member

uhafner commented Apr 24, 2022

Causes problems with revapi-maven-plugin in jenkinsci/checks-api-plugin#163:

Yes, this is tracked in #27 and revapi/revapi#263. The fix is already committed but not yet released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
6 participants