)]}'
{"watcher/decision_engine/audit/pipeline.py":[{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"c337a1e72c74907ad5beafaeac7d81029973eea0","unresolved":false,"context_lines":[{"line_number":161,"context_line":"            # State already CANCELLED in DB"},{"line_number":162,"context_line":"            pass"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        except Exception as e:"},{"line_number":165,"context_line":"            LOG.exception(\"Pipeline %s failed: %s\", pipeline.uuid, e)"},{"line_number":166,"context_line":"            notifications.audit_pipeline.send_action_notification("},{"line_number":167,"context_line":"                context,"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfef014e_fc956454","line":164,"updated":"2026-08-06 19:24:16.000000000","message":"pre_execute raises exception.AuditPipelineCancelled when the pipeline is already CANCELLED, but execute() does not catch this exception explicitly. It falls through to the broad \u0027except Exception\u0027 handler which sets state to FAILED and sends an ERROR notification. This is inconsistent with the an...\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: A pipeline that was already cancelled by an administrator or concurrent process will be transitioned to FAILED state instead of remaining CANCELLED. This produces misleading status, incorrect ERROR notifications, and confuses operators who expect the pipeline to remain in its cancelled state.\n\n**Priority**: Before merge\n**Why This Matters**: A pipeline that was already cancelled by an administrator or concurrent process will be transitioned to FAILED state instead of remaining CANCELLED. This produces misleading status, incorrect ERROR notifications, and confuses operators who expect the pipeline to remain in its cancelled state.\n\n**Recommendation**:\nAdd an explicit \u0027except exception.AuditPipelineCancelled\u0027 handler before the \u0027except Exception\u0027 handler in execute(), mirroring the pattern in base.py\u0027s AuditHandler for AuditCancelled. For example: \u0027except exception.AuditPipelineCancelled: LOG.info(\"Pipeline %s was already cancelled\", pipeline.uuid)\u0027","commit_id":"811bd92cc4b9dab05660464ccfe2e143e2ef2d62"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"c456c8681bc5769da9535c4c2d21b01ba25cb1aa","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        fresh \u003d objects.AuditPipeline.get_by_uuid("},{"line_number":70,"context_line":"            context, pipeline.uuid, eager\u003dTrue"},{"line_number":71,"context_line":"        )"},{"line_number":72,"context_line":"        if fresh.state \u003d\u003d objects.audit.State.CANCELLED:"},{"line_number":73,"context_line":"            raise exception.AuditPipelineCancelled(uuid\u003dpipeline.uuid)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        pipeline.hostname \u003d CONF.host"}],"source_content_type":"text/x-python","patch_set":2,"id":"9cd8077b_0ef91c4d","line":72,"updated":"2026-08-07 20:09:52.000000000","message":"pre_execute checks fresh.state \u003d\u003d objects.audit.State.CANCELLED, using the State class from the Audit object rather than the AuditPipeline object. While both currently resolve to the string \u0027CANCELLED\u0027, referencing the wrong model\u0027s State enum is a semantic mismatch that will silently break if th...\n\n**Severity**: SUGGESTION | **Confidence**: 0.8\n\n**Benefit**: Currently functionally equivalent since both resolve to \u0027CANCELLED\u0027. If audit.State.CANCELLED and audit_pipeline.State.CANCELLED ever diverge (e.g., different lifecycle requirements), the cancellation check in pre_execute would silently stop working.\n\n**Recommendation**:\nChange line 72 to use objects.audit_pipeline.State.CANCELLED for consistency with do_execute (line 102) and all other state references in the same file.","commit_id":"5000eb5318e616f8ecebd2b3cd8f9f8ae856cc34"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"c456c8681bc5769da9535c4c2d21b01ba25cb1aa","unresolved":false,"context_lines":[{"line_number":152,"context_line":"                phase\u003dwfields.NotificationPhase.END,"},{"line_number":153,"context_line":"            )"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        except exception.ActionPlanIsOngoing as e:"},{"line_number":156,"context_line":"            LOG.warning(\"Pipeline %s cancelled: %s\", pipeline.uuid, e)"},{"line_number":157,"context_line":"            pipeline.state \u003d objects.audit_pipeline.State.CANCELLED"},{"line_number":158,"context_line":"            pipeline.save()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ab02bd3_6e2b0642","line":155,"updated":"2026-08-07 20:09:52.000000000","message":"pre_execute() raises exception.AuditPipelineCancelled when it detects the pipeline is already in CANCELLED state. However, execute() only catches _PipelineCancelled (the internal sentinel) for the pass-through case. AuditPipelineCancelled is a WatcherException subclass, not _PipelineCancelled, so...\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: A pipeline cancelled by an operator before execution begins will have its state overwritten from CANCELLED to FAILED. This misleads operators about why the pipeline did not run, pollutes monitoring/dashboards with spurious FAILED pipelines, and may trigger failure-handling logic (notifications, r...\n\n**Priority**: Before merge\n**Why This Matters**: A pipeline cancelled by an operator before execution begins will have its state overwritten from CANCELLED to FAILED. This misleads operators about why the pipeline did not run, pollutes monitoring/dashboards with spurious FAILED pipelines, and may trigger failure-handling logic (notifications, r...\n\n**Recommendation**:\nAdd an explicit except clause for exception.AuditPipelineCancelled (or catch it alongside _PipelineCancelled) that preserves the CANCELLED state without setting FAILED. For example: except (exception.AuditPipelineCancelled, _PipelineCancelled): pass since the state is already CANCELLED in the database.","commit_id":"5000eb5318e616f8ecebd2b3cd8f9f8ae856cc34"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"c456c8681bc5769da9535c4c2d21b01ba25cb1aa","unresolved":false,"context_lines":[{"line_number":157,"context_line":"            pipeline.state \u003d objects.audit_pipeline.State.CANCELLED"},{"line_number":158,"context_line":"            pipeline.save()"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        except _PipelineCancelled:"},{"line_number":161,"context_line":"            # State already CANCELLED in DB"},{"line_number":162,"context_line":"            pass"},{"line_number":163,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"37e067ad_bd02c393","line":160,"updated":"2026-08-07 20:09:52.000000000","message":"When _PipelineCancelled is raised from do_execute() during stage iteration, the EXECUTION START notification has already been sent, but neither an END nor an ERROR notification is emitted for the cancellation. Notification consumers will see an unpaired START event with no terminal signal.\n\n**Severity**: WARNING | **Confidence**: 0.8\n\n**Impact**: External systems consuming audit_pipeline notifications (e.g., telemetry, event processing, monitoring dashboards) will see a START without a matching END or ERROR for cancelled pipelines, making it impossible to distinguish a still-running pipeline from a cancelled one.\n\n**Suggestion**:\nIn the _PipelineCancelled except block, emit a terminal notification (either END or a dedicated CANCELLED/error notification) so consumers receive a lifecycle-complete event sequence. For example, send an ERROR or END notification with an appropriate priority.","commit_id":"5000eb5318e616f8ecebd2b3cd8f9f8ae856cc34"}],"watcher/decision_engine/strategy/context/cascade.py":[{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"c337a1e72c74907ad5beafaeac7d81029973eea0","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            strategy.input_parameters.update(parameters)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        # 3. Initializez the strategy by calling its pre_execute method"},{"line_number":143,"context_line":"        solution \u003d strategy.pre_execute()"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"        # 4. Sets metric data cache and run simulations from previous solutions"},{"line_number":146,"context_line":"        if strategy.get_datasource_metrics():"}],"source_content_type":"text/x-python","patch_set":1,"id":"adedffb7_d21a3e67","line":143,"updated":"2026-08-06 19:24:16.000000000","message":"In CascadePipelineContext.execute_stage, pre_execute() is called explicitly at line 143, then strategy.execute() is called at line 160. The base Strategy.execute() method internally calls self.pre_execute() before do_execute and post_execute. This results in pre_execute() being invoked twice per...\n\n**Severity**: SUGGESTION | **Confidence**: 0.8\n\n**Benefit**: Calling pre_execute() twice wastes computation and may produce duplicate log messages, duplicate deprecation warnings, or inconsistent state for strategies whose pre_execute has non-idempotent side effects. The dead \u0027solution \u003d \u0027 assignment at line 143 reduces readability.\n\n**Recommendation**:\nEither remove the explicit pre_execute() call at line 143 (if the metric cache setup between lines 143-151 does not depend on pre_execute side effects), or replace strategy.execute() at line 160 with direct calls to do_execute() and post_execute() if the explicit pre_execute is intentional.","commit_id":"811bd92cc4b9dab05660464ccfe2e143e2ef2d62"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"c456c8681bc5769da9535c4c2d21b01ba25cb1aa","unresolved":false,"context_lines":[{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        try:"},{"line_number":279,"context_line":"            instance \u003d compute_model.get_instance_by_uuid(resource_id)"},{"line_number":280,"context_line":"        except Exception:"},{"line_number":281,"context_line":"            LOG.debug(\"CDM lookup failed for instance %s\", resource_id)"},{"line_number":282,"context_line":"            return"},{"line_number":283,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5c5d38c1_811fd013","line":280,"updated":"2026-08-07 20:09:52.000000000","message":"The _simulate_migration_metrics method uses four separate \u0027except Exception\u0027 clauses to guard CDM lookups and metric fetching. The same file already uses specific exceptions (InstanceNotFound, ComputeNodeNotFound) in _apply_migration (lines 216, 235), demonstrating that concrete exception types a...\n\n**Severity**: WARNING | **Confidence**: 0.8\n\n**Impact**: Overly broad exception handling may silently swallow unexpected errors (e.g., programming errors, database connectivity issues) that should propagate or be logged differently. It also makes debugging harder since the actual exception type is not visible in the code structure.\n\n**Suggestion**:\nReplace \u0027except Exception\u0027 with specific exception types. For CDM lookups, use exception.InstanceNotFound and exception.ComputeNodeNotFound (matching the pattern in _apply_migration). For _fetch_metric, catch the datasource-specific aggregation error or at minimum use oslo-based exception types.","commit_id":"5000eb5318e616f8ecebd2b3cd8f9f8ae856cc34"}]}
