Skip to content

GitHub commit status fails when sync revision is unavailable #29575

Description

@enzv

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

When Argo CD Notifications publishes GitHub commit statuses, an on-sync-failed notification cannot be completed if the Application fails early during manifest generation or comparison.

The failure trigger is evaluated correctly:

app.status.operationState.phase = Error

and the notifications controller reports:

Trigger 'on-sync-failed' TRIGGERED

However, for this type of early failure:

app.status.operationState.syncResult.revision

is empty.

If the GitHub notification template uses that field as revisionPath, the controller attempts to call the GitHub commit status endpoint without a revision:

POST https://api.github.com/repos/example-org/example-repo/statuses/

GitHub then returns:

404 Not Found

The same notification configuration works when a sync succeeds because syncResult.revision contains the resolved Git revision.

To Reproduce

  1. Configure Argo CD Notifications with the GitHub notification service.

  2. Configure a failure template:

template.app-reconciled-failed: |
  github:
    repoURLPath: "{{.app.spec.source.repoURL}}"
    revisionPath: "{{.app.status.operationState.syncResult.revision}}"
    status:
      state: failure
      label: "continuous-delivery/{{.app.metadata.name}}"
  1. Configure the on-sync-failed trigger:
trigger.on-sync-failed: |
  - description: Application sync failed
    when: app.status.operationState.phase in ['Error', 'Failed']
    send:
      - app-reconciled-failed
  1. Create an Application that tracks a Git repository.

  2. Commit a manifest that causes manifest generation to fail before a sync result is produced. For example:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: example-app
  annotations:
    example.com/invalid-annotation:
spec:
  selector:
    matchLabels:
      app: example-app
  template:
    metadata:
      labels:
        app: example-app
    spec:
      containers:
        - name: example
          image: nginx
  1. Reconcile or sync the Application.

  2. Observe that the Application reaches a state similar to:

Operation phase    : Error
Sync status        : Unknown
Sync revision      : <branch-name>
Requested revision :
Result revision    :
  1. Observe the notifications controller logs:
Trigger 'on-sync-failed' TRIGGERED | revision:  | templates:
[app-reconciled-failed]

Sending notification about condition 'on-sync-failed.[0]...' to '{github }'

Failed to notify recipient {github }:
POST https://api.github.com/repos/example-org/example-repo/statuses/: 404 Not Found []

Expected behavior

When on-sync-failed is triggered because an Application fails during manifest generation or comparison, the GitHub commit status notification should still be able to associate the failure with the Git revision that caused the reconciliation.

At minimum, the notification controller should not issue a GitHub commit status request with an empty revision.

Screenshots

Not required for reproduction.

Version

argocd: v3.0.5+af9ebac
  BuildDate: 2025-05-29T18:05:04Z
  GitCommit: af9ebac0bb35dc16eb034c1cefaf7c92d1029927
  GitTreeState: clean
  GoVersion: go1.24.1
  Compiler: gc
  Platform: windows/amd64
argocd-server: v3.5.2

Logs

Trigger 'on-deployed' FAILED | revision:  | templates:
[app-reconciled]

Trigger 'on-sync-failed' TRIGGERED | revision:  | templates:
[app-reconciled-failed]

Sending notification about condition 'on-sync-failed.[0]...' to '{github }'

Failed to notify recipient {github }:
POST https://api.github.com/repos/example-org/example-repo/statuses/: 404 Not Found []

Processing completed

Relevant Application state:

Operation phase    : Error
Sync status        : Unknown
Sync revision      : <branch-name>
Requested revision :
Result revision    :

Relevant condition:

ComparisonError
Failed to load target state: failed to generate manifest for source 1 of 1:
manifest generation error caused by an invalid non-string/null annotation value.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage/pendingThis issue needs further triage to be correctly classified

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions