dosubot[bot] commented on issue #8291:
URL: 
https://github.com/apache/incubator-devlake/issues/8291#issuecomment-2657389866

   <!-- Answer -->
   Yes, the skipped stages should be ignored when determining if a deployment 
has an environment task. The `GenerateDeployment` method already accounts for 
this by using the `noneSkippedResult` variable, which includes only 
`devops.RESULT_FAILURE` and `devops.RESULT_SUCCESS`. This ensures that only 
non-skipped tasks are considered when checking for testing, staging, or 
production tasks:
   
   ```go
   noneSkippedResult := []string{devops.RESULT_FAILURE, devops.RESULT_SUCCESS}
   ```
   
   The SQL query uses this variable to filter tasks:
   
   ```sql
   EXISTS(SELECT 1 FROM cicd_tasks t WHERE t.pipeline_id = p.id AND 
t.environment = ? AND t.result IN ?)
   ```
   
   This logic ensures that only tasks with results in `noneSkippedResult` are 
considered, effectively ignoring skipped stages. Additionally, the method 
handles the environment determination by checking for the presence of 
production, staging, or testing tasks and assigns the environment accordingly, 
ensuring that skipped tasks do not affect this logic 
<sup>[[1]](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/dora/tasks/deployment_generator.go)</sup><sup>[[2]](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/dora/tasks/deployment_commits_generator.go)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   
   ---
   <sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/c68e0f78-c5d7-405b-bc4e-d603f2724508?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/c68e0f78-c5d7-405b-bc4e-d603f2724508?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/c68e0f78-c5d7-405b-bc4e-d603f2724508?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/c68e0f78-c5d7-405b-bc4e-d603f2724508?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/c68e0f78-c5d7-405b-bc4e-d603f2724508?feedback_type=hallucination)
 | 
[Other](https://app.dosu.dev/response-feedback/c68e0f78-c5d7-405b-bc4e-d603f2724508?feedback_type=other)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/c68e0f78-c5d7-405b-bc4e-d603f2724508?feedback_type=bug_report)</sup>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@devlake.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to