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

Add support for file:// protocol in plugin URI #399

Merged
merged 5 commits into from
Dec 30, 2021

Conversation

gcuisinier
Copy link
Contributor

Allow to install plugin from local folder with the file:// format, linked to #365

  • 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

Refactored the PluginManager.downloadToFile function to add condition on the URL format to manage HTTPs/HTTP and file protocol.
Extract the current http fetch into a dedicated internal function.

Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

Looks fine just needs checkstyle issues sorted

@timja timja added the enhancement New feature or request label Dec 29, 2021
@gcuisinier
Copy link
Contributor Author

👍
I've to check where I can find the detail of checkstyle issue to fix them

@timja
Copy link
Member

timja commented Dec 29, 2021

https://ci.jenkins.io/job/Tools/job/plugin-installation-manager-tool/job/PR-399/2/checkstyle/

@timja timja merged commit d5e90c1 into jenkinsci:master Dec 30, 2021
@timja
Copy link
Member

timja commented Dec 30, 2021

This failed when releasing with two spotbugs errors, not sure why it didn't show up initially, are you able to take a look?
https://github.com/jenkinsci/plugin-installation-manager-tool/runs/4665728379

@gcuisinier
Copy link
Contributor Author

Sure! I will check

@gcuisinier
Copy link
Contributor Author

Both issue are complaint about the fact that we are trying to use a URL ( http or file ) that's created from an user parameter... and so unsafe.

But for the first (http), it was already present, but in another function (as I just extracted the code to a new function).
For the second, it's about the usage of File from the input param also.

For me there are both false positive, as that's the expected behaviour no?

@timja
Copy link
Member

timja commented Dec 31, 2021

yes you can create a PR to suppress it then

@gcuisinier
Copy link
Contributor Author

Done here : #400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants