feat: add precise pre-deployment workflow readiness checks#923
feat: add precise pre-deployment workflow readiness checks#923mertilginoglu wants to merge 1 commit intostagingfrom
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
| String branch, String headSha, Long repositoryId); | ||
|
|
||
| Optional<WorkflowRun> | ||
| findFirstByWorkflow_IdAndRepository_RepositoryIdAndHeadBranchAndHeadShaOrderByCreatedAtDesc( |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Method name 'findFirstByWorkflow_IdAndRepository_RepositoryIdAndHeadBranchAndHeadShaOrderByCreatedAtDesc' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
|
|
||
| Workflow deploymentWorkflow = environment.getDeploymentWorkflow(); | ||
| if (deploymentWorkflow != null) { | ||
| Set<Long> requiredWorkflowIds = workflows.stream().map(Workflow::getId).collect(Collectors.toSet()); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 100 characters (found 106).
| Environment environment = | ||
| environmentRepository | ||
| .findById(environmentId) | ||
| .orElseThrow(() -> new EntityNotFoundException("Environment not found with ID: " + environmentId)); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 100 characters (found 111).
| .toList(); | ||
|
|
||
| boolean hasFailed = workflowStatuses.stream() | ||
| .anyMatch(status -> status.status() == EnvironmentDeploymentReadinessDto.WorkflowStatus.FAILED); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 100 characters (found 104).
| boolean hasFailed = workflowStatuses.stream() | ||
| .anyMatch(status -> status.status() == EnvironmentDeploymentReadinessDto.WorkflowStatus.FAILED); | ||
| boolean hasWaiting = workflowStatuses.stream() | ||
| .anyMatch(status -> status.status() == EnvironmentDeploymentReadinessDto.WorkflowStatus.WAITING); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 100 characters (found 105).
| import jakarta.persistence.JoinColumn; | ||
| import jakarta.persistence.JoinTable; | ||
| import jakarta.persistence.ManyToOne; | ||
| import jakarta.persistence.ManyToMany; |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck> reported by reviewdog 🐶
Wrong lexicographical order for 'jakarta.persistence.ManyToMany' import. Should be before 'jakarta.persistence.ManyToOne'.
| Exception exception = | ||
| assertThrows( | ||
| EnvironmentException.class, | ||
| () -> environmentService.updateEnvironment(1L, EnvironmentDto.fromEnvironment(environment))); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 100 characters (found 105).
| when(environmentRepository.findById(1L)).thenReturn(Optional.of(environment)); | ||
| when( | ||
| workflowRunRepository | ||
| .findFirstByWorkflow_IdAndRepository_RepositoryIdAndHeadBranchAndHeadShaOrderByCreatedAtDesc( |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 100 characters (found 109).
| when(environmentRepository.findById(1L)).thenReturn(Optional.of(environment)); | ||
| when( | ||
| workflowRunRepository | ||
| .findFirstByWorkflow_IdAndRepository_RepositoryIdAndHeadBranchAndHeadShaOrderByCreatedAtDesc( |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 100 characters (found 109).
| when(environmentRepository.findById(1L)).thenReturn(Optional.of(environment)); | ||
| when( | ||
| workflowRunRepository | ||
| .findFirstByWorkflow_IdAndRepository_RepositoryIdAndHeadBranchAndHeadShaOrderByCreatedAtDesc( |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 100 characters (found 109).
Motivation
Description
Testing Instructions
Prerequisites:
Flow:
Screenshots
Checklist
General
Server
Client