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

Process Plugins in the Order Defined in plugins.txt #110

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

sridamul
Copy link
Contributor

Closes #105
If both -f and -p options are enabled, then the plugins are processed in the order of plugin file first, followed by the plugins passed through -p option.
For Eg:
plugins.txt

git
git-client:1.0.0
jobcacher:2.3.4

java -jar /path/to/jar --plugins login-theme,jobcacher -f path/to/plugin/file --recipes AddPluginsBom -n
would process in order of git, git-client, jobcacher, login-theme

Testing done

Unit tests

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

@sridamul sridamul requested a review from a team as a code owner July 18, 2024 15:27
Copy link
Collaborator

@gounthar gounthar left a comment

Choose a reason for hiding this comment

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

I tried it in GitPod with a plugins.txt file, and it worked.
Thanks! 🚀

@gounthar gounthar merged commit 005f45d into jenkins-infra:main Jul 18, 2024
13 checks passed
@sridamul sridamul deleted the retain-plugin-order branch July 18, 2024 16:20
@@ -123,7 +124,8 @@ private List<String> loadPlugins() {
loadedPlugins.addAll(plugins);
}

return new ArrayList<>(new HashSet<>(loadedPlugins));
Set<String> uniquePlugins = new LinkedHashSet<>(loadedPlugins);
Copy link
Collaborator

Choose a reason for hiding this comment

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

More idiomatic way could be

return loadedPlugins.stream().distinct().collect(Collectors.toCollection(ArrayList::new));

@jonesbusy jonesbusy added the enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Jul 19, 2024
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.

Process Plugins in the Order Defined in plugins.txt
3 participants