-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix maven repositories http #345
Merged
jonesbusy
merged 12 commits into
jenkins-infra:main
from
gounthar:fix-maven-repositories-http
Oct 18, 2024
Merged
Fix maven repositories http #345
jonesbusy
merged 12 commits into
jenkins-infra:main
from
gounthar:fix-maven-repositories-http
Oct 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes #43 Implement the remediation function for `MAVEN_REPOSITORIES_HTTP` to replace 'http' with 'https' in repository URLs. * Modify `plugin-modernizer-core/src/main/java/io/jenkins/tools/pluginmodernizer/core/model/PreconditionError.java` to include the remediation function that uses `PomModifier` to replace 'http' with 'https' in repository URLs. * Add a method `replaceHttpWithHttps` in `plugin-modernizer-core/src/main/java/io/jenkins/tools/pluginmodernizer/core/utils/PomModifier.java` to replace 'http' with 'https' in repository URLs. * Add tests in `plugin-modernizer-core/src/test/java/io/jenkins/tools/pluginmodernizer/core/extractor/MetadataCollectorTest.java` to verify the functionality of the remediation function for `MAVEN_REPOSITORIES_HTTP`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/gounthar/plugin-modernizer-tool/issues/43?shareId=XXXX-XXXX-XXXX-XXXX).
Fix maven repositories http issue
…fierTest.java Fixes #45 Add a test for the `replaceHttpWithHttps` method in `PomModifierTest.java`. * Add a new test method `testReplaceHttpWithHttps` to test the `replaceHttpWithHttps` method. * Initialize `PomModifier` with `OUTPUT_POM_PATH` in the new test method. * Call `replaceHttpWithHttps` method in the new test method. * Save the modified POM to `OUTPUT_POM_PATH` in the new test method. * Parse the modified POM and assert that all `http` URLs are replaced with `https`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/gounthar/plugin-modernizer-tool/issues/45?shareId=XXXX-XXXX-XXXX-XXXX).
jonesbusy
approved these changes
Oct 18, 2024
jonesbusy
added
the
enhancement
For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted
label
Oct 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Walkthrough
The changes involve updates to the
PreconditionError
enum, specifically enhancing theMAVEN_REPOSITORIES_HTTP
constant with a remediation function that replaces HTTP URLs with HTTPS in the plugin'spom.xml
. A new methodreplaceHttpWithHttps()
has been added to thePomModifier
class to facilitate this. Additionally, theMetadataCollectorTest
class has been modified to include a test for this new functionality, ensuring that HTTP URLs are correctly converted to HTTPS in the POM file.Changes
plugin-modernizer-core/src/main/java/io/jenkins/tools/pluginmodernizer/core/model/PreconditionError.java
MAVEN_REPOSITORIES_HTTP
constant with a remediation function for HTTP to HTTPS conversion.plugin-modernizer-core/src/main/java/io/jenkins/tools/pluginmodernizer/core/utils/PomModifier.java
replaceHttpWithHttps()
method to replace HTTP URLs with HTTPS in XML documents.Assessment against linked issues
Testing done
Submitter checklist