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

jobs: Add a bump-jenkins-plugins job #917

Merged
merged 1 commit into from
May 6, 2024
Merged

jobs: Add a bump-jenkins-plugins job #917

merged 1 commit into from
May 6, 2024

Conversation

aaradhak
Copy link
Member

@aaradhak aaradhak commented Oct 5, 2023

We are creating this bump-jenkins-job in order to periodically update the latest plugin version of Jenkins offered by Openshift/Jenkins.

bump-jenkins-job automates the process of checking for updates to Jenkins plugins, updating the plugin versions in a configuration file, pushing the changes to a Git repository, and opening a pull request for review.

Plugin Update Process:

  • This job reads a list of plugins from the file plugins.txt in the repository.
  • It iterates over each plugin, checks for updates and if a newer version is available, it updates the version in the file.
  • For each plugin, it fetches the latest version by querying a URL based on the Jenkins plugin repository structure.
  • If an update is found, it modifies the plugins.txt file to reflect the new version.
  • The updates in the plugins.txt file are committed and pushed to the pr_branch.
  • It also opens a pull request with the updated plugin versions.

Ref: #562

@aaradhak
Copy link
Member Author

We can create a PR with the jenkins plugin updates with this code -
coreosbot-releng#2

https://jenkins-fedora-coreos-pipeline.apps.ocp.stg.fedoraproject.org/job/bump-jenkins-plugins/49/console

@aaradhak aaradhak changed the title jobs: Add a bump-jenkins job jobs: Add a bump-jenkins-plugins job Dec 12, 2023
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
@aaradhak aaradhak requested a review from jlebon February 22, 2024 17:54
Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Some minor comments, but this looks sane overall!

jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
@aaradhak
Copy link
Member Author

@jlebon I have addressed all the comments and have made the changes.

Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. Mostly looking good. A few comments.

jobs/bump-jenkins-plugins.Jenkinsfile Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Show resolved Hide resolved
jobs/bump-jenkins-plugins.Jenkinsfile Outdated Show resolved Hide resolved
@aaradhak
Copy link
Member Author

aaradhak commented May 3, 2024

Posting the links for the PR and jenkins build below for reference:

PR for the plugins update - coreosbot-releng#10
Jenkins build - https://jenkins-fedora-coreos-pipeline.apps.ocp.stg.fedoraproject.org/job/bump-jenkins-plugins/152/console

@jlebon
Copy link
Member

jlebon commented May 6, 2024

Haven't reviewed the code again (will leave that to @dustymabe), but just looking at the example PR in coreosbot-releng#10, we should include in the commit message the job information. Compare e.g. to: coreos/fedora-coreos-config@1598859 (see bump-lockfile.Jenkinsfile in this repo).

@aaradhak
Copy link
Member Author

aaradhak commented May 6, 2024

Haven't reviewed the code again (will leave that to @dustymabe), but just looking at the example PR in coreosbot-releng#10, we should include in the commit message the job information. Compare e.g. to: coreos/fedora-coreos-config@1598859 (see bump-lockfile.Jenkinsfile in this repo).

Making sure if I understood it right, the commit message already includes the job information as suggested. Please let me know if there are any additional improvements to be made.

@dustymabe
Copy link
Member

Making sure if I understood it right, the commit message already includes the job information as suggested. Please let me know if there are any additional improvements to be made.

Maybe he got confused because the PR description doesn't have that information.

We are creating this bump-jenkins-job in order to periodically update the latest plugin version of Jenkins offered by Openshift/Jenkins.

bump-jenkins-job automates the process of checking for updates to Jenkins plugins, updating the plugin versions in a configuration file, pushing the changes to a Git repository, and opening a pull request for review.

Plugin Update Process:

This job reads a list of plugins from the file plugins.txt in the repository.
It iterates over each plugin, checks for updates and if a newer version is available, it updates the version in the file.
For each plugin, it fetches the latest version by querying a URL based on the Jenkins plugin repository structure.
If an update is found, it modifies the plugins.txt file to reflect the new version.
The updates in the plugins.txt file are committed and pushed to the pr_branch.
It also opens a pull request with the updated plugin versions.

Ref: coreos#562

Co-authored-by: Michael Armijo <[email protected]>
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

This LGTM.

I think the remaining piece in my mind is what happens to the PRs when they are created?

Do we just merge them or do we require someone to verify the plugins are able to be deployed and an instance brought up first?

@aaradhak aaradhak requested a review from dustymabe May 6, 2024 20:54
@aaradhak
Copy link
Member Author

aaradhak commented May 6, 2024

This LGTM.

I think the remaining piece in my mind is what happens to the PRs when they are created?

Do we just merge them or do we require someone to verify the plugins are able to be deployed and an instance brought up first?

It was decided for now that the reviewer would test in staging by pointing the buildconfig at the PR and then make the merge.

@jlebon
Copy link
Member

jlebon commented May 6, 2024

Making sure if I understood it right, the commit message already includes the job information as suggested. Please let me know if there are any additional improvements to be made.

Maybe he got confused because the PR description doesn't have that information.

Yes, that's exactly what happened. :)

@aaradhak aaradhak merged commit c727030 into coreos:main May 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants