[JENKINS-25982] Fix plugin version not updated when deploying via URL#25983
[JENKINS-25982] Fix plugin version not updated when deploying via URL#25983adityasah104 wants to merge 4 commits intojenkinsci:masterfrom
Conversation
|
You wrote yourself that you've not been able to reproduce the problem. So why this PR? |
|
I couldn’t reproduce the issue locally but while reviewing the code I found a problematic path in where which could lead to the reported error. |
|
Please don't change the indentation unnecessarily. It makes code review more difficult.
Either create an automated test that exercises the problematic path or describe how you reached the problematic path with an interactive test. The pull request template says:
Your description of testing does not seem to indicate that a computer has executed the changed lines. |
|
Thanks for the feedback, I apologize for the unnecessary formatting changes. I'll revert those and keep only the functional changes. This will make the review much cleaner. |
| LOGGER.log(WARNING, "Unable to setup dependency list for plugin upload", e); | ||
| } | ||
| // Extract version from manifest for proper version tracking (JENKINS-25982) | ||
| String pluginVersion = "0"; |
There was a problem hiding this comment.
I still think this is not necessary. There is an explicit comment below stating that the version is not used but mandatory.
| } | ||
|
|
||
| @Test | ||
| @Issue("JENKINS-25982") |
There was a problem hiding this comment.
This test is not really needed I think. In line 101 is already test for parsing the manifest. You could just add there a line for reading the version
|
Right now I don't see a real benefit from this change given the comment that the version is unused. |
|
Thank you for the thorough review, I realize this PR needs more investigation before it's ready. |
Fixes #25982
Testing Done
Manual Testing
Test Environment:
war/target/jenkins.warwith changesTest Steps:
mvn clean install -DskipTestsjava -jar war/target/jenkins.warhttps://updates.jenkins.io/download/plugins/git/5.2.0/git.hpiResults:
Screenshots
Before Fix (Expected):
Plugin would show version "0" or incorrect version
After Fix - Initial Deployment:

After Fix - After Update:

Automated Testing
Added unit test in
PluginManagerTestto verify version extraction logic:extractPluginMetadata()correctly extracts the versionProposed Changelog Entries
Proposed Changelog Category
/label bug
Proposed Upgrade Guidelines
N/A - This is a bug fix with no breaking changes.
Submitter Checklist
@Restrictedor have@since TODOJavadocs, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO"), if applicable.Desired Reviewers
@jenkinsci/core-pr-reviewers
Note: I am new to open source contribution to Jenkins! I've followed the contribution guidelines and I'm open to feedback and suggestions.