Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow GitHub InstallationID override #324

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dlactin
Copy link

@dlactin dlactin commented Jul 15, 2024

This likely needs more work, but I wanted some input before digging deeper into it.

Right now, we can use a single GitHub App Installation for these notifications; if you have other GitHub organizations which have a unique installation ID, you cannot use the GitHub service for all of them.

There are a couple of existing solutions here:

  • Use a webhook to manage PR updates, deployments, etc for smaller organizations
  • Consolidate app repositories into a single GitHub organization

I am proposing a reasonably simple change that would allow the Installation ID to be passed into the template to override the default Installation ID. This would require the installation ID to be attached to an ArgoCD application as info metadata or custom templates for each GitHub organization.

This will still use a single GitHub App, but it could be installed in multiple GitHub organizations.

ex:

template.app-deployed-github-orgname: |
  message: |
    Application {{.app.metadata.name}} is now running new version of deployments manifests.
  github:
    repoURLPath: "{{.app.spec.source.repoURL}}"
    revisionPath: "{{.app.status.operationState.syncResult.revision}}"
    installationID: "1234567"
    status:
      state: success
      label: "continuous-delivery/{{.app.metadata.name}}"
      targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
    deployment:
      state: success
      environment: production
      environmentURL: "https://{{.app.metadata.name}}.example.com"
      logURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
      requiredContexts: []
      autoMerge: true
      transientEnvironment: false
      reference: v1.0.0
    pullRequestComment:
      content: |
        Application {{.app.metadata.name}} is now running new version of deployments manifests.
        See more here: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true

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.

1 participant