[BEAM-2963] Preliminary refactors to PackageUtil#3920
Conversation
|
R: @tgroh since I know you are looking at artifact-related things. This may or may not actually be interesting to you. It is probably easiest to review one commit at a time. |
4b30b9c to
2eb6794
Compare
|
The tests all passed, then timeout occurred while building Python. I've bumped the timeout and will retest, but FYI this is g2g. |
|
run precommit pipeline java |
|
retest this please |
| } | ||
| } | ||
|
|
||
| private StagingResult stagePackageBlithely( |
There was a problem hiding this comment.
While I really really like this name, I fear that it doesn't communicate what it does sufficiently precisely, given standard java jargon
| throw e; | ||
| } else { | ||
| LOG.warn( | ||
| "Upload attempt failed, sleeping before retrying staging of classpath: {}", |
| } | ||
| })); | ||
| for (String classpathElement : classpathElements) { | ||
| DataflowPackage sourcePackage = new DataflowPackage(); |
There was a problem hiding this comment.
Is the creation + value migration worth factoring into its own method?
| } | ||
| } | ||
|
|
||
| private StagingResult stagePackageBlithely( |
There was a problem hiding this comment.
While I really like this name, I don't think it communicates why this is so blithe in standard java Jargon.
There was a problem hiding this comment.
Suggestions? I settled on this suffix some while ago for lack of a better option.
| throw e; | ||
| } else { | ||
| LOG.warn( | ||
| "Upload attempt failed, sleeping before retrying staging of classpath: {}", |
There was a problem hiding this comment.
tgroh wrote:
'staging of package'
Done.
| } | ||
| })); | ||
| for (String classpathElement : classpathElements) { | ||
| DataflowPackage sourcePackage = new DataflowPackage(); |
There was a problem hiding this comment.
tgroh wrote:
Is the creation + value migration worth factoring into its own method?
TBH this should be moved out to the command line parsing. It has no place here. For now I'd rather leave it as-is (this bit is a code move)
| } | ||
| } | ||
|
|
||
| private StagingResult stagePackageBlithely( |
There was a problem hiding this comment.
kennknowles wrote:
"Crashily"?
Done. Split into tryStagePackage which is trivial straight-line code, tryStagePackageWithRetries that does just that loop, crashing if it hits something unrecoverable, and stagePackageSynchronously that just decorates the error message.
|
run dataflow validatesrunner |
|
We've seen a couple jobs run, since the basic presubmit does that, but I'll wait to see a lot of jobs run, since if this breaks it is very bad. |
|
All the jobs in the |
f630545 to
58b6453
Compare
Follow this checklist to help us incorporate your contribution quickly and easily:
[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue.mvn clean verifyto make sure basic checks pass. A more thorough check will be performed on your pull request automatically.These are some basic refactors to give
PackageUtila little TLC, making it more usable and re-usable.