-
Notifications
You must be signed in to change notification settings - Fork 53
More auto-deploy changes. #381
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
Conversation
Codecov Report
@@ Coverage Diff @@
## auto-deploy #381 +/- ##
=================================================
- Coverage 28.94% 28.85% -0.09%
- Complexity 729 734 +5
=================================================
Files 183 184 +1
Lines 9388 9405 +17
Branches 1281 1281
=================================================
- Hits 2717 2714 -3
- Misses 6384 6407 +23
+ Partials 287 284 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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 looks fine to me.
*/ | ||
public static boolean queueDeployJob(DeployJob deployJob) { | ||
String serverId = deployJob.getServerId(); | ||
public static DeployJob queueDeployJob(Deployment deployment, Auth0UserProfile owner, OtpServer server) { |
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.
Seems like this method and the deploymentJobsByServer
might now belong in JobUtils
also?
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.
Refactored in c4d04c7
/** | ||
* Whether to auto-deploy feeds that have critical errors. | ||
*/ | ||
public boolean autoDeployWithCriticalErrors = false; |
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.
Is this a field that we are going to add into the UI or is it just for testing?
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, see ibi-group/datatools-ui#637
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.
Just a couple of minor comments, but this all seems to make sense!
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.
LGTM with some minor comments.
project.pinnedDeploymentId == null || | ||
deployment == null || | ||
deployment.feedVersionIds.isEmpty() || | ||
lockedProjects.contains(project.id) |
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 prefer to have the conditions indented the same, but that may be an IntelliJ thing.
if (latestVersionsWithCriticalErrors.size() > 0) { | ||
StringBuilder errorMessageBuilder = new StringBuilder( | ||
String.format("Auto deployment skipped for project %s! %s feed(s) contain critical errors:", | ||
String.format("Auto deployment for project %s! %s feed(s) contain critical errors:", |
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.
Why was 'skipped' removed? The resulting text is an incomplete sentence.
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.
The deployment is now not always skipped if there are feeds with critical errors if the autoDeployWithCriticalErrors
is set to true. Incomplete sentence fixed in c4d04c7
// newer feed versions exist! Start a new auto-deploy job. | ||
JobUtils.heavyExecutor.execute(new AutoDeployJob(deployment.parentProject(), owner)); | ||
} else { | ||
LOG.info("No need to start another auto-deployment"); |
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 am tempted to say the log should be when we start another auto-deployment.
@br648 I'm assigning this back to you because this PR is against #361 that you created. You can coordinate any changes needed with @evansiroky prior to merging. |
Checklist
dev
before they can be merged tomaster
)Description
A few more changes so that auto-deployment works somewhat smoothly in practice. And a refactor to consolidate a bunch of job-related logic into its own util file.
active
field into MonitorableJob to correctly identify active jobs even when jobs are recurring or not yet started.active
field.autoDeployWithCriticalErrors
to Project and update AutoDeployJob to use this field accordingly