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

   <!-- Greeting -->
   Hey @thiDucTran! I'm here to help you with any questions or issues you have. 
Let's work together to solve the problem.
   
   <!-- Answer -->
   Yes, it is expected behavior for the `pipeline_id`, `repo_url`, and 
`commit_sha` parameters in the webhook plugin for deployments to allow `<no 
value>` or null.
   
   - The `pipeline_id` field is marked as required and cannot be null or empty.
   - The `repo_url` and `commit_sha` fields are not marked as required, but at 
least one of them must be provided.
   
   Here is the relevant code snippet:
   
   ```go
   if request.DeploymentCommits == nil {
       if request.CommitSha == "" || request.RepoUrl == "" {
           return errors.Convert(fmt.Errorf("commit_sha or repo_url is 
required"))
       }
       // create a deployment_commit record
       deploymentCommit := &devops.CicdDeploymentCommit{
           DomainEntity: domainlayer.DomainEntity{
               Id: GenerateDeploymentCommitId(connection.ID, 
request.PipelineId, request.RepoUrl, request.CommitSha),
           },
           // other fields...
       }
       // other logic...
   }
   ```
   
   This ensures that while `pipeline_id` is mandatory, `repo_url` and 
`commit_sha` can be null or empty, but at least one of them must be provided 
<sup>[[1]](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/webhook/api/deployments.go)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   <details open>
   <summary>
   
   #### Details
   </summary>
   
   **About Dosu**
   This response is meant to be useful and save you time. It is **not meant to 
be a precise solution**, but rather a starting point for your own research.
   
   Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is 
irrelevant.
   </details>
   
   *To continue the conversation, mention @dosu.*
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to