tasker-engine 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/app/controllers/tasker/analytics_controller.rb +2 -2
- data/app/controllers/tasker/graphql_controller.rb +3 -3
- data/app/controllers/tasker/health_controller.rb +1 -1
- data/app/controllers/tasker/metrics_controller.rb +3 -3
- data/app/jobs/tasker/metrics_export_job.rb +1 -1
- data/app/models/tasker/application_record.rb +5 -5
- data/app/models/tasker/task.rb +1 -1
- data/db/functions/get_step_readiness_status_single_and_batch_v02.sql +2 -2
- data/docs/AUTH.md +11 -11
- data/docs/DEVELOPER_GUIDE.md +6 -6
- data/docs/EXECUTION_CONFIGURATION.md +1 -1
- data/docs/HEALTH.md +3 -3
- data/docs/METRICS.md +4 -4
- data/docs/OPTIMIZATION_PLAN.md +3 -3
- data/docs/QUICK_START.md +1 -1
- data/docs/REST_API.md +1 -1
- data/docs/TELEMETRY.md +5 -5
- data/docs/TROUBLESHOOTING.md +2 -2
- data/docs/TaskHandlerGenerator.html +55 -55
- data/docs/Tasker/Analysis/RuntimeGraphAnalyzer.html +1 -1
- data/docs/Tasker/Analysis/TemplateGraphAnalyzer.html +1 -1
- data/docs/Tasker/Analysis.html +1 -1
- data/docs/Tasker/AnalyticsController.html +1 -1
- data/docs/Tasker/AnalyticsService/BottleneckAnalytics.html +1 -1
- data/docs/Tasker/AnalyticsService/PerformanceAnalytics.html +1 -1
- data/docs/Tasker/AnalyticsService.html +1 -1
- data/docs/Tasker/AnnotationType.html +1 -1
- data/docs/Tasker/AnnotationTypeSerializer.html +1 -1
- data/docs/Tasker/ApplicationController.html +1 -1
- data/docs/Tasker/ApplicationJob.html +1 -1
- data/docs/Tasker/ApplicationRecord.html +6 -6
- data/docs/Tasker/Authentication/AuthenticationError.html +1 -1
- data/docs/Tasker/Authentication/ConfigurationError.html +1 -1
- data/docs/Tasker/Authentication/Coordinator.html +1 -1
- data/docs/Tasker/Authentication/Interface.html +1 -1
- data/docs/Tasker/Authentication/InterfaceError.html +1 -1
- data/docs/Tasker/Authentication/NoneAuthenticator.html +1 -1
- data/docs/Tasker/Authentication.html +1 -1
- data/docs/Tasker/Authorization/AuthorizationError.html +1 -1
- data/docs/Tasker/Authorization/BaseCoordinator.html +2 -2
- data/docs/Tasker/Authorization/ConfigurationError.html +1 -1
- data/docs/Tasker/Authorization/ResourceConstants/ACTIONS.html +1 -1
- data/docs/Tasker/Authorization/ResourceConstants/RESOURCES.html +1 -1
- data/docs/Tasker/Authorization/ResourceConstants.html +1 -1
- data/docs/Tasker/Authorization/ResourceRegistry.html +1 -1
- data/docs/Tasker/Authorization/UnauthorizedError.html +1 -1
- data/docs/Tasker/Authorization.html +2 -2
- data/docs/Tasker/CacheCapabilities.html +1 -1
- data/docs/Tasker/CacheStrategy.html +1 -1
- data/docs/Tasker/Concerns/Authenticatable.html +1 -1
- data/docs/Tasker/Concerns/Authorizable/AdminStatusChecker.html +1 -1
- data/docs/Tasker/Concerns/Authorizable.html +1 -1
- data/docs/Tasker/Concerns/ControllerAuthorizable.html +1 -1
- data/docs/Tasker/Concerns/EventPublisher.html +1 -1
- data/docs/Tasker/Concerns/IdempotentStateTransitions.html +1 -1
- data/docs/Tasker/Concerns/StateMachineBase/ClassMethods.html +1 -1
- data/docs/Tasker/Concerns/StateMachineBase/StateMachineBase/ClassMethods.html +1 -1
- data/docs/Tasker/Concerns/StateMachineBase/StateMachineBase.html +1 -1
- data/docs/Tasker/Concerns/StateMachineBase.html +1 -1
- data/docs/Tasker/Concerns/StructuredLogging.html +1 -1
- data/docs/Tasker/Concerns.html +1 -1
- data/docs/Tasker/Configuration/ConfigurationProxy.html +1 -1
- data/docs/Tasker/Configuration/TelemetryConfigurationProxy.html +1 -1
- data/docs/Tasker/Configuration.html +1 -1
- data/docs/Tasker/ConfigurationError.html +1 -1
- data/docs/Tasker/ConfiguredTask.html +2 -2
- data/docs/Tasker/Constants/EventDefinitions.html +1 -1
- data/docs/Tasker/Constants/ObservabilityEvents/Step.html +1 -1
- data/docs/Tasker/Constants/ObservabilityEvents/Task.html +1 -1
- data/docs/Tasker/Constants/ObservabilityEvents.html +1 -1
- data/docs/Tasker/Constants/RegistryEvents.html +1 -1
- data/docs/Tasker/Constants/StepEvents.html +1 -1
- data/docs/Tasker/Constants/TaskEvents.html +1 -1
- data/docs/Tasker/Constants/TaskExecution/ExecutionStatus.html +1 -1
- data/docs/Tasker/Constants/TaskExecution/HealthStatus.html +1 -1
- data/docs/Tasker/Constants/TaskExecution/RecommendedAction.html +1 -1
- data/docs/Tasker/Constants/TaskExecution.html +1 -1
- data/docs/Tasker/Constants/TaskFinalization/ErrorMessages.html +1 -1
- data/docs/Tasker/Constants/TaskFinalization/PendingReasons.html +1 -1
- data/docs/Tasker/Constants/TaskFinalization/ReenqueueReasons.html +1 -1
- data/docs/Tasker/Constants/TaskFinalization.html +1 -1
- data/docs/Tasker/Constants/TaskStatuses.html +1 -1
- data/docs/Tasker/Constants/TestEvents.html +1 -1
- data/docs/Tasker/Constants/WorkflowEvents.html +1 -1
- data/docs/Tasker/Constants/WorkflowStepStatuses.html +1 -1
- data/docs/Tasker/Constants.html +1 -1
- data/docs/Tasker/DependentSystem.html +1 -1
- data/docs/Tasker/DependentSystemObjectMap.html +1 -1
- data/docs/Tasker/DetectorRegistry.html +1 -1
- data/docs/Tasker/Engine.html +1 -1
- data/docs/Tasker/Error.html +1 -1
- data/docs/Tasker/Events/Catalog/CatalogPrinter.html +1 -1
- data/docs/Tasker/Events/Catalog/CustomEventRegistrar.html +1 -1
- data/docs/Tasker/Events/Catalog/ExamplePayloadGenerator.html +1 -1
- data/docs/Tasker/Events/Catalog.html +1 -1
- data/docs/Tasker/Events/CustomRegistry.html +1 -1
- data/docs/Tasker/Events/DefinitionLoader.html +1 -1
- data/docs/Tasker/Events/EventPayloadBuilder/ErrorInfoExtractor.html +1 -1
- data/docs/Tasker/Events/EventPayloadBuilder/StepPayloadBuilder.html +1 -1
- data/docs/Tasker/Events/EventPayloadBuilder.html +1 -1
- data/docs/Tasker/Events/Publisher.html +1 -1
- data/docs/Tasker/Events/Subscribers/BaseSubscriber/ErrorCategorizer/ErrorTypeClassifier.html +1 -1
- data/docs/Tasker/Events/Subscribers/BaseSubscriber/ErrorCategorizer.html +1 -1
- data/docs/Tasker/Events/Subscribers/BaseSubscriber/MetricTagsExtractor.html +1 -1
- data/docs/Tasker/Events/Subscribers/BaseSubscriber.html +1 -1
- data/docs/Tasker/Events/Subscribers/MetricsSubscriber.html +2 -2
- data/docs/Tasker/Events/Subscribers/TelemetrySubscriber.html +5 -5
- data/docs/Tasker/Events/Subscribers.html +1 -1
- data/docs/Tasker/Events/SubscriptionLoader.html +1 -1
- data/docs/Tasker/Events.html +1 -1
- data/docs/Tasker/EventsGenerator.html +2 -2
- data/docs/Tasker/Functions/FunctionBasedAnalyticsMetrics/AnalyticsMetrics.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedAnalyticsMetrics.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedDependencyLevels.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedSlowestSteps/SlowestStep.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedSlowestSteps.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedSlowestTasks/SlowestTask.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedSlowestTasks.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedStepReadinessStatus.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedSystemHealthCounts/HealthMetrics.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedSystemHealthCounts.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedTaskExecutionContext.html +1 -1
- data/docs/Tasker/Functions/FunctionWrapper.html +1 -1
- data/docs/Tasker/Functions.html +1 -1
- data/docs/Tasker/Generators/AuthenticatorGenerator/UsageInstructionsFormatter.html +1 -1
- data/docs/Tasker/Generators/AuthenticatorGenerator.html +1 -1
- data/docs/Tasker/Generators/AuthorizationCoordinatorGenerator.html +1 -1
- data/docs/Tasker/Generators/SubscriberGenerator.html +1 -1
- data/docs/Tasker/Generators/TaskHandlerGenerator.html +4 -4
- data/docs/Tasker/Generators.html +1 -1
- data/docs/Tasker/GraphQLTypes/AnnotationType.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseArgument.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseConnection.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseEdge.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseEnum.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseField.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseInputObject.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseInterface.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseObject.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseScalar.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseUnion.html +1 -1
- data/docs/Tasker/GraphQLTypes/DependentSystemObjectMapType.html +1 -1
- data/docs/Tasker/GraphQLTypes/DependentSystemType.html +1 -1
- data/docs/Tasker/GraphQLTypes/MutationType.html +1 -1
- data/docs/Tasker/GraphQLTypes/NamedStepType.html +1 -1
- data/docs/Tasker/GraphQLTypes/NamedTaskType.html +1 -1
- data/docs/Tasker/GraphQLTypes/NamedTasksNamedStepType.html +1 -1
- data/docs/Tasker/GraphQLTypes/NodeType.html +1 -1
- data/docs/Tasker/GraphQLTypes/QueryType.html +1 -1
- data/docs/Tasker/GraphQLTypes/TaskAnnotationType.html +1 -1
- data/docs/Tasker/GraphQLTypes/TaskInterface.html +1 -1
- data/docs/Tasker/GraphQLTypes/TaskType.html +1 -1
- data/docs/Tasker/GraphQLTypes/WorkflowStepType.html +1 -1
- data/docs/Tasker/GraphQLTypes.html +1 -1
- data/docs/Tasker/GraphqlController.html +1 -1
- data/docs/Tasker/HandlerFactory.html +1 -1
- data/docs/Tasker/HandlerSerializer.html +1 -1
- data/docs/Tasker/HandlersController.html +1 -1
- data/docs/Tasker/HashIdentityStrategy.html +1 -1
- data/docs/Tasker/Health/ReadinessChecker.html +2 -2
- data/docs/Tasker/Health/StatusChecker.html +2 -2
- data/docs/Tasker/Health.html +1 -1
- data/docs/Tasker/HealthController.html +1 -1
- data/docs/Tasker/IdentityStrategy.html +1 -1
- data/docs/Tasker/InvalidTaskHandlerConfig.html +1 -1
- data/docs/Tasker/Logging/CorrelationIdGenerator.html +2 -2
- data/docs/Tasker/Logging.html +1 -1
- data/docs/Tasker/MetricsController.html +1 -1
- data/docs/Tasker/MetricsExportJob.html +1 -1
- data/docs/Tasker/Mutations/BaseMutation.html +1 -1
- data/docs/Tasker/Mutations/CancelStep.html +1 -1
- data/docs/Tasker/Mutations/CancelTask.html +1 -1
- data/docs/Tasker/Mutations/CreateTask.html +1 -1
- data/docs/Tasker/Mutations/UpdateStep.html +1 -1
- data/docs/Tasker/Mutations/UpdateTask.html +1 -1
- data/docs/Tasker/Mutations.html +1 -1
- data/docs/Tasker/NamedStep.html +1 -1
- data/docs/Tasker/NamedTask.html +1 -1
- data/docs/Tasker/NamedTasksNamedStep.html +1 -1
- data/docs/Tasker/Orchestration/BackoffCalculator.html +1 -1
- data/docs/Tasker/Orchestration/ConnectionBuilder/ConfigValidator.html +1 -1
- data/docs/Tasker/Orchestration/ConnectionBuilder.html +2 -2
- data/docs/Tasker/Orchestration/ConnectionPoolIntelligence.html +3 -3
- data/docs/Tasker/Orchestration/Coordinator.html +1 -1
- data/docs/Tasker/Orchestration/FutureStateAnalyzer.html +1 -1
- data/docs/Tasker/Orchestration/PluginIntegration.html +1 -1
- data/docs/Tasker/Orchestration/ResponseProcessor.html +1 -1
- data/docs/Tasker/Orchestration/RetryHeaderParser.html +1 -1
- data/docs/Tasker/Orchestration/StepExecutor.html +4 -4
- data/docs/Tasker/Orchestration/StepSequenceFactory.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/BlockageChecker.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/ContextManager.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/DelayCalculator.html +2 -2
- data/docs/Tasker/Orchestration/TaskFinalizer/FinalizationDecisionMaker.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/FinalizationProcessor.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/ReasonDeterminer.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/ReenqueueManager.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/UnclearStateHandler.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer.html +1 -1
- data/docs/Tasker/Orchestration/TaskInitializer.html +1 -1
- data/docs/Tasker/Orchestration/TaskReenqueuer.html +1 -1
- data/docs/Tasker/Orchestration/ViableStepDiscovery.html +1 -1
- data/docs/Tasker/Orchestration/WorkflowCoordinator.html +1 -1
- data/docs/Tasker/Orchestration.html +1 -1
- data/docs/Tasker/PageSort/PageSortParamsBuilder.html +1 -1
- data/docs/Tasker/PageSort.html +1 -1
- data/docs/Tasker/PermanentError.html +1 -1
- data/docs/Tasker/ProceduralError.html +1 -1
- data/docs/Tasker/Queries/AllAnnotationTypes.html +1 -1
- data/docs/Tasker/Queries/AllTasks.html +1 -1
- data/docs/Tasker/Queries/BaseQuery.html +1 -1
- data/docs/Tasker/Queries/Helpers.html +1 -1
- data/docs/Tasker/Queries/OneStep.html +1 -1
- data/docs/Tasker/Queries/OneTask.html +1 -1
- data/docs/Tasker/Queries/TasksByAnnotation.html +1 -1
- data/docs/Tasker/Queries/TasksByStatus.html +1 -1
- data/docs/Tasker/Queries.html +1 -1
- data/docs/Tasker/Railtie.html +1 -1
- data/docs/Tasker/Registry/BaseRegistry.html +2 -2
- data/docs/Tasker/Registry/EventPublisher.html +1 -1
- data/docs/Tasker/Registry/InterfaceValidator.html +1 -1
- data/docs/Tasker/Registry/RegistrationError.html +1 -1
- data/docs/Tasker/Registry/RegistryError.html +1 -1
- data/docs/Tasker/Registry/StatisticsCollector.html +1 -1
- data/docs/Tasker/Registry/SubscriberRegistry.html +1 -1
- data/docs/Tasker/Registry/ValidationError.html +1 -1
- data/docs/Tasker/Registry.html +1 -1
- data/docs/Tasker/RetryableError.html +1 -1
- data/docs/Tasker/StateMachine/Compatibility.html +1 -1
- data/docs/Tasker/StateMachine/InvalidStateTransition.html +1 -1
- data/docs/Tasker/StateMachine/StepStateMachine.html +1 -1
- data/docs/Tasker/StateMachine/TaskStateMachine.html +1 -1
- data/docs/Tasker/StateMachine.html +1 -1
- data/docs/Tasker/StepDagRelationship.html +1 -1
- data/docs/Tasker/StepHandler/Api/Config.html +1 -1
- data/docs/Tasker/StepHandler/Api.html +1 -1
- data/docs/Tasker/StepHandler/AutomaticEventPublishing.html +1 -1
- data/docs/Tasker/StepHandler/Base.html +1 -1
- data/docs/Tasker/StepHandler.html +1 -1
- data/docs/Tasker/StepReadinessStatus.html +1 -1
- data/docs/Tasker/Task.html +1 -1
- data/docs/Tasker/TaskAnnotation.html +1 -1
- data/docs/Tasker/TaskAnnotationSerializer.html +1 -1
- data/docs/Tasker/TaskBuilder/StepNameValidator.html +1 -1
- data/docs/Tasker/TaskBuilder/StepTemplateDefiner.html +1 -1
- data/docs/Tasker/TaskBuilder.html +1 -1
- data/docs/Tasker/TaskExecutionContext.html +1 -1
- data/docs/Tasker/TaskHandler/ClassMethods/StepTemplateDefiner/ClassBasedEventRegistrar.html +1 -1
- data/docs/Tasker/TaskHandler/ClassMethods/StepTemplateDefiner/YamlEventRegistrar.html +1 -1
- data/docs/Tasker/TaskHandler/ClassMethods/StepTemplateDefiner.html +1 -1
- data/docs/Tasker/TaskHandler/ClassMethods.html +1 -1
- data/docs/Tasker/TaskHandler/InstanceMethods.html +1 -1
- data/docs/Tasker/TaskHandler/StepGroup.html +1 -1
- data/docs/Tasker/TaskHandler.html +1 -1
- data/docs/Tasker/TaskNamespace.html +1 -1
- data/docs/Tasker/TaskRunnerJob.html +1 -1
- data/docs/Tasker/TaskSerializer.html +1 -1
- data/docs/Tasker/TaskTransition.html +1 -1
- data/docs/Tasker/TaskerRailsSchema/InvalidObjectTypeError.html +1 -1
- data/docs/Tasker/TaskerRailsSchema/TypeResolutionError.html +1 -1
- data/docs/Tasker/TaskerRailsSchema/UnknownInterfaceError.html +1 -1
- data/docs/Tasker/TaskerRailsSchema.html +1 -1
- data/docs/Tasker/TasksController.html +1 -1
- data/docs/Tasker/Telemetry/EventMapping.html +1 -1
- data/docs/Tasker/Telemetry/EventRouter.html +1 -1
- data/docs/Tasker/Telemetry/Events/ExportEvents.html +1 -1
- data/docs/Tasker/Telemetry/Events.html +1 -1
- data/docs/Tasker/Telemetry/ExportCoordinator.html +1 -1
- data/docs/Tasker/Telemetry/IntelligentCacheManager.html +2 -2
- data/docs/Tasker/Telemetry/LogBackend.html +1 -1
- data/docs/Tasker/Telemetry/MetricTypes/Counter.html +2 -2
- data/docs/Tasker/Telemetry/MetricTypes/Gauge.html +73 -73
- data/docs/Tasker/Telemetry/MetricTypes/Histogram.html +103 -103
- data/docs/Tasker/Telemetry/MetricTypes.html +1 -1
- data/docs/Tasker/Telemetry/MetricsBackend.html +1 -1
- data/docs/Tasker/Telemetry/MetricsExportService.html +1 -1
- data/docs/Tasker/Telemetry/PluginRegistry.html +1 -1
- data/docs/Tasker/Telemetry/Plugins/BaseExporter.html +1 -1
- data/docs/Tasker/Telemetry/Plugins/CsvExporter.html +1 -1
- data/docs/Tasker/Telemetry/Plugins/JsonExporter.html +1 -1
- data/docs/Tasker/Telemetry/Plugins.html +1 -1
- data/docs/Tasker/Telemetry/PrometheusExporter.html +1 -1
- data/docs/Tasker/Telemetry/TraceBackend.html +1 -1
- data/docs/Tasker/Telemetry.html +1 -1
- data/docs/Tasker/Types/AuthConfig.html +1 -1
- data/docs/Tasker/Types/BackoffConfig.html +1 -1
- data/docs/Tasker/Types/BaseConfig.html +1 -1
- data/docs/Tasker/Types/CacheConfig.html +1 -1
- data/docs/Tasker/Types/DatabaseConfig.html +1 -1
- data/docs/Tasker/Types/DependencyGraph.html +1 -1
- data/docs/Tasker/Types/DependencyGraphConfig.html +1 -1
- data/docs/Tasker/Types/EngineConfig.html +1 -1
- data/docs/Tasker/Types/ExecutionConfig.html +1 -1
- data/docs/Tasker/Types/GraphEdge.html +1 -1
- data/docs/Tasker/Types/GraphMetadata.html +1 -1
- data/docs/Tasker/Types/GraphNode.html +1 -1
- data/docs/Tasker/Types/HealthConfig.html +1 -1
- data/docs/Tasker/Types/StepSequence.html +1 -1
- data/docs/Tasker/Types/StepTemplate.html +1 -1
- data/docs/Tasker/Types/TaskRequest.html +1 -1
- data/docs/Tasker/Types/TelemetryConfig.html +2 -2
- data/docs/Tasker/Types.html +1 -1
- data/docs/Tasker/WorkflowStep/StepFinder.html +1 -1
- data/docs/Tasker/WorkflowStep.html +1 -1
- data/docs/Tasker/WorkflowStepEdge.html +1 -1
- data/docs/Tasker/WorkflowStepSerializer.html +1 -1
- data/docs/Tasker/WorkflowStepTransition/TransitionDescriptionFormatter.html +1 -1
- data/docs/Tasker/WorkflowStepTransition.html +1 -1
- data/docs/Tasker/WorkflowStepsController.html +1 -1
- data/docs/Tasker.html +18 -2
- data/docs/VISION.md +1 -1
- data/docs/_index.html +1 -1
- data/docs/file.README.html +5 -5
- data/docs/index.html +5 -5
- data/docs/method_list.html +74 -74
- data/docs/top-level-namespace.html +1 -1
- data/lib/generators/tasker/authenticator_generator.rb +5 -5
- data/lib/generators/tasker/authorization_coordinator_generator.rb +1 -1
- data/lib/generators/tasker/events_generator.rb +1 -1
- data/lib/generators/tasker/task_handler_generator.rb +4 -4
- data/lib/generators/tasker/templates/api_token_authenticator.rb.erb +1 -1
- data/lib/generators/tasker/templates/custom_authenticator.rb.erb +1 -1
- data/lib/generators/tasker/templates/devise_authenticator.rb.erb +1 -1
- data/lib/generators/tasker/templates/initialize.rb.erb +1 -1
- data/lib/generators/tasker/templates/jwt_authenticator.rb.erb +1 -1
- data/lib/generators/tasker/templates/omniauth_authenticator.rb.erb +1 -1
- data/lib/generators/tasker/templates/opentelemetry_initializer.rb +3 -3
- data/lib/generators/tasker/templates/task_config.yaml.erb +25 -25
- data/lib/generators/tasker/templates/task_handler.rb.erb +3 -2
- data/lib/generators/tasker/templates/task_handler_spec.rb.erb +49 -43
- data/lib/tasker/analysis/runtime_graph_analyzer.rb +1 -1
- data/lib/tasker/authentication/coordinator.rb +2 -2
- data/lib/tasker/authorization/base_coordinator.rb +1 -1
- data/lib/tasker/authorization.rb +1 -1
- data/lib/tasker/concerns/authenticatable.rb +1 -1
- data/lib/tasker/concerns/controller_authorizable.rb +3 -3
- data/lib/tasker/concerns/structured_logging.rb +2 -2
- data/lib/tasker/events/definition_loader.rb +1 -1
- data/lib/tasker/events/subscribers/metrics_subscriber.rb +1 -1
- data/lib/tasker/events/subscribers/telemetry_subscriber.rb +5 -5
- data/lib/tasker/health/readiness_checker.rb +1 -1
- data/lib/tasker/health/status_checker.rb +1 -1
- data/lib/tasker/logging/correlation_id_generator.rb +1 -1
- data/lib/tasker/orchestration/backoff_calculator.rb +1 -1
- data/lib/tasker/orchestration/connection_builder.rb +1 -1
- data/lib/tasker/orchestration/connection_pool_intelligence.rb +3 -3
- data/lib/tasker/orchestration/step_executor.rb +2 -2
- data/lib/tasker/orchestration/task_finalizer.rb +1 -1
- data/lib/tasker/registry/base_registry.rb +1 -1
- data/lib/tasker/task_builder.rb +1 -1
- data/lib/tasker/telemetry/intelligent_cache_manager.rb +1 -1
- data/lib/tasker/telemetry/metric_types.rb +57 -9
- data/lib/tasker/telemetry/metrics_backend.rb +3 -3
- data/lib/tasker/telemetry/metrics_export_service.rb +1 -1
- data/lib/tasker/telemetry/prometheus_exporter.rb +2 -2
- data/lib/tasker/types/telemetry_config.rb +1 -1
- data/lib/tasker/version.rb +2 -1
- data/lib/tasks/tasker_tasks.rake +85 -4
- metadata +1 -1
@@ -8,17 +8,17 @@ module_namespace: <%= @module_namespace %>
|
|
8
8
|
task_handler_class: <%= @task_handler_class %>
|
9
9
|
description: "<%= @description || "Generated task handler for #{@task_name}" %>"
|
10
10
|
|
11
|
-
default_dependent_system: <%= @dependent_system %>
|
11
|
+
default_dependent_system: '<%= @dependent_system || 'default_system' %>'
|
12
12
|
named_steps:
|
13
|
-
<% if @steps && @steps.any?
|
14
|
-
<% @steps.each do |step|
|
13
|
+
<% if @steps && @steps.any? %>
|
14
|
+
<% @steps.each do |step| %>
|
15
15
|
- <%= step %>
|
16
|
-
<% end
|
17
|
-
<% else
|
16
|
+
<% end %>
|
17
|
+
<% else %>
|
18
18
|
- fetch_data
|
19
19
|
- process_data
|
20
20
|
- complete_task
|
21
|
-
<% end
|
21
|
+
<% end %>
|
22
22
|
|
23
23
|
schema:
|
24
24
|
type: object
|
@@ -29,16 +29,16 @@ schema:
|
|
29
29
|
type: integer
|
30
30
|
|
31
31
|
step_templates:
|
32
|
-
<% if @steps && @steps.any?
|
33
|
-
<% @steps.each_with_index do |step, index|
|
32
|
+
<% if @steps && @steps.any? %>
|
33
|
+
<% @steps.each_with_index do |step, index| %>
|
34
34
|
- name: <%= step %>
|
35
35
|
description: <%= step.humanize %> step
|
36
36
|
handler_class: <%= @module_namespace ? "#{@module_namespace}::" : '' %><%= @task_handler_class %>::<%= step.classify %>StepHandler
|
37
|
-
<% if index > 0
|
37
|
+
<% if index > 0 %>
|
38
38
|
depends_on_step: <%= @steps[index - 1] %>
|
39
|
-
<% end
|
40
|
-
<% end
|
41
|
-
<% else
|
39
|
+
<% end %>
|
40
|
+
<% end %>
|
41
|
+
<% else %>
|
42
42
|
- name: fetch_data
|
43
43
|
description: Fetch required data from dependent system
|
44
44
|
handler_class: <%= @module_namespace ? "#{@module_namespace}::" : '' %><%= @task_handler_class %>::FetchDataStepHandler
|
@@ -63,55 +63,55 @@ step_templates:
|
|
63
63
|
description: Complete the task with processed data
|
64
64
|
depends_on_step: process_data
|
65
65
|
handler_class: <%= @module_namespace ? "#{@module_namespace}::" : '' %><%= @task_handler_class %>::CompleteTaskStepHandler
|
66
|
-
<% end
|
66
|
+
<% end %>
|
67
67
|
|
68
68
|
environments:
|
69
69
|
development:
|
70
70
|
step_templates:
|
71
|
-
<% if @steps && @steps.any?
|
72
|
-
<% first_step = @steps.first
|
71
|
+
<% if @steps && @steps.any? %>
|
72
|
+
<% first_step = @steps.first %>
|
73
73
|
- name: <%= first_step %>
|
74
74
|
handler_config:
|
75
75
|
params:
|
76
76
|
debug: true
|
77
|
-
<% else
|
77
|
+
<% else %>
|
78
78
|
- name: fetch_data
|
79
79
|
handler_config:
|
80
80
|
url: http://localhost:3000/api/data
|
81
81
|
params:
|
82
82
|
id: 1
|
83
83
|
debug: true
|
84
|
-
<% end
|
84
|
+
<% end %>
|
85
85
|
|
86
86
|
test:
|
87
87
|
step_templates:
|
88
|
-
<% if @steps && @steps.any?
|
89
|
-
<% first_step = @steps.first
|
88
|
+
<% if @steps && @steps.any? %>
|
89
|
+
<% first_step = @steps.first %>
|
90
90
|
- name: <%= first_step %>
|
91
91
|
handler_config:
|
92
92
|
params:
|
93
93
|
test_mode: true
|
94
|
-
<% else
|
94
|
+
<% else %>
|
95
95
|
- name: fetch_data
|
96
96
|
handler_config:
|
97
97
|
url: http://test-api.example.com/data
|
98
98
|
params:
|
99
99
|
id: 1
|
100
100
|
test_mode: true
|
101
|
-
<% end
|
101
|
+
<% end %>
|
102
102
|
|
103
103
|
production:
|
104
104
|
step_templates:
|
105
|
-
<% if @steps && @steps.any?
|
106
|
-
<% first_step = @steps.first
|
105
|
+
<% if @steps && @steps.any? %>
|
106
|
+
<% first_step = @steps.first %>
|
107
107
|
- name: <%= first_step %>
|
108
108
|
handler_config:
|
109
109
|
params: {}
|
110
|
-
<% else
|
110
|
+
<% else %>
|
111
111
|
- name: fetch_data
|
112
112
|
handler_config:
|
113
113
|
url: https://api.example.com/data
|
114
114
|
params:
|
115
115
|
id: 1
|
116
116
|
api_key: ${API_KEY}
|
117
|
-
<% end
|
117
|
+
<% end %>
|
@@ -19,9 +19,10 @@ module <%= @module_namespace %>
|
|
19
19
|
connection.get("/data/#{input_id}")
|
20
20
|
end
|
21
21
|
|
22
|
-
def process_results(
|
22
|
+
def process_results(step, response, initial_results)
|
23
23
|
# Extract the response ID from the API response
|
24
|
-
|
24
|
+
data = JSON.parse(response.body)
|
25
|
+
step.results = { response_id: data.deep_symbolize_keys.dig(:data, :id) }
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
@@ -5,26 +5,17 @@ require 'rails_helper'
|
|
5
5
|
RSpec.describe <%= @module_namespace ? "#{@module_namespace}::" : '' %><%= @task_handler_class %> do
|
6
6
|
let(:stubs) { Faraday::Adapter::Test::Stubs.new }
|
7
7
|
let(:connection) { Faraday.new { |b| b.adapter(:test, stubs) } }
|
8
|
-
let(:task_handler)
|
9
|
-
handler = described_class.new
|
10
|
-
mock_connection = connection # Capture connection in closure
|
11
|
-
original_get_step_handler = handler.method(:get_step_handler)
|
12
|
-
handler.define_singleton_method(:get_step_handler) do |step|
|
13
|
-
step_handler = original_get_step_handler.call(step)
|
14
|
-
step_handler.instance_variable_set(:@connection, mock_connection)
|
15
|
-
step_handler
|
16
|
-
end
|
17
|
-
handler
|
18
|
-
end
|
8
|
+
let(:task_handler) { create_api_task_handler_with_connection(described_class, connection) }
|
19
9
|
let(:yaml_path) { described_class.yaml_path }
|
20
|
-
let(:yaml_config) {
|
10
|
+
let(:yaml_config) { described_class.config }
|
21
11
|
let(:handler_class) { described_class }
|
12
|
+
let(:input_id) { 1 }
|
22
13
|
let(:task_request) do
|
23
14
|
Tasker::Types::TaskRequest.new(
|
24
15
|
name: "<%= @task_name %>",
|
25
16
|
namespace: "<%= @namespace_name || 'default' %>",
|
26
17
|
version: "<%= @version || '0.1.0' %>",
|
27
|
-
context: { "input_id" =>
|
18
|
+
context: { "input_id" => input_id },
|
28
19
|
initiator: "user",
|
29
20
|
reason: "test",
|
30
21
|
source_system: "test_system"
|
@@ -33,6 +24,33 @@ RSpec.describe <%= @module_namespace ? "#{@module_namespace}::" : '' %><%= @task
|
|
33
24
|
let(:task) { task_handler.initialize_task!(task_request) }
|
34
25
|
let(:factory) { Tasker::HandlerFactory.instance }
|
35
26
|
|
27
|
+
before do
|
28
|
+
# Register handler with namespace + version support
|
29
|
+
factory.register(
|
30
|
+
"<%= @task_name %>",
|
31
|
+
described_class,
|
32
|
+
namespace_name: "<%= @namespace_name || 'default' %>",
|
33
|
+
version: "<%= @version || '0.1.0' %>",
|
34
|
+
replace: true
|
35
|
+
)
|
36
|
+
# Stub data endpoint
|
37
|
+
stubs.get("/data/#{input_id}") do |_env|
|
38
|
+
[
|
39
|
+
200,
|
40
|
+
{ 'Content-Type' => 'application/json' },
|
41
|
+
{ data: { id: input_id } }.to_json
|
42
|
+
]
|
43
|
+
end
|
44
|
+
# Stub data endpoint
|
45
|
+
stubs.get("/data") do |_env|
|
46
|
+
[
|
47
|
+
200,
|
48
|
+
{ 'Content-Type' => 'application/json' },
|
49
|
+
{ data: [ { id: input_id } ] }.to_json
|
50
|
+
]
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
36
54
|
describe '#initialize' do
|
37
55
|
it 'loads the task configuration from YAML' do
|
38
56
|
expect(task_handler.config).to be_a(Hash)
|
@@ -104,36 +122,6 @@ RSpec.describe <%= @module_namespace ? "#{@module_namespace}::" : '' %><%= @task
|
|
104
122
|
end
|
105
123
|
|
106
124
|
describe 'complete workflow' do
|
107
|
-
before do
|
108
|
-
# Register handler with namespace + version support
|
109
|
-
factory.register(
|
110
|
-
"<%= @task_name %>",
|
111
|
-
described_class,
|
112
|
-
namespace_name: "<%= @namespace_name || 'default' %>",
|
113
|
-
version: "<%= @version || '0.1.0' %>"
|
114
|
-
)
|
115
|
-
stubs.get("/data") do |env|
|
116
|
-
Faraday::Response.new(
|
117
|
-
Faraday::Env.from(
|
118
|
-
status: 200,
|
119
|
-
response_headers: { 'Content-Type' => 'application/json' },
|
120
|
-
body: { data: { id: 123 } }.to_json,
|
121
|
-
url: env.url
|
122
|
-
)
|
123
|
-
)
|
124
|
-
end
|
125
|
-
stubs.get("/data/123") do |env|
|
126
|
-
Faraday::Response.new(
|
127
|
-
Faraday::Env.from(
|
128
|
-
status: 200,
|
129
|
-
response_headers: { 'Content-Type' => 'application/json' },
|
130
|
-
body: { data: { id: 123 } }.to_json,
|
131
|
-
url: env.url
|
132
|
-
)
|
133
|
-
)
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
125
|
it 'can handle the task' do
|
138
126
|
expect(task).to be_valid
|
139
127
|
expect(task.save).to be_truthy
|
@@ -157,3 +145,21 @@ RSpec.describe <%= @module_namespace ? "#{@module_namespace}::" : '' %><%= @task
|
|
157
145
|
end
|
158
146
|
end
|
159
147
|
end
|
148
|
+
|
149
|
+
# Create task handler with connection stubbing (for API integration tests)
|
150
|
+
def create_api_task_handler_with_connection(handler_class, connection)
|
151
|
+
handler = handler_class.new
|
152
|
+
|
153
|
+
# Override get_step_handler to inject the mocked connection
|
154
|
+
original_get_step_handler = handler.method(:get_step_handler)
|
155
|
+
handler.define_singleton_method(:get_step_handler) do |step|
|
156
|
+
step_handler = original_get_step_handler.call(step)
|
157
|
+
|
158
|
+
# For API step handlers, override the connection that was built during initialization
|
159
|
+
step_handler.instance_variable_set(:@connection, connection) if step_handler.is_a?(Tasker::StepHandler::Api)
|
160
|
+
|
161
|
+
step_handler
|
162
|
+
end
|
163
|
+
|
164
|
+
handler
|
165
|
+
end
|
@@ -127,7 +127,7 @@ module Tasker
|
|
127
127
|
# @return [Tasker::Types::DependencyGraphConfig] Configuration for calculations
|
128
128
|
# @api private
|
129
129
|
def dependency_graph_config
|
130
|
-
@dependency_graph_config ||= Tasker.configuration.dependency_graph
|
130
|
+
@dependency_graph_config ||= Tasker::Configuration.configuration.dependency_graph
|
131
131
|
end
|
132
132
|
|
133
133
|
# Generate cache version based on task state for intelligent cache invalidation
|
@@ -24,7 +24,7 @@ module Tasker
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def build_authenticator
|
27
|
-
auth_config = Tasker.configuration.auth
|
27
|
+
auth_config = Tasker::Configuration.configuration.auth
|
28
28
|
|
29
29
|
if auth_config.authentication_enabled
|
30
30
|
build_custom_authenticator(auth_config)
|
@@ -43,7 +43,7 @@ module Tasker
|
|
43
43
|
|
44
44
|
# Instantiate the host app's authenticator
|
45
45
|
klass = authenticator_class.constantize
|
46
|
-
# Pass empty options hash for now - authenticators can get config from Tasker.configuration
|
46
|
+
# Pass empty options hash for now - authenticators can get config from Tasker::Configuration.configuration
|
47
47
|
authenticator = klass.new({})
|
48
48
|
|
49
49
|
# Validate it implements the interface
|
@@ -100,7 +100,7 @@ module Tasker
|
|
100
100
|
#
|
101
101
|
# @return [Boolean] True if authorization is enabled
|
102
102
|
def authorization_enabled?
|
103
|
-
Tasker.configuration.auth.authorization_enabled
|
103
|
+
Tasker::Configuration.configuration.auth.authorization_enabled
|
104
104
|
end
|
105
105
|
|
106
106
|
# The user object for authorization checks
|
data/lib/tasker/authorization.rb
CHANGED
@@ -19,7 +19,7 @@ module Tasker
|
|
19
19
|
# - User model integration via the Authorizable concern
|
20
20
|
#
|
21
21
|
# @example Basic configuration
|
22
|
-
# Tasker.configuration do |config|
|
22
|
+
# Tasker::Configuration.configuration do |config|
|
23
23
|
# config.auth do |auth|
|
24
24
|
# auth.enabled = true
|
25
25
|
# auth.coordinator_class = 'MyAuthorizationCoordinator'
|
@@ -66,10 +66,10 @@ module Tasker
|
|
66
66
|
#
|
67
67
|
# @return [BaseCoordinator] New coordinator instance
|
68
68
|
def build_authorization_coordinator
|
69
|
-
coordinator_class = Tasker.configuration.auth.authorization_coordinator_class.constantize
|
69
|
+
coordinator_class = Tasker::Configuration.configuration.auth.authorization_coordinator_class.constantize
|
70
70
|
coordinator_class.new(current_tasker_user)
|
71
71
|
rescue NameError => e
|
72
|
-
coordinator_class_name = Tasker.configuration.auth.authorization_coordinator_class
|
72
|
+
coordinator_class_name = Tasker::Configuration.configuration.auth.authorization_coordinator_class
|
73
73
|
raise Tasker::Authorization::ConfigurationError,
|
74
74
|
"Authorization coordinator class '#{coordinator_class_name}' not found: #{e.message}"
|
75
75
|
end
|
@@ -117,7 +117,7 @@ module Tasker
|
|
117
117
|
#
|
118
118
|
# @return [Boolean] True if authorization should be skipped
|
119
119
|
def skip_authorization?
|
120
|
-
!Tasker.configuration.auth.authorization_enabled
|
120
|
+
!Tasker::Configuration.configuration.auth.authorization_enabled
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
@@ -322,7 +322,7 @@ module Tasker
|
|
322
322
|
def extract_standard_context
|
323
323
|
context = {
|
324
324
|
environment: Rails.env,
|
325
|
-
tasker_version: Tasker::
|
325
|
+
tasker_version: Tasker::Version
|
326
326
|
}
|
327
327
|
|
328
328
|
# Add process/thread info if available
|
@@ -380,7 +380,7 @@ module Tasker
|
|
380
380
|
#
|
381
381
|
# @return [Tasker::Types::TelemetryConfig] Telemetry configuration
|
382
382
|
def telemetry_config
|
383
|
-
@telemetry_config ||= Tasker.configuration.telemetry
|
383
|
+
@telemetry_config ||= Tasker::Configuration.configuration.telemetry
|
384
384
|
end
|
385
385
|
end
|
386
386
|
end
|
@@ -103,7 +103,7 @@ module Tasker
|
|
103
103
|
metadata = {}
|
104
104
|
|
105
105
|
# Load custom events from configured directories if they exist
|
106
|
-
Tasker.configuration.engine.custom_events_directories.each do |directory_path|
|
106
|
+
Tasker::Configuration.configuration.engine.custom_events_directories.each do |directory_path|
|
107
107
|
absolute_path = File.expand_path(directory_path, Rails.root)
|
108
108
|
|
109
109
|
if File.directory?(absolute_path)
|
@@ -79,7 +79,7 @@ module Tasker
|
|
79
79
|
# @return [Boolean] True if the event should be processed
|
80
80
|
def should_process_event?(event_constant)
|
81
81
|
# Only process if telemetry is enabled
|
82
|
-
return false unless Tasker.configuration.telemetry.enabled
|
82
|
+
return false unless Tasker::Configuration.configuration.telemetry.enabled
|
83
83
|
|
84
84
|
# Convert constant to event name if needed
|
85
85
|
event_name = event_constant.respond_to?(:name) ? event_constant.name : event_constant.to_s
|
@@ -146,7 +146,7 @@ module Tasker
|
|
146
146
|
# Override BaseSubscriber to add telemetry-specific filtering
|
147
147
|
def should_process_event?(event_constant)
|
148
148
|
# Get configuration once for efficiency
|
149
|
-
config = Tasker.configuration
|
149
|
+
config = Tasker::Configuration.configuration
|
150
150
|
|
151
151
|
# Only process if telemetry is enabled
|
152
152
|
return false unless config.telemetry.enabled
|
@@ -163,7 +163,7 @@ module Tasker
|
|
163
163
|
|
164
164
|
# Check if telemetry is enabled
|
165
165
|
def telemetry_enabled?
|
166
|
-
Tasker.configuration.telemetry.enabled != false
|
166
|
+
Tasker::Configuration.configuration.telemetry.enabled != false
|
167
167
|
end
|
168
168
|
|
169
169
|
# Create a simple span for events that don't need complex hierarchy
|
@@ -296,7 +296,7 @@ module Tasker
|
|
296
296
|
#
|
297
297
|
# @return [OpenTelemetry::Tracer] The tracer instance
|
298
298
|
def create_tracer
|
299
|
-
config = Tasker.configuration
|
299
|
+
config = Tasker::Configuration.configuration
|
300
300
|
::OpenTelemetry.tracer_provider.tracer(
|
301
301
|
config.telemetry.service_name,
|
302
302
|
config.telemetry.service_version
|
@@ -309,7 +309,7 @@ module Tasker
|
|
309
309
|
# @return [Hash] OpenTelemetry-compatible attributes
|
310
310
|
def convert_attributes_for_otel(attributes)
|
311
311
|
result = {}
|
312
|
-
config = Tasker.configuration
|
312
|
+
config = Tasker::Configuration.configuration
|
313
313
|
service_name = config.telemetry.service_name
|
314
314
|
|
315
315
|
# Filter sensitive data first
|
@@ -371,7 +371,7 @@ module Tasker
|
|
371
371
|
# @param attributes [Hash] The attributes to filter
|
372
372
|
# @return [Hash] The filtered attributes
|
373
373
|
def filter_sensitive_attributes(attributes)
|
374
|
-
filter = Tasker.configuration.telemetry.parameter_filter
|
374
|
+
filter = Tasker::Configuration.configuration.telemetry.parameter_filter
|
375
375
|
return attributes unless filter
|
376
376
|
|
377
377
|
filtered_data = {}
|
@@ -25,7 +25,7 @@ module Tasker
|
|
25
25
|
#
|
26
26
|
# @param timeout [Float] Maximum time to wait for checks (default: 5.0 seconds)
|
27
27
|
def initialize(timeout: nil)
|
28
|
-
@timeout = timeout || Tasker.configuration.health.readiness_timeout_seconds
|
28
|
+
@timeout = timeout || Tasker::Configuration.configuration.health.readiness_timeout_seconds
|
29
29
|
end
|
30
30
|
|
31
31
|
# Class method for simple readiness check
|
@@ -25,7 +25,7 @@ module Tasker
|
|
25
25
|
#
|
26
26
|
# @param cache_duration [Integer] Cache duration in seconds (default from config)
|
27
27
|
def initialize(cache_duration: nil)
|
28
|
-
@cache_duration = cache_duration || Tasker.configuration.health.cache_duration_seconds
|
28
|
+
@cache_duration = cache_duration || Tasker::Configuration.configuration.health.cache_duration_seconds
|
29
29
|
end
|
30
30
|
|
31
31
|
# Class method for status check
|
@@ -66,7 +66,7 @@ module Tasker
|
|
66
66
|
# id = from_headers(request.headers)
|
67
67
|
# id = from_headers(env, 'X-Request-ID')
|
68
68
|
def from_headers(headers, header_name = nil)
|
69
|
-
header_name ||= Tasker.configuration.telemetry.correlation_id_header
|
69
|
+
header_name ||= Tasker::Configuration.configuration.telemetry.correlation_id_header
|
70
70
|
|
71
71
|
# Handle different header formats (rack vs rails)
|
72
72
|
header_value = headers[header_name] ||
|
@@ -50,7 +50,7 @@ module Tasker
|
|
50
50
|
#
|
51
51
|
# @return [Tasker::Types::BackoffConfig] The backoff configuration
|
52
52
|
def backoff_config
|
53
|
-
@backoff_config ||= Tasker.configuration.backoff
|
53
|
+
@backoff_config ||= Tasker::Configuration.configuration.backoff
|
54
54
|
end
|
55
55
|
|
56
56
|
# Extract Retry-After header from response context
|
@@ -20,7 +20,7 @@ module Tasker
|
|
20
20
|
|
21
21
|
Rails.logger.debug do
|
22
22
|
"ConnectionBuilder: Building connection to #{config.url} " \
|
23
|
-
"with #{config.params
|
23
|
+
"with #{config.params} params and #{config.headers} headers"
|
24
24
|
end
|
25
25
|
|
26
26
|
connection = Faraday.new(
|
@@ -19,7 +19,7 @@ module Tasker
|
|
19
19
|
# concurrency = ConnectionPoolIntelligence.intelligent_concurrency_for_step_executor
|
20
20
|
#
|
21
21
|
# @example With custom configuration
|
22
|
-
# config = Tasker.configuration.execution
|
22
|
+
# config = Tasker::Configuration.configuration.execution
|
23
23
|
# config.connection_pressure_factors = { high: 0.3, critical: 0.1 }
|
24
24
|
# concurrency = ConnectionPoolIntelligence.intelligent_concurrency_for_step_executor
|
25
25
|
class ConnectionPoolIntelligence
|
@@ -91,7 +91,7 @@ module Tasker
|
|
91
91
|
# @return [Integer] Safe concurrency level for step execution
|
92
92
|
def self.intelligent_concurrency_for_step_executor
|
93
93
|
health_data = assess_connection_health
|
94
|
-
config = Tasker.configuration.execution
|
94
|
+
config = Tasker::Configuration.configuration.execution
|
95
95
|
|
96
96
|
# Get base recommendation from Rails pool analysis
|
97
97
|
base_recommendation = health_data[:recommended_concurrency]
|
@@ -135,7 +135,7 @@ module Tasker
|
|
135
135
|
pressure = assess_pressure(pool_stat)
|
136
136
|
|
137
137
|
# ✅ CONFIGURABLE: Pressure response factors (environment-dependent)
|
138
|
-
pressure_config = Tasker.configuration.execution.connection_pressure_factors
|
138
|
+
pressure_config = Tasker::Configuration.configuration.execution.connection_pressure_factors
|
139
139
|
factor = pressure_config[pressure] || 0.5
|
140
140
|
|
141
141
|
base_recommendation = [pool_stat[:available] * factor, 12].min.floor
|
@@ -22,11 +22,11 @@ module Tasker
|
|
22
22
|
include Tasker::Concerns::StructuredLogging
|
23
23
|
|
24
24
|
# Configuration-driven execution settings
|
25
|
-
# These delegate to Tasker.configuration.execution for configurable values
|
25
|
+
# These delegate to Tasker::Configuration.configuration.execution for configurable values
|
26
26
|
# while maintaining architectural constants for Ruby-specific optimizations
|
27
27
|
|
28
28
|
def execution_config
|
29
|
-
@execution_config ||= Tasker.configuration.execution
|
29
|
+
@execution_config ||= Tasker::Configuration.configuration.execution
|
30
30
|
end
|
31
31
|
|
32
32
|
# Execute a collection of viable steps
|
@@ -440,7 +440,7 @@ module Tasker
|
|
440
440
|
#
|
441
441
|
# @return [Tasker::Types::BackoffConfig] The backoff configuration
|
442
442
|
def backoff_config
|
443
|
-
@backoff_config ||= Tasker.configuration.backoff
|
443
|
+
@backoff_config ||= Tasker::Configuration.configuration.backoff
|
444
444
|
end
|
445
445
|
|
446
446
|
# Frozen hash for O(1) delay lookups with descriptive comments
|
@@ -16,7 +16,7 @@ module Tasker
|
|
16
16
|
|
17
17
|
def initialize
|
18
18
|
@mutex = Mutex.new
|
19
|
-
@telemetry_config = Tasker.configuration.telemetry
|
19
|
+
@telemetry_config = Tasker::Configuration.configuration.telemetry
|
20
20
|
@registry_name = self.class.name.demodulize.underscore
|
21
21
|
@created_at = Time.current
|
22
22
|
end
|
data/lib/tasker/task_builder.rb
CHANGED
@@ -411,7 +411,7 @@ module Tasker
|
|
411
411
|
#
|
412
412
|
# @return [String] The path to the YAML file
|
413
413
|
def yaml_path
|
414
|
-
@yaml_path ||= Rails.root.join("config/#{Tasker.configuration.engine.task_config_directory}/#{task_name}.yaml")
|
414
|
+
@yaml_path ||= Rails.root.join("config/#{Tasker::Configuration.configuration.engine.task_config_directory}/#{task_name}.yaml")
|
415
415
|
end
|
416
416
|
|
417
417
|
# Load the configuration from the YAML file
|
@@ -51,7 +51,7 @@ module Tasker
|
|
51
51
|
#
|
52
52
|
# @param config [Tasker::Types::CacheConfig, nil] Cache configuration
|
53
53
|
def initialize(config = nil)
|
54
|
-
@config = config || Tasker.configuration.cache
|
54
|
+
@config = config || Tasker::Configuration.configuration.cache
|
55
55
|
|
56
56
|
# Use unified cache strategy for capability detection
|
57
57
|
@cache_strategy = Tasker::CacheStrategy.detect
|
@@ -100,9 +100,25 @@ module Tasker
|
|
100
100
|
#
|
101
101
|
# @return [String] Human-readable description
|
102
102
|
def description
|
103
|
-
label_str = labels.empty? ? '' : labels
|
103
|
+
label_str = labels.empty? ? '' : format_labels_for_description(labels)
|
104
104
|
"#{name}#{label_str} = #{value} (counter)"
|
105
105
|
end
|
106
|
+
|
107
|
+
private
|
108
|
+
|
109
|
+
# Format labels consistently across Ruby versions
|
110
|
+
# Uses the older Ruby hash syntax for backward compatibility with tests
|
111
|
+
#
|
112
|
+
# @param labels_hash [Hash] The labels hash to format
|
113
|
+
# @return [String] Formatted label string
|
114
|
+
def format_labels_for_description(labels_hash)
|
115
|
+
return '' if labels_hash.empty?
|
116
|
+
|
117
|
+
formatted_pairs = labels_hash.map do |key, value|
|
118
|
+
":#{key}=>#{value.inspect}"
|
119
|
+
end
|
120
|
+
"{#{formatted_pairs.join(', ')}}"
|
121
|
+
end
|
106
122
|
end
|
107
123
|
|
108
124
|
# Gauge represents a metric value that can go up or down
|
@@ -212,9 +228,25 @@ module Tasker
|
|
212
228
|
#
|
213
229
|
# @return [String] Human-readable description
|
214
230
|
def description
|
215
|
-
label_str = labels.empty? ? '' : labels
|
231
|
+
label_str = labels.empty? ? '' : format_labels_for_description(labels)
|
216
232
|
"#{name}#{label_str} = #{value} (gauge)"
|
217
233
|
end
|
234
|
+
|
235
|
+
private
|
236
|
+
|
237
|
+
# Format labels consistently across Ruby versions
|
238
|
+
# Uses the older Ruby hash syntax for backward compatibility with tests
|
239
|
+
#
|
240
|
+
# @param labels_hash [Hash] The labels hash to format
|
241
|
+
# @return [String] Formatted label string
|
242
|
+
def format_labels_for_description(labels_hash)
|
243
|
+
return '' if labels_hash.empty?
|
244
|
+
|
245
|
+
formatted_pairs = labels_hash.map do |key, value|
|
246
|
+
":#{key}=>#{value.inspect}"
|
247
|
+
end
|
248
|
+
"{#{formatted_pairs.join(', ')}}"
|
249
|
+
end
|
218
250
|
end
|
219
251
|
|
220
252
|
# Histogram represents a metric that samples observations and counts them in buckets
|
@@ -346,21 +378,37 @@ module Tasker
|
|
346
378
|
}
|
347
379
|
end
|
348
380
|
|
381
|
+
# Reset the histogram (primarily for testing)
|
382
|
+
#
|
383
|
+
# @return [void]
|
384
|
+
def reset!
|
385
|
+
@count.value = 0
|
386
|
+
@sum.set(0.0)
|
387
|
+
@bucket_counts.each { |bucket| bucket.value = 0 }
|
388
|
+
end
|
389
|
+
|
349
390
|
# Get a description of this metric for debugging
|
350
391
|
#
|
351
392
|
# @return [String] Human-readable description
|
352
393
|
def description
|
353
|
-
label_str = labels.empty? ? '' : labels
|
394
|
+
label_str = labels.empty? ? '' : format_labels_for_description(labels)
|
354
395
|
"#{name}#{label_str} = #{count} observations, avg: #{average.round(3)} (histogram)"
|
355
396
|
end
|
356
397
|
|
357
|
-
|
398
|
+
private
|
399
|
+
|
400
|
+
# Format labels consistently across Ruby versions
|
401
|
+
# Uses the older Ruby hash syntax for backward compatibility with tests
|
358
402
|
#
|
359
|
-
# @
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
403
|
+
# @param labels_hash [Hash] The labels hash to format
|
404
|
+
# @return [String] Formatted label string
|
405
|
+
def format_labels_for_description(labels_hash)
|
406
|
+
return '' if labels_hash.empty?
|
407
|
+
|
408
|
+
formatted_pairs = labels_hash.map do |key, value|
|
409
|
+
":#{key}=>#{value.inspect}"
|
410
|
+
end
|
411
|
+
"{#{formatted_pairs.join(', ')}}"
|
364
412
|
end
|
365
413
|
end
|
366
414
|
end
|