Skip to content

feat: support multiple GitHub Apps#116

Draft
isometry wants to merge 3 commits intomainfrom
feature/multi-app-support
Draft

feat: support multiple GitHub Apps#116
isometry wants to merge 3 commits intomainfrom
feature/multi-app-support

Conversation

@isometry
Copy link
Copy Markdown
Owner

This pull request introduces a major new feature: support for managing multiple GitHub App credentials using a new App custom resource, enabling per-tenant or per-org credentials in addition to the existing startup configuration. It also updates the CRD API, documentation, and developer workflow to reflect this enhancement, and adds comprehensive tests for the new and modified behaviors.

New multi-App support and CRD changes:

  • Introduced a new App CRD (api/v1/app_types.go, api/v1/appref.go) that allows users to define GitHub App credentials as first-class Kubernetes resources, supporting both cloud KMS-backed and Secret-backed keys. This enables per-tenant or per-namespace credential management and is referenced from Token and ClusterToken resources via appRef. [1] [2]
  • Updated Token and ClusterToken CRDs to support referencing the new App resources using spec.appRef, with appropriate handling for namespaced and cluster-scoped scenarios. Existing tokens continue to work without changes. [1] [2]

Documentation updates:

  • Expanded the README.md with a new section on managing multiple GitHub Apps using the App CRD, including detailed usage instructions, YAML examples for both Secret- and KMS-backed Apps, migration notes, and security considerations. The feature matrix and sample manifests were also updated to reflect the new capabilities. [1] [2] [3]

Status and condition improvements:

  • Added new status condition types and reasons (e.g., KeyValid, AppNotFound, AppNotReady, etc.) for better observability and troubleshooting of App and Token reconciliation.

Developer workflow enhancements:

  • Updated the Makefile and documentation to clarify the requirement for POD_NAMESPACE when running the controller locally, and improved the developer experience by defaulting it for make run. [1] [2] [3]

Testing:

  • Added new unit tests for the App resource's status condition logic and for the correct resolution of appRef in both Token and ClusterToken resources.

- Introduce `App` CRD (api/v1/app_types.go) for namespaced GitHub App
  config
- Add `appRef` to Token and ClusterToken CRDs/specs for referencing App
- Implement App controller and registry for per-App ghait client caching
- Update RBAC, Helm chart, and CRD manifests for App support
- Add tests for App logic and registry caching
- Bump chart version to 0.4.0
- Enhance metrics setup with OTEL resource attributes
- Update docs for multi-tenancy and observability
generics

- Extract shared reconciliation logic for Token and ClusterToken into
  generic helpers in internal/controller/reconcile_token.go
- Introduce TokenReconcilerBase for shared dependencies
- Add controller name constants in internal/controller/names.go
- Refactor main.go to use TokenReconcilerBase
- Remove unused ghapp/context.go and ghapp/ghapp.go
- Refactor Registry to use functional options for testability
- Simplify e2e test helpers for Token creation
- Remove redundant TokenSpec tests
- Remove unused GetName methods from Token and ClusterToken types
- Remove HasStartupConfig from ghapp.Registry and related test
- Remove commented and scaffolding code from CRDs and API types
- Refactor tokenmanager to simplify tokenSecret construction and context
  usage
- Update controller and tokenmanager to use new tokenSecret API
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