Skip to content

Conversation

mahdibouaziz
Copy link

PR Description

This PR addresses Issue #388, which affects GitHub CheckRun notifications in argocd-notifications.

Two problems were identified:
1.started_at and completed_at fields failed to parse due to an incorrect time layout.
2. The status and conclusion fields were omitted from the GitHub CheckRun payload, causing validation errors.

Fix Details

  • Replaced the hardcoded invalid time layout "YYYY-MM-DDTHH:MM:SSZ" with the standard time.RFC3339 layout for parsing started_at and completed_at.
  • Explicitly included the status and conclusion fields in the payload sent to the GitHub CheckRun API.

Impact

This fix ensures that GitHub CheckRun notifications are correctly formatted and accepted by GitHub, restoring proper CI/CD deployment reporting.

Fixes #388

Signed-off-by: Mahdi Bouaziz <[email protected]>
Signed-off-by: Mahdi Bouaziz <[email protected]>
Signed-off-by: Mahdi Bouaziz <[email protected]>
@mahdibouaziz mahdibouaziz force-pushed the github-time-parsing-and-missing-fields branch from 5dd491e to 07cb3a1 Compare July 12, 2025 07:10
@mahdibouaziz
Copy link
Author

@crenshaw-dev @pasha-codefresh Can you take a look ?

@mahdibouaziz
Copy link
Author

@blakepettersson can you take a look ?

return err
}
completedTime, err := time.Parse("YYYY-MM-DDTHH:MM:SSZ", notification.GitHub.CheckRun.CompletedAt)
completedTime, err := time.Parse(time.RFC3339, notification.GitHub.CheckRun.CompletedAt)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think completedTime should be optional, so it will work when the Status is in_progress and completedTime shouldn't be set yet

Name: notification.GitHub.CheckRun.Name,
DetailsURL: &notification.GitHub.CheckRun.DetailsURL,
Status: &notification.GitHub.CheckRun.Status,
Conclusion: &notification.GitHub.CheckRun.Conclusion,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same here, need to make sure it can work when Conclusion is not set, because:

Required if you provide completed_at or a status of completed. The final conclusion of the check. Note: Providing conclusion will automatically set the status parameter to completed. You cannot change a check run conclusion to stale, only GitHub can set this.

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.

Bug: GitHub CheckRun Notification Fails Due to Invalid Timestamp Format and Missing Fields

2 participants