Conversation
|
Jenkins » perforce-plugin #95 FAILURE |
|
Jenkins » perforce-plugin #96 FAILURE |
|
Jenkins » perforce-plugin #97 FAILURE |
|
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
|
Was the change to the core version necessary? I'd like to maintain backwards compatibility with Hudson if possible. |
|
Also, shouldn't the DepotType class be in the same package as the rest of the plugin? |
|
Hello Robert, Actual state of the PR is here: https://issues.jenkins-ci.org/browse/JENKINS-18583 At current state, PR allows to run only one p4 instance with other SCMs. I haven't finished implementation of any-case solution yet, so we can't merge this request to the incoming version. So, please consider PR as a review request. Regarding your question:
Probably, I shouldn't create PRs with unfinished functionality in future. |
|
Probably, we could use "in-progress" milestone to differentiate statuses of the pull-requests |
|
Sounds good, thanks! |
|
Jenkins » perforce-plugin #101 FAILURE |
|
Hello, Finally, hack for the radioBlock groups was obvious. Now perforce plugin works well in the Multiple SCMs wrapper. BR, Oleg Nenashev |
pom.xml
Outdated
|
Getting a few failed tests after reverting the pom changes. Round trip config tests are failing with Which seems to relate to retrieving the p4.depotType parameter in the newInstance method. Since the config.xml has been changed to use ${instanceID}.depotType, shouldn't that be changed in newInstance as well? The same will probably need to be done with all the variables used in newInstance, as I believe this problem extends beyond the depotType field. |
|
Jenkins » perforce-plugin #103 FAILURE |
|
-- Round trip config tests are failing with NPE -- The same will probably need to be done with all the variables used in newInstance, as I believe this problem extends beyond the depotType field |
|
The reason these fields use the newInstance method of configuration is because they don't work in the databound constructor. These fields are hidden in optional blocks, and thus not always available to stapler. If a configuration is posted to the databound constructor with missing fields, an exception is thrown back into the user's face and the config is not saved. I suppose there might be a way to use separate classes for these optional configuration sections with their own databound constructors and configs, but I haven't investigated that possibility. |
|
I've evaluated possible approaches with indexing instead of p4 prefixes. BTW, every change leads to ugly code. |
|
Jenkins » perforce-plugin #114 FAILURE |
|
Jenkins » perforce-plugin #115 FAILURE |
|
Jenkins » perforce-plugin #116 FAILURE |
|
Robert, I've implemented draft implementation, which does not utilize newInstance() hack. I propose to corrupt PerforceSCM's interface and remove setter methods to reduce code size. AFAIK, these methods aren't used outside Perforce plugin. Anyway, external usage is not secure, because setters don't invoke save() ... |
|
Setters are used by some other plugins, so I don't believe they should be removed. I'll need to take a closer look at your implementation, since I was fairly certain that stapler would fail if you were missing a field (as would be the case with the optional arguments). I'm curious to see how you got around this! Can you please explain what you mean by "propose to corrupt PerforceSCM's interface"? That sounds like a bad thing to do... We need to maintain backwards compatibility, and provide seamless upgrades. |
This statement is related to setters only. If there is no external However, we have no choice if setters are being used by external plugins. 2013/10/3 Rob Petti notifications@github.com
|
|
In the latest changes I've corrupted the initial RadioButtons patch. :( |
|
plugins » perforce-plugin #52 UNSTABLE |
|
plugins » perforce-plugin #60 FAILURE |
|
Seems I've forgot about this PR :( |
|
I thought this was still incomplete? At least that's what it looks like. The use of DepotType is confusing to me... It seems to contain fields for all 3 different depot types, rather than splitting it out into different implementations of DepotType (ie, StreamDepotType, ClientFileDepotType, ViewDepotType). There's also no config.jelly to be found for configuring DepotType objects, so I'm not sure how this should be working without running into the missing field exceptions I described earlier. Finally, the PerforceSCM config.jelly doesn't seem to be using these new objects at all, so if you could save the config without immediately getting an exception, the fields still wouldn't be getting saved. |
|
Rob, the current implementation aims the initial structure of plugin data to avoid readResolve() and other such stuff till the refactoring of Perforce plugin. So the change just relies on Jenkins core, which constructs classes using JSON data bounding. All data will be saved to initial fields of PerforceSCM classes, so there should not be any data conflicts. I use the change for several months without any issues on restart. |
|
So what is the purpose of DepotType if it's not being used by the configuration? That's probably a better question. I don't see how configuration would work at all with the code being the way it is. You cannot have missing fields without databinding to an instanced subclass that has different fields (such as what is being done with the Browsers), but that appears to be exactly what is happening here. |
|
newInstance()
load():
So the approach should work properly. BTW, I agree that fields should be moved to proposed classes during the refactoring |
|
DepotType doesn't have a config.jelly, and PerforceSCM's jelly isn't using DepotType, so I don't see how this could work as it is currently. |
|
I still do not see how this code would work.
Am I mistaken? |
In 1.480.x and 1.509.x this code works properly without any exceptions. It also allows to avoid newInstance() issues in 1.536+ |
It seems that I don't have a good handle on this, so I'd say just proceed in whatever way you see fit. |
|
Any optional block creates a new hierarchy level in JSON data, so you cannot handle its data without creating of nested structures like DepotType. On the other hand, bindJSON() just parses input JSON tree and does not care about initial jelly files at all. BTW, there's a one significant exception: non-nullable fields (integer, boolean, etc.). These fields must present in input JSON if your constructor declares them in parameters. Probably, you've had problems due to such types. |
|
Ok. If you want to resolve the conflicts and merge it, then I'd say go right ahead. I tested it separately, and it seems to work fine. On the multiple-scms front, I think there might be an issue with the PerforceTagAction, since there's only one per build and you could conceivably have multiple changesets and servers to tag in a single build when using multi-scm. The email resolver will probably stop working as well, since it looks for projects that use PerforceSCM directly, not ones nested in multiple-scms. |
This change removes need in newInstance() handler and also provides classes for future refactoring. In addition, the change adds instance IDs to config.jelly, therefore there won't be conflicts between radioButtons(). Resolves https://issues.jenkins-ci.org/browse/JENKINS-18583 Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>
|
plugins » perforce-plugin #70 FAILURE |
Conflicts: src/main/java/hudson/plugins/perforce/PerforceSCM.java Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>
|
plugins » perforce-plugin #72 SUCCESS |
|
@rpetti I've also merged previous commits into one to simplify analysis in future. |
[IN_PROGRESS][JENKINS-18583] - Fixed PerforceSCM instatination forn Multiple SCMs
|
@rpetti |
|
Sorry, I've been on vacation, and my workstation was recently wiped. I'll
|
Hello Robert,
Just for review…
Proposed fix resolves issue with instantiation of Perforce plugin in the MultipleSCM’s hetero list (JENKINS-18583). Issue was in the incomplete handling of data in the DataBoundConstructor.
If fix is applicable, I’ll fix tests and remove test stuff from the *.pom. Then, we will be able to merge pull request.
Best regards,
Oleg Nenashev
R&D Engineer, Synopsys Inc.
www.synopsys.com