-
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
Updates SCM URLs in POM files from git:// to https:// protocol. #560
Conversation
…:// protocol is deprecated by GitHub
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your formatting needs a bit tweaking
Please also check for any errors or failures in the log say at https://github.com/jenkins-infra/plugin-modernizer-tool/pull/560/checks?check_run_id=35070687985 to debug |
Ok sir, Thank you. |
Sorry for not checking them beforehand, I will work on it. Thank you. |
@Override | ||
public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext context) { | ||
tag = super.visitTag(tag, context); | ||
if ("scm".equals(tag.getName())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using lot of level of conditional, we can return directly if the tag is not what we expect.
This would improve readability of the code
if(!"scm".equals(tag.getName()) {
return tag;
}
...-core/src/main/java/io/jenkins/tools/pluginmodernizer/core/visitors/UpdateScmUrlVisitor.java
Outdated
Show resolved
Hide resolved
...izer-core/src/test/java/io/jenkins/tools/pluginmodernizer/core/recipes/UpdateScmUrlTest.java
Show resolved
Hide resolved
Thanks for your PR. Some minor cosmetic, formatting and idioms. Tests also need to be fixed |
...-core/src/main/java/io/jenkins/tools/pluginmodernizer/core/visitors/UpdateScmUrlVisitor.java
Outdated
Show resolved
Hide resolved
…izer-tool into update-scm-url
Probably caused by #565 due to a test still hardcoding bom version (that was released some hours ago https://github.com/jenkinsci/bom/releases/tag/3875.v1df09947cde6) PR need to be rebased when merged on main) |
…izer-tool into update-scm-url
…izer-tool into update-scm-url
…ectly manipulating the connection and scmConnection.
a040608
to
9d88a3f
Compare
Hello sir, |
Can we fix the tests before ?
Most likely invalid pom When it's green we can optimize and cleanup the code. |
I thought previously you meant that these test cases would be enough for now
Ok sir, working on it. |
Yes but tests are failing ? What's the point of having failing tests ? How can we validate the recipe work as expected withtout test ? |
Then could you please guide me on how to fix the tests sir Thank you |
I will not do this investigation for you. Try to take a look at the difference with other tests that perform transformation of the pom.xml and that are working. The only tests that are failing is the 2 that were added I will put this PR is draft until it's green and ready to be reviewed Regards, |
Ok sir, Understood |
Did you read the logs https://github.com/jenkins-infra/plugin-modernizer-tool/pull/560/checks?check_run_id=35114211899 ? The answer is there. |
…izer-tool into update-scm-url
...izer-core/src/test/java/io/jenkins/tools/pluginmodernizer/core/recipes/UpdateScmUrlTest.java
Outdated
Show resolved
Hide resolved
Thank you so much sir. |
Needs further Review
GitHub has deprecated one of the unauthenticated access protocols (git:// protocol). The pom.xml section that defines the scm for the plugin should refer to the repository with the https:// protocol instead of the git:// protocol
Testing done
This pr still needs some additional review.
What i did till now: Added a recipe in recipes.yml
Created UpdatedScmUrl.java, UpdatedScmUrlVisitor.java, UpdatedScmUrlTest.java
Submitter checklist