fedora-coreos-pipeline icon indicating copy to clipboard operation
fedora-coreos-pipeline copied to clipboard

jobs: Add a bump-jenkins-plugins job

Open aaradhak opened this issue 1 year ago • 3 comments

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: https://github.com/coreos/fedora-coreos-pipeline/issues/562

aaradhak avatar Oct 05 '23 21:10 aaradhak

We can create a PR with the jenkins plugin updates with this code - https://github.com/coreosbot-releng/fedora-coreos-pipeline/pull/2

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

aaradhak avatar Dec 12 '23 21:12 aaradhak

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

aaradhak avatar Mar 19 '24 21:03 aaradhak

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

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

aaradhak avatar May 03 '24 23:05 aaradhak

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

jlebon avatar May 06 '24 13:05 jlebon

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.

aaradhak avatar May 06 '24 15:05 aaradhak

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.

dustymabe avatar May 06 '24 20:05 dustymabe

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.

aaradhak avatar May 06 '24 21:05 aaradhak

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. :)

jlebon avatar May 06 '24 21:05 jlebon