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-28843] Stored the unique value in the job configuration #1
Conversation
*/ | ||
public abstract void make(T object); | ||
public abstract void make(T object) throws Exception; |
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.
It causes a binary compatibility issue, but I doubt anybody uses the plugin's API actively. Let's bump the major version digit BTW
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 - but the alternative is to make this return a boolean
and have callers check.
Neither are good in my opinion - I could change this to be IOException
(but that is specific to our implementation )
I'm working on the failing test |
if (jenkins == null) { | ||
throw new IllegalStateException("Jenkins is null, so it is impossible to migrate the IDs"); | ||
} | ||
File marker = new File(jenkins.getRootDir(), "IdStoreMigration.txt"); |
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.
could we use a name that makes it clear what plugin the file is for, e.g. unique-id-migration.txt
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.
Perhaps make this a hidden file i.e. named something like .IdStoreMigrationCompleted
.
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.
will change. I'm not convinced about hiding the file so will go with @stephenc's suggestion
otherwise looks ok from a code review PoV |
*/ | ||
public static String getId(Object object) { | ||
public static String getId(Object object) throws IllegalArgumentException, Exception { |
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.
I think a fallback to a legacy store is required here (as I've understood initial test suites)
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.
No - there should be no fallback at all.
The legacy store must be migrated at first run and then removed if it exists.
Are the binary compatibility changes here not a bit risky? Even the fact that there's no longer an Maybe I don't understand the problem fully but would it not be possible to leave all the |
There's no funky Jenkins way for an |
Added jtnord#1 for post-restart migrations. It also fixes the failing |
Change the filenames so that they are more easily identified with this plugin. Fix some typos.
So there's no possibility of a post copy/replicate task extension point? Seems like a general thing that would make sense. If there was, maybe a |
after discussion with the plugin maintainer it has been decided to perform migration of IDs for Runs after startup to not block startup for so long. Also Runs do not need special handling and can use the same text marker as jobs/folders. |
import org.jenkinsci.plugins.uniqueid.IdStore; | ||
|
||
/** | ||
* Stores id's for runs as an action on the Run. |
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.
This Javadoc is obsolete I guess.
Use standardCharset to avoid UTF-8 related issues.
@jtnord I raised some questions/points that were not answered/addressed. Maybe that's coz they were considered to be stupid, but maybe they should be answered in some way (even if they're called out as being stupid questions 😄 ). |
@tfennelly sorry I thought I had addressed or replied to them all.
The internal implementation can filter out files - so it would just filter out these files. |
// all done... | ||
final long duration = System.currentTimeMillis() - startTime; | ||
final long minutes = TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis() - startTime); | ||
final long seconds = TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis() - startTime - TimeUnit.HOURS.toMillis(minutes)); |
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.
Should be TimeUnit.MILLISECONDS.toSeconds()
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.
TimeUnit.MINUTES at the end?
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 - good spot.
👍 |
1 similar comment
👍 |
[FIXED JENKINS-28843] No longer stored the unique value in the items configuration.
</scm> | ||
|
||
<properties> | ||
<maven.compiler.source>1.7</maven.compiler.source> | ||
<maven.compiler.target>1.7</maven.compiler.target> |
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.
May also want to change the Animal Sniffer execution.
Apparently even the current plugin POM does not define java.level
like Jenkins core itself does. Something to be fixed in a future version of the POM.
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.
it's currently working. I'll leave that to someone for a future excesize (along with using a recent core)
A bit late to the party but: 👍, with some low-importance comments that could be addressed later. |
Tweak logging levels andload actions to force lazy loading.
JENKINS-28843
unique id plugin stored the unique value in the job configuration.
@reviewbybees