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

Jenkins CI failing for jenkins plugin after changes in jenkinsfile to update jenkins.version #3670

Closed
sumoanema opened this issue Jul 19, 2023 · 11 comments

Comments

@sumoanema
Copy link

Service(s)

plugins.jenkins.io

Summary

Problem with this page

https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fsumologic-publisher-plugin/detail/PR-33/1/pipeline

I had raised this issue previously- #3572 but it got closed, since I could not test it. Tested it now and the issue still persists :

Expected behavior

Changes were made to pom.xml to upgrade the jenkins.version of the sumologic-publisher plugin. Same jenkins.version was updated to the JenkinsFile as well and since the upgraded jenkins.version works with java 11 changes were made in jenkinsfile to update the java version as well - https://github.com/jenkinsci/sumologic-publisher-plugin/pull/26/files#diff-e6ffa5dc854b843b3ee3c3c28f8eae2f436c2df2b1ca299cca1fa5982e390cf8.

Expected behaviour - Jenkins CI job for the plugin should pass when creating the PR to merge the respective changes with respective jenkins and java version provided in jenkins file.

Actual behavior

Jenkins CI job are failing. This is because although in the JenkinsFile jenkins version is upgrade to 2.361.4, jenkins ci job is picking the older version of - 2.332.1 and later fails with this error :
Caused by: org.apache.maven.plugin.MojoExecutionException: This version of maven-hpi-plugin requires Jenkins 2.361 or later

Thus the CI pipeline getting created for the PR is still referring the old jenkins file. I have already tried closing the PR and recreating a new PR - after which the issue persists.

Possible solution

No response

Reproduction steps

No response

@sumoanema sumoanema added the triage Incoming issues that need review label Jul 19, 2023
@sumoanema
Copy link
Author

sumoanema commented Jul 19, 2023

@dduportal - Have been facing the issue same as before - #3572 . Could you please help

@lemeurherve
Copy link
Member

Hello @sumoanema,

I've replayed a build with the updated Jenkinsfile content as you still seems to be "untrusted" 🤔

Have you joined the team Timja invited you to in #3572 (comment)?

@lemeurherve lemeurherve self-assigned this Jul 19, 2023
@lemeurherve lemeurherve removed the triage Incoming issues that need review label Jul 19, 2023
@timja
Copy link
Member

timja commented Jul 19, 2023

Looks like a possible bug, for some reason it's checking your organisation permissions rather than your user account.

Connecting to https://api.github.com/ to check permissions of obtain list of SumoLogic for jenkinsci/sumologic-publisher-plugin

Can you try create your pull request from your own fork rather than your organisations fork initially?

@dduportal
Copy link
Contributor

Hi @sumoanema we need you to respond to our questions in order to be able to unblock you. It's been 2 week, and we don't know how to help without feedbacks from you: it seems we are hitting a edge case with your plugin's repository so we need your help (as no other plugin maintainers seems to have these issues)

@sumoanema
Copy link
Author

@dduportal - sorry for the delayed response. I tried with raising a PR with my own fork rather then my orgs fork. Made changes to jenkins file to trigger only windows build. And the changes were picked by the CI job and it triggered only the windows build - jenkinsci/sumologic-publisher-plugin#34

@dduportal
Copy link
Contributor

Many thanks for checking this and for the contribution @sumoanema !

If i understand correctly, your problem is solved (e.g. you have to open a PR from your fork if you want to use the Jenkinsfile) : is that correct?

@sumoanema
Copy link
Author

sumoanema commented Aug 1, 2023

@dduportal - Even I thought the same when I created the above PR. But just to confirm I created another PR from by org's fork. As part of the PR I have removed linux build from jenkinsfile - https://github.com/jenkinsci/sumologic-publisher-plugin/pull/35/files
But the jenkins CI build which got triggered did not honour the changes and got triggered for both linux and windows.
https://github.com/jenkinsci/sumologic-publisher-plugin/pull/35/checks?check_run_id=15514960605

I am not sure why the problem is occuring only for my org's fork. Since jenkins repo while creating the CI job should ideally not consider from which repo the changes are coming in. Please advice .

@timja
Copy link
Member

timja commented Aug 1, 2023

cc @jglick ^^

@jglick
Copy link

jglick commented Aug 1, 2023

https://ci.jenkins.io/job/Plugins/job/sumologic-publisher-plugin/job/PR-35/1/console

Connecting to https://api.github.com/ to check permissions of obtain list of SumoLogic for jenkinsci/sumologic-publisher-plugin
 Loading trusted files from base branch master at ea7cdb8e896c8fd64d9dd7247e07b9d75eb4a6bf rather than 48eb2d966174afe9f75b4edbdf9a44adbed5a0c8
 Obtained Jenkinsfile from ea7cdb8e896c8fd64d9dd7247e07b9d75eb4a6bf
 ‘Jenkinsfile’ has been modified in an untrusted revision

Presumably the org is not considered a trusted contributor the repo. TBH I did not know it was even possible to file a PR “as” an org; probably github-branch-source does not support this scenario. Please either file PRs from your personal fork, or from a branch in the origin repository rather than using a fork.

Also remember to delete the https://github.com/SumoLogic/sumologic-jenkins-plugin repository now that the official version is in @jenkinsci.

@timja
Copy link
Member

timja commented Aug 2, 2023

You just file a PR from your orgs fork which is legitimate. I normally discourage it in open source because filing a PR from an org prevents maintainers from being allowed to push to the PR to fix up issues / get a PR over the line

@sumoanema
Copy link
Author

Got it. Thanks
We will proceed archiving the https://github.com/SumoLogic/sumologic-jenkins-plugin branch and for future contributions to the plugin will use the jenkinsci repo itself.

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