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

Artifactory permission issue since plugin-modernizer-tool was moved to jenkins-infra #4443

Closed
jonesbusy opened this issue Dec 7, 2024 · 21 comments

Comments

@jonesbusy
Copy link

Service(s)

Artifactory

Summary

Hi,

Since we move the repo to the jenkins-infra org we cannot use anymore the cd workflow because we lost permission to Artifactory

https://github.com/jenkins-infra/plugin-modernizer-tool/actions/runs/12213040105/job/34072201325

I guess the RPU ignore this repo so we probably need other credentials

I'm not sure if we have other maven repo on jenkins-infra that publish artifact to Artifactory, but can we add those secret to the repo ? (MAVEN_TOKEN and MAVEN_USERNAME)

FYI we started to work on the JReleaser to publish the tap. The idea I had in my is

But right now I'm stuck to use the cd workflow :(

Thank you help ?

Regards,

Reproduction steps

No response

@jonesbusy jonesbusy added the triage Incoming issues that need review label Dec 7, 2024
@jonesbusy
Copy link
Author

FYI @gounthar

@timja
Copy link
Member

timja commented Dec 7, 2024

The error is:

WARNING	i.j.i.r.GitHubImpl#getRepositoryPublicKey: Failed to retrieve public key for jenkins-infra/plugin-modernizer-tool, response code: 403

@timja
Copy link
Member

timja commented Dec 7, 2024

I've added jenkins-infra-bot as an admin on https://github.com/jenkins-infra/plugin-modernizer-tool.

I think that might sort it. The account is an owner on Jenkinsci but not on jenkins-infra

@gounthar
Copy link

gounthar commented Dec 7, 2024

Thanks, Tim! 👍

@jonesbusy
Copy link
Author

Thanks, I will wait a while to have the token created (since we move the repo we also lost access to credential section of the repo)

@timja
Copy link
Member

timja commented Dec 7, 2024

restored

@jonesbusy
Copy link
Author

@timja
Copy link
Member

timja commented Dec 7, 2024

Hmm different error now, 403: https://github.com/jenkins-infra/plugin-modernizer-tool/actions/runs/12214126072/job/34074515556

@jonesbusy
Copy link
Author

Mhh that's weird

@jonesbusy
Copy link
Author

@timja
Copy link
Member

timja commented Dec 8, 2024

yeah its probably that, I've been trying to debug it locally to generate the json files but I can't get the tool to run on my machine:

❯ java -DdryRun=true  -DdefinitionsDir=$PWD/permissions -DartifactoryApiTempDir=$PWD/json -DartifactoryUserNamesJsonListUrl=https://reports.jenkins.io/artifactory-ldap-users-report.json -Djava.util.logging.SimpleFormatter.format="%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s: %5$s%6$s%n" -jar target/repository-permissions-updater-*-bin/repository-permissions-updater-*.jar
2024-12-08 08:58:58.009+0000 [id=1]	INFO	java_util_logging_Logger$log$1#call: Running in dry run mode
Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: static io.jenkins.infra.repository_permissions_updater.ArtifactoryPermissionsUpdater.generateApiPayloads() is applicable for argument types: (File, File) values: [/Users/timja/code/jenkins/repository-permissions-updater/permissions, ...]
	at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1525)
	at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1511)
	at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.callStatic(StaticMetaClassSite.java:62)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:55)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:196)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:216)
	at io.jenkins.infra.repository_permissions_updater.ArtifactoryPermissionsUpdater.main(ArtifactoryPermissionsUpdater.groovy:500)

It runs on CI but for some reason the CD files aren't being generated there and archived: https://ci.jenkins.io/job/Infra/job/repository-permissions-updater/job/master/31402/artifact/json/

@smerle33 smerle33 added this to the infra-team-sync-2024-12-10 milestone Dec 9, 2024
@smerle33 smerle33 removed the triage Incoming issues that need review label Dec 9, 2024
@jonesbusy
Copy link
Author

Should we try to rollback the RPU to check if it works ?

paths:
-  - "io/jenkins/plugin-modernizer/plugin-modernizer-parent-pom"
-  - "io/jenkins/plugin-modernizer/plugin-modernizer-cli"
-  - "io/jenkins/plugin-modernizer/plugin-modernizer-core"
+  - "io/jenkins/plugin-modernizer/plugin-modernizer-*"

@timja
Copy link
Member

timja commented Dec 10, 2024

yes I think you'll need to re-add the deleted files too

@jonesbusy
Copy link
Author

Well... jenkins-infra/repository-permissions-updater#4222

Will see

@dduportal
Copy link
Contributor

Watching the build on trusted.ci for you folks

@jonesbusy
Copy link
Author

For the moment it didn't make any change : https://github.com/jenkins-infra/plugin-modernizer-tool/actions/runs/12254160825/job/34184491992

Still 403

@dduportal
Copy link
Contributor

The build(s) just finished with success. Currently checking logs

@dduportal
Copy link
Contributor

  • tokens have been updated 18 min ago
  • logs shows there are 3 CD components detected for the repo:
10:42:55  2024-12-10 09:42:54.990+0000 [id=1]	INFO	o.c.g.r.c.PlainObjectMetaMethodSite#doInvoke: CD-enabled component 'plugin-modernizer-pom' in repository 'jenkins-infra/plugin-modernizer-tool'
10:42:55  2024-12-10 09:42:54.990+0000 [id=1]	INFO	o.c.g.r.c.PlainObjectMetaMethodSite#doInvoke: CD-enabled component 'plugin-modernizer-core' in repository 'jenkins-infra/plugin-modernizer-tool'
10:42:55  2024-12-10 09:42:55.190+0000 [id=1]	INFO	o.c.g.r.c.PlainObjectMetaMethodSite#doInvoke: CD-enabled component 'plugin-modernizer-cli' in repository 'jenkins-infra/plugin-modernizer-tool'

I got the following logs:

10:18:17  2024-12-10 10:18:17.639+0000 [id=1]	INFO	o.c.g.r.c.PlainObjectMetaMethodSite#doInvoke: Processing repository jenkins-infra/plugin-modernizer-tool for CD
10:18:17  2024-12-10 10:18:17.645+0000 [id=1]	INFO	o.c.g.r.c.PlainObjectMetaMethodSite#doInvoke: Sending POST to https://repo.jenkins-ci.org/access/api/v1/tokens
10:18:17  2024-12-10 10:18:17.648+0000 [id=1]	INFO	java_util_logging_Logger$log$1#call: Generating token with request payload: username=CD-for-jenkins-infra__plugin-modernizer-tool&scope=applied-permissions%2Fgroups%3Areaders%2Cgeneratedv2-cd-jenkins-infra_plugin-modernizer-tool&expires_in=14400
10:18:17  2024-12-10 10:18:17.696+0000 [id=1]	INFO	o.c.g.r.c.PlainObjectMetaMethodSite#doInvoke: POST request to https://repo.jenkins-ci.org/access/api/v1/tokens returned: HTTP 200 OK
10:18:17  2024-12-10 10:18:17.701+0000 [id=1]	INFO	i.j.i.r.GitHubImpl#getRepositoryPublicKey: GET call to retrieve public key for jenkins-infra/plugin-modernizer-tool
10:18:17  2024-12-10 10:18:17.938+0000 [id=1]	INFO	o.c.g.r.c.PlainObjectMetaMethodSite#doInvoke: Public key of jenkins-infra/plugin-modernizer-tool is <REDACTED>
10:18:17  2024-12-10 10:18:17.982+0000 [id=1]	INFO	o.c.g.r.c.PlainObjectMetaMethodSite#doInvoke: Encrypted secrets are username:<REDACTED>; token:<REDACTED>
10:18:17  2024-12-10 10:18:17.983+0000 [id=1]	INFO	i.j.i.r.GitHubImpl#createOrUpdateRepositorySecret: Create/update the secret MAVEN_USERNAME for jenkins-infra/plugin-modernizer-tool encrypted with key <REDACTED>
10:18:18  2024-12-10 10:18:18.203+0000 [id=1]	INFO	i.j.i.r.GitHubImpl#createOrUpdateRepositorySecret: Create/update the secret MAVEN_TOKEN for jenkins-infra/plugin-modernizer-tool encrypted with key <REDACTED>

@jonesbusy
Copy link
Author

Now it works.

I saw some token were generated more recently

recent_token

https://github.com/jenkins-infra/plugin-modernizer-tool/releases/tag/911.v211a_1d5a_7a_a_f

https://github.com/jenkins-infra/plugin-modernizer-tool/actions/runs/12254938546

@dduportal
Copy link
Contributor

Looks like we can close this issue @jonesbusy ?

@jonesbusy
Copy link
Author

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants