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
[FIXED JENKINS-22665] Fixes for JENKINS-22665 and JENKINS-19755 #64
Conversation
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
Continuing to extend I think you need to introduce a |
Thanks for your input. I have done some tests and userId is not null in legacy build records when an authenticated user has started the build. When trying to implement a XStream2.PassthruConverter the User will not have an id to use since id is transient. |
OK, if |
Added tests for reading old builds and still get the userId and to verify that UserIdCause it used when triggering new build with the manual trigger. |
@@ -0,0 +1,22 @@ | |||
<?xml version='1.0' encoding='UTF-8'?> |
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.
BTW you seem not to be using this job in the test so I guess it could be omitted.
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.
Good point, removed it.
Is this ok to merge now? |
Merged changes from master |
import hudson.model.FreeStyleBuild; | ||
import hudson.model.ItemGroup; | ||
import hudson.model.TopLevelItem; | ||
import hudson.model.*; |
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.
See no reason for replacing with single line.
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.
Fixed
@patbos see my answer in maillist and please join IRC |
@@ -341,6 +344,18 @@ public void testHasPermission() throws IOException { | |||
assertTrue(testView.hasPermission(Permission.READ)); | |||
} | |||
|
|||
@Test | |||
@LocalData | |||
@Bug(19755) |
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.
@Bug
is deprecated, replace with @Issue
if core version allows it
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.
Core version is to low, does not contain the new annotation.
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.
wow..
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.
Yes, appeared only from test-annotations-1.1 :(
And please reword commit to |
I mean git commit :) Then it will automatically close jira issue after merge :P |
return hashCode() == o.hashCode(); | ||
} | ||
@Deprecated | ||
private static class MyUserIdCause extends Cause.UserIdCause { | ||
|
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.
remove empty line...
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.
Fixed
…not include the whole User object serialized.
Fixed the commit description :) |
👍 |
[FIXED JENKINS-22665] Fixes for JENKINS-22665 and JENKINS-19755
Caused JENKINS-27748 (with some assistance by Xstream). |
Forgive me for digging up this PR, but is the "converter who converts all au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView$MyUserIdCause to hudson.model.Cause$UserIdCause in the build.xmls" implemented? I'm still seeing problems after upgrading from 1.4.3 to 1.4.8 and I'm fairly sure it's caused by this. |
You can't update this crappy deserialized xml as it can't load back at all. Just wrote simple script that will physically remove this section from build.xml. |
Thanks @KostyaSha should I rip the entire "MyUserIdCause" tag? Do you by any chance have a script ready? :) |
@dserodio unfortunately i have no script. I suggested it to one of our customers and they resolved this issue. Afair it should be enough to cut one tag (don't remember, probably triple* something). |
Remove the serialization of the User object within MyUserIdCause. Kept MyUserIdCause for backwards compatibility but is now just a simple subclass of the core class UserIdCause.
This also fixes the JENKINS-19755 "Manual step "started by" username changes to anonymous after restart" since it now can load the correct user who triggered the build.
After upgrading it is possible to "Manage Old Data" to remove User object serialization of MyUserIdCause.