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

Support for scoop distribution #515

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CodexRaunak
Copy link

@CodexRaunak CodexRaunak commented Dec 27, 2024

Description

This PR adds support for distributing the plugin-modernizer plugin via Scoop on Windows. This integration leverages JReleaser to package and distribute the plugin, making it easy for Windows users to install and use the tool through Scoop.

Changes made:

  • Added a Scoop bucket for distributing the plugin-modernizer plugin on Windows.
  • Created an app manifest for the plugin and updated the JReleaser configuration to support Scoop as a distribution method.
  • The link for the bucket where the app manifest is located is https://github.com/CodexRaunak/plugin-modernizer-bucket

Fix #505

Testing done

This change was tested by successfully installing and running the plugin-modernizer on a Windows machine using Scoop. The installation process went through without errors.

To verify the installation:
I ran scoop install plugin-modernizer and confirmed that the installation completed successfully.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

pom.xml Outdated Show resolved Hide resolved
jreleaser.yml Outdated Show resolved Hide resolved
@jonesbusy
Copy link
Collaborator

Were you able to test the update on https://github.com/CodexRaunak/plugin-modernizer-bucket/blob/main/plugin-modernizer.json and the cd workflow ?

I dont' see any automatic commit there

@CodexRaunak
Copy link
Author

CodexRaunak commented Dec 27, 2024

Hello,
I am new to contributing to this repository and have a few questions. Here's what I've done so far:

1)Created the manifest file for the bucket and pushed it to the bucket repository, which is currently under my ownership.
2)Hardcoded the changelist with the version (which i will correct now and pass it as -Dset.changelist) and created a new release with JReleaser on my forked repository.
3)Installed the tool using Scoop on my Windows machine.

Can you help me with the following?
1)Ownership of the Bucket: Since the bucket should ideally be under the jenkins-infra organization, I attempted to transfer ownership to them. However, I encountered an issue as I didn’t have permission to create public repositories under the jenkins-infra organization. Could you clarify what I should do next? Should I transfer the repository, or is there another solution?

2)Testing Changes and Automatic Commits: How do I properly test changes after making the updates and creating the release? Also, I would appreciate guidance on ensuring that the automatic commit process works as expected. Could you point me to any resources that could help me understand how to test the changes and ensure automatic commits are made?

@jonesbusy
Copy link
Collaborator

Hi,

For the repository we will need to ask the creation of it under the jenkins-infra. Once this PR is ready we can open an helpdesk ticket on https://github.com/jenkins-infra/helpdesk/issues

JReleaser is supposed to automatically update the file

I'm not sure you can fully test the CD workflow but you can perform jreleaser on your machine targeting your forks

I was using something like

jreleaser -Djreleaser.project.version=$(mvn -q -Dset.changelist -Dignore.dirt -DforceStdout org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version) package
jreleaser -Djreleaser.project.version=$(mvn -q -Dset.changelist -Dignore.dirt -DforceStdout org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version) publish

Also a quick look on https://jreleaser.org/guide/latest/reference/packagers/scoop.html

The env var JRELEASER_SCOOP_GITHUB_TOKEN is not set on https://github.com/jenkins-infra/plugin-modernizer-tool/blob/main/.github/workflows/cd.yaml#L115C11-L115C42

I would suggest to try to test the workflow (or at least part of it) before requesting the creation of a new repo under the jenkins-infra organisation

Hope it helps

@jonesbusy jonesbusy marked this pull request as draft December 27, 2024 13:44
@CodexRaunak CodexRaunak force-pushed the feature/scoop-package branch from f2fb6b1 to 18c8fe7 Compare December 29, 2024 13:58
jreleaser.yml Outdated Show resolved Hide resolved
@CodexRaunak CodexRaunak force-pushed the feature/scoop-package branch from 18c8fe7 to d063a8b Compare December 30, 2024 18:46
@jonesbusy jonesbusy marked this pull request as ready for review December 30, 2024 20:17
@jonesbusy jonesbusy changed the title Update jreleaser.yml configuration Support for scoop distribution Dec 30, 2024
@jonesbusy
Copy link
Collaborator

To merged when the repo is provisionned on jenkins-infra

I would also like to test on one bucket https://github.com/jonesbusy/scoop-bucket before

@jonesbusy jonesbusy added the enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Dec 30, 2024
@jonesbusy
Copy link
Collaborator

I've raised jenkins-infra/helpdesk#4468

I've also tested the publish and result of https://github.com/jonesbusy/scoop-bucket/blob/main/bucket/plugin-modernizer.json

Sadly I don't have a Windows environment to test now but I think it's looking pretty neat

My only concern is this part

  "checkver": {
    "url": "https://github.com/jonesbusy/plugin-modernizer-tool/releases/latest",
    "re": "v([\\d.]+).jar"
  },

I don't know if the updates will be detected ? Our versioning scheme like 1098.vd063a_8b_4fcdf will not match this regex

@CodexRaunak Did you test the update ? Do you know if we can customize this regex ?

It should be something like

-([\\d.]+)\\.(.*).jar (untested)

to detect the first part of the version which increment

@CodexRaunak
Copy link
Author

The above regex you mentioned -([\\d.]+)\\.(.*).jar needs a little correction on the \\ part
This \\ is not detecting the version rather single \ is working -([\d.]+)\.(.*).jar fine.

https://regexr.com/ I tested the regex on this tester.
Also we can be bit more specfic than .* like ([\d]+)\.([a-zA-Z0-9_]+)\.jar . These both are working fine but the lower one is more specefic.

Also it will select the - from the URL, so if we don't need the hyphen part just remove it from the regex start.

@CodexRaunak
Copy link
Author

@jonesbusy I have been testing the workflow, but facing an issue, do you have any idea why the CI test is not validating , and resolves to false
image
I believe its because of this line ID=$(gh api -X GET -F check_name="$NAME" -F status=completed /repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs | jq -e '.check_runs | .[] | select(.conclusion == "success") | .id' || echo 'failed') in the run.sh. I am stuck on trouble shooting it.

@jonesbusy
Copy link
Collaborator

The above regex you mentioned -([\\d.]+)\\.(.*).jar needs a little correction on the \\ part This \\ is not detecting the version rather single \ is working -([\d.]+)\.(.*).jar fine.

https://regexr.com/ I tested the regex on this tester. Also we can be bit more specfic than .* like ([\d]+)\.([a-zA-Z0-9_]+)\.jar . These both are working fine but the lower one is more specefic.

Also it will select the - from the URL, so if we don't need the hyphen part just remove it from the regex start.

Thanks!

For the CI is because the workflow check the status on ci.jenkins.io. It will not work on your fork. You can only test some part of the workflow (like jreleaser)

@CodexRaunak
Copy link
Author

Ahh i see, well thanks

@jonesbusy
Copy link
Collaborator

I confirm it work with current setup (Back to work, I can test on Windows)

scoop_update

When we have the bucket on jenkins-infra we can merge and test the CD workflow for and end2end test. But I'm quite confident it work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows distribution via scoop
2 participants