Skip to content
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

Remove streaming job operator service (part 1) #81

Merged
merged 6 commits into from
May 22, 2024

Conversation

s-vitaliy
Copy link
Contributor

@s-vitaliy s-vitaliy commented May 22, 2024

Part of #47

This PR focused on moving code from old services to new command handlers.

Scope

Implemented:

  1. From the StreamingJobOperatorService removed the following methods:
  • StartRegisteredStream
  • RequestStreamingJobRestart
  • RequestStreamingJobReload
  • DeleteJob
  1. Added the SetAnnotationCommand<V1Job> command handler to StreamingJobCommandHandler
  2. Method StartRegisteredStream was moved to StreamingJobCommandHandler and renamed to StartStream
  3. Test classes updated accordingly.

Checklist

  • GitHub issue exists for this change.
  • Unit tests added and they pass.
  • Line Coverage is at least 80%.
  • Review requested on latest commit.

Copy link

Coverage after merging remove-streaming-job-operator-service into main will be

73.53%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src/Configurations
   MetricsPublisherActorConfiguration.cs100%100%100%100%
   MetricsReporterConfiguration.cs100%100%100%100%
src/Extensions
   JsonElementExtensions.cs0%100%0%0%22, 30
   KubernetesObjectExtensions.cs0%100%0%0%15–18
   V1JobExtensions.cs82.24%63.64%94.12%89.01%105, 105, 126, 126, 131, 136, 136, 141, 146, 146, 151, 53, 53, 58, 68, 68, 75, 83–84, 84, 84, 84, 84–87
src/Models
   StreamingClassOperatorResponse.cs100%100%100%100%
src/Models/StreamClass
   V1Beta1StreamClassSpec.cs71.43%100%71.43%71.43%12, 50
src/Models/StreamDefinitions/Base
   IStreamDefinition.cs90%83.33%100%100%29
src/Models/StreamStatuses/StreamStatus/V1Beta1
   V1Beta1StreamStatus.cs100%100%100%100%
src/Services/Base
   ICommandHandler.cs100%100%100%100%
src/Services/CommandHandlers
   AnnotationCommandHandler.cs68.75%66.67%75%68.52%37–40, 52–55, 62–65, 72–78
   StreamingJobCommandHandler.cs84.62%83.33%100%83.33%35, 45, 54–57
   UpdateStatusCommandHandler.cs90.91%75%100%91.18%100, 43–46, 82, 99
src/Services/Commands
   StreamClassCommands.cs100%100%100%100%
   StreamDefinitionCommands.cs100%100%100%100%
   StreamingJobCommands.cs100%100%100%100%
src/Services/Maintenance
   HostedStreamingJobMaintenanceService.cs0%0%0%0%16–24, 27–29, 29, 29–36, 39–42
   StreamingJobMaintenanceService.cs91.53%85.71%100%92.86%116–120, 125, 129, 134, 75, 79
src/Services/Metrics
   DeclaredMetrics.cs47.06%0%75%65%32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32–38
   MetricsReporter.cs100%100%100%100%
src/Services/Metrics/Actors
   MetricsPublisherActor.cs100%100%100%100%
src/Services/Models
   CustomResourceApiRequest.cs100%100%100%100%
   ResourceEvent.cs100%100%100%100%
src/Services/Operator
   StreamClassOperatorService.cs80.56%50%83.33%84.48%100, 100, 100–105, 77, 77, 81, 98–99
   StreamOperatorService.cs80.98%68.97%90.91%85.29%100, 140–141, 141, 141, 143–144, 153–154, 164–165, 180, 182, 186, 186, 192, 194, 65–66, 66, 66–67, 80–81, 81, 81, 81, 81, 81, 81–84, 86, 96–99
src/Services/Repositories
   StreamClassRepository.cs100%100%100%100%
   StreamDefinitionRepository.cs0%100%0%0%19–22, 27–34, 38–43
   StreamingJobTemplateRepository.cs0%0%0%0%20–27, 31–33, 33, 33, 33, 33, 33, 33, 33, 33–36, 39–47
src/Services/Streams
   StreamingJobOperatorService.cs0%0%0%0%101–104, 27–37, 40, 43–50, 54–60, 60, 60–81, 81, 81, 81, 81–84, 84, 84–98

Copy link

Coverage after merging remove-streaming-job-operator-service into main will be

77.16%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src/Configurations
   MetricsPublisherActorConfiguration.cs100%100%100%100%
   MetricsReporterConfiguration.cs100%100%100%100%
src/Extensions
   JsonElementExtensions.cs0%100%0%0%22, 30
   KubernetesObjectExtensions.cs0%100%0%0%15–18
   V1JobExtensions.cs82.24%63.64%94.12%89.01%105, 105, 126, 126, 131, 136, 136, 141, 146, 146, 151, 53, 53, 58, 68, 68, 75, 83–84, 84, 84, 84, 84–87
src/Models
   StreamingClassOperatorResponse.cs100%100%100%100%
src/Models/StreamClass
   V1Beta1StreamClassSpec.cs85.71%100%85.71%85.71%12
src/Models/StreamDefinitions/Base
   IStreamDefinition.cs90%83.33%100%100%29
src/Models/StreamStatuses/StreamStatus/V1Beta1
   V1Beta1StreamStatus.cs100%100%100%100%
src/Services/Base
   ICommandHandler.cs100%100%100%100%
src/Services/CommandHandlers
   AnnotationCommandHandler.cs68.75%66.67%75%68.52%37–40, 52–55, 62–65, 72–78
   StreamingJobCommandHandler.cs81.25%78.57%100%80.77%109–111, 44, 48, 51, 54, 63–66, 77–83
   UpdateStatusCommandHandler.cs90.91%75%100%91.18%100, 43–46, 82, 99
src/Services/Commands
   StreamClassCommands.cs100%100%100%100%
   StreamDefinitionCommands.cs100%100%100%100%
   StreamingJobCommands.cs66.67%100%75%62.50%39–41
src/Services/Maintenance
   HostedStreamingJobMaintenanceService.cs0%0%0%0%16–24, 27–29, 29, 29–36, 39–42
   StreamingJobMaintenanceService.cs91.53%85.71%100%92.86%116–120, 125, 129, 134, 75, 79
src/Services/Metrics
   DeclaredMetrics.cs47.06%0%75%65%32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32–38
   MetricsReporter.cs100%100%100%100%
src/Services/Metrics/Actors
   MetricsPublisherActor.cs100%100%100%100%
src/Services/Models
   CustomResourceApiRequest.cs100%100%100%100%
   ResourceEvent.cs100%100%100%100%
src/Services/Operator
   StreamClassOperatorService.cs80.56%50%83.33%84.48%100, 100, 100–105, 77, 77, 81, 98–99
   StreamOperatorService.cs76.59%65.52%90.91%80.15%100, 140–141, 141, 141, 143–144, 153–154, 164–165, 173–180, 182, 186, 186, 186, 191–192, 194, 65–66, 66, 66–67, 80–81, 81, 81, 81, 81, 81, 81–84, 86, 96–99
src/Services/Repositories
   StreamClassRepository.cs92.86%50%100%95.45%30, 32
   StreamDefinitionRepository.cs0%100%0%0%19–22, 27–34, 38–43
   StreamingJobTemplateRepository.cs0%0%0%0%20–27, 31–33, 33, 33, 33, 33, 33, 33, 33, 33–36, 39–47
src/Services/Streams
   StreamingJobOperatorService.cs0%100%0%0%20–28, 31, 34–41

@s-vitaliy s-vitaliy changed the title Remove streaming job operator service Remove streaming job operator service (part 1) May 22, 2024
@s-vitaliy s-vitaliy marked this pull request as ready for review May 22, 2024 12:46
@s-vitaliy s-vitaliy requested a review from a team as a code owner May 22, 2024 12:46
Copy link

Coverage after merging remove-streaming-job-operator-service into main will be

78.37%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src/Configurations
   MetricsPublisherActorConfiguration.cs100%100%100%100%
   MetricsReporterConfiguration.cs100%100%100%100%
src/Extensions
   JsonElementExtensions.cs0%100%0%0%22, 30
   KubernetesObjectExtensions.cs0%100%0%0%15–18
   V1JobExtensions.cs82.24%63.64%94.12%89.01%105, 105, 126, 126, 131, 136, 136, 141, 146, 146, 151, 53, 53, 58, 68, 68, 75, 83–84, 84, 84, 84, 84–87
src/Models
   StreamingClassOperatorResponse.cs100%100%100%100%
src/Models/StreamClass
   V1Beta1StreamClassSpec.cs85.71%100%85.71%85.71%12
src/Models/StreamDefinitions/Base
   IStreamDefinition.cs90%83.33%100%100%29
src/Models/StreamStatuses/StreamStatus/V1Beta1
   V1Beta1StreamStatus.cs100%100%100%100%
src/Services/Base
   ICommandHandler.cs100%100%100%100%
src/Services/CommandHandlers
   AnnotationCommandHandler.cs68.75%66.67%75%68.52%37–40, 52–55, 62–65, 72–78
   StreamingJobCommandHandler.cs81.25%78.57%100%80.77%109–111, 44, 48, 51, 54, 63–66, 77–83
   UpdateStatusCommandHandler.cs90.91%75%100%91.18%100, 43–46, 82, 99
src/Services/Commands
   StreamClassCommands.cs100%100%100%100%
   StreamDefinitionCommands.cs100%100%100%100%
   StreamingJobCommands.cs100%100%100%100%
src/Services/Maintenance
   HostedStreamingJobMaintenanceService.cs0%0%0%0%16–24, 27–29, 29, 29–36, 39–42
   StreamingJobMaintenanceService.cs91.53%85.71%100%92.86%116–120, 125, 129, 134, 75, 79
src/Services/Metrics
   DeclaredMetrics.cs47.06%0%75%65%32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32–38
   MetricsReporter.cs100%100%100%100%
src/Services/Metrics/Actors
   MetricsPublisherActor.cs100%100%100%100%
src/Services/Models
   CustomResourceApiRequest.cs100%100%100%100%
   ResourceEvent.cs100%100%100%100%
src/Services/Operator
   StreamClassOperatorService.cs80.56%50%83.33%84.48%100, 100, 100–105, 77, 77, 81, 98–99
   StreamOperatorService.cs80.98%68.97%90.91%85.29%100, 140–141, 141, 141, 143–144, 153–154, 164–165, 180, 182, 186, 186, 192, 194, 65–66, 66, 66–67, 80–81, 81, 81, 81, 81, 81, 81–84, 86, 96–99
src/Services/Repositories
   StreamClassRepository.cs92.86%50%100%95.45%30, 32
   StreamDefinitionRepository.cs0%100%0%0%19–22, 27–34, 38–43
   StreamingJobTemplateRepository.cs0%0%0%0%20–27, 31–33, 33, 33, 33, 33, 33, 33, 33, 33–36, 39–47
src/Services/Streams
   StreamingJobOperatorService.cs0%100%0%0%20–28, 31, 34–41

@s-vitaliy s-vitaliy merged commit 022dcfb into main May 22, 2024
2 checks passed
@s-vitaliy s-vitaliy deleted the remove-streaming-job-operator-service branch May 22, 2024 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants