Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Bug Report
description: Report a problem with the Helm chart
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thanks for reporting a bug! Please fill out the sections below.
- type: input
id: chart-version
attributes:
label: Chart Version
placeholder: e.g. 1.2.3
validations:
required: true
- type: input
id: helm-version
attributes:
label: Helm Version
placeholder: e.g. 3.15.0
validations:
required: true
- type: input
id: k8s-version
attributes:
label: Kubernetes Version
placeholder: e.g. 1.30.2
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: What happened? What did you expect?
validations:
required: true
- type: textarea
id: values
attributes:
label: Relevant values.yaml overrides
render: yaml
- type: textarea
id: logs
attributes:
label: Relevant logs or error output
render: text
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Feature Request
description: Suggest a new feature or improvement
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thanks for suggesting a feature! Please describe what you'd like.
- type: textarea
id: problem
attributes:
label: Problem or motivation
description: What problem does this solve? Why is it needed?
validations:
required: true
- type: textarea
id: solution
attributes:
label: Proposed solution
description: How would you like this to work?
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Any workarounds or alternative approaches you've considered?
25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Description

<!-- Briefly describe the changes introduced by this PR. -->

## Type of Change

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation update
- [ ] Chore (refactoring, CI changes, dependency updates, etc.)

## Checklist

- [ ] My commits follow the [Conventional Commits](https://www.conventionalcommits.org/) format
- [ ] I have run `helm lint .` and it passes
- [ ] I have run `helm unittest .` and all tests pass
- [ ] I have run `helm schema` and the schema is up to date
- [ ] I have added/updated unit tests for any new or changed templates
- [ ] I have updated documentation (README, CONTRIBUTING, values comments) if needed

## Related Issues

<!-- Link related issues: Fixes #123, Relates to #456 -->

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM --platform=$BUILDPLATFORM golang:1.25 AS builder
FROM --platform=$BUILDPLATFORM golang:1.26 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions api/v1alpha1/organization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,13 @@ type OrganizationSpec struct {
// Description is a human-readable description of the organization.
// This appears on the organization's GitHub profile page.
Description string `json:"description"`

// Plan indicates the GitHub plan tier for this organization (enterprise, team, or free).
// Determines whether Enterprise-only features (e.g., custom properties, runner groups) are reconciled or skipped.
// +kubebuilder:validation:Enum=enterprise;team;free
// +kubebuilder:default=enterprise
// +optional
Plan string `json:"plan,omitempty"`
}

// OrganizationStatus defines the observed state of Organization.
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/github.interhyp.de_organizations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,16 @@ spec:
minLength: 1
pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,99}$
type: string
plan:
default: enterprise
description: |-
Plan indicates the GitHub plan tier for this organization (enterprise, team, or free).
Determines whether Enterprise-only features (e.g., custom properties, runner groups) are reconciled or skipped.
enum:
- enterprise
- team
- free
type: string
rulesetPresets:
description: |-
RulesetPresetList references RulesetPreset CRDs that define repository rulesets for this organization.
Expand Down
1 change: 1 addition & 0 deletions docs/techdocs/crds.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ _Appears in:_
| `codeSecurityConfigurations` _[AttachableCodeSecurityConfigurationRef](#attachablecodesecurityconfigurationref) array_ | CodeSecurityConfigurations lists code security configurations to create and optionally attach to repositories.<br />Each configuration defines security features like dependency scanning, secret scanning, and code scanning.<br />See: https://docs.github.com/en/rest/code-security/configurations | | |
| `rulesetPresets` _[LocalObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#localobjectreference-v1-core) array_ | RulesetPresetList references RulesetPreset CRDs that define repository rulesets for this organization.<br />Rulesets enforce policies like branch protection, required reviews, and status checks.<br />See: https://docs.github.com/en/rest/orgs/rules | | |
| `description` _string_ | Description is a human-readable description of the organization.<br />This appears on the organization's GitHub profile page. | | |
| `plan` _string_ | Plan indicates the GitHub plan tier for this organization (enterprise, team, or free).<br />Determines whether Enterprise-only features (e.g., custom properties, runner groups) are reconciled or skipped. | enterprise | Enum: [enterprise team free] <br />Optional: \{\} <br /> |


#### OrganizationStatus
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Interhyp/git-hubby

go 1.25.7
go 1.26.3

require (
github.com/PuerkitoBio/rehttp v1.4.0
Expand Down
3 changes: 1 addition & 2 deletions internal/controller/organization_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"github.com/Interhyp/git-hubby/internal/reconciler/reconcilerfactory"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/util/workqueue"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/handler"
Expand Down Expand Up @@ -125,7 +124,7 @@ func (r *OrganizationCtl) SetupWithManager(mgr ctrl.Manager) error {
).
WithEventFilter(predicate.Or(predicate.GenerationChangedPredicate{}, predicate.AnnotationChangedPredicate{})).
WithOptions(controller.Options{
UsePriorityQueue: ptr.To[bool](true),
UsePriorityQueue: new(true),
RateLimiter: workqueue.NewTypedMaxOfRateLimiter(
workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](
1*time.Second, // base delay
Expand Down
8 changes: 4 additions & 4 deletions internal/controller/organization_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ var _ = Describe("Organization Controller - Integration Tests", func() {
return &github.Organization{
Login: github.Ptr(orgName),
Name: github.Ptr(orgName),
Description: github.Ptr("Test organization for unit tests"),
Description: new("Test organization for unit tests"),
}, nil
}
mockClient.GetAllOrganizationCustomPropertiesFunc = func(ctx context.Context, org string) ([]*github.CustomProperty, error) {
Expand Down Expand Up @@ -108,7 +108,7 @@ var _ = Describe("Organization Controller - Integration Tests", func() {
return &github.Organization{
Login: github.Ptr(orgName),
Name: github.Ptr(orgName),
Description: github.Ptr("Test organization for unit tests"),
Description: new("Test organization for unit tests"),
}, nil
}
mockClient.GetAllOrganizationCustomPropertiesFunc = func(ctx context.Context, org string) ([]*github.CustomProperty, error) {
Expand Down Expand Up @@ -148,7 +148,7 @@ var _ = Describe("Organization Controller - Integration Tests", func() {
return &github.Organization{
Login: github.Ptr(orgName),
Name: github.Ptr(orgName),
Description: github.Ptr("Test organization for unit tests"),
Description: new("Test organization for unit tests"),
}, nil
}
mockClient.GetAllOrganizationCustomPropertiesFunc = func(ctx context.Context, org string) ([]*github.CustomProperty, error) {
Expand Down Expand Up @@ -194,7 +194,7 @@ var _ = Describe("Organization Controller - Integration Tests", func() {
return &github.Organization{
Login: github.Ptr(orgName),
Name: github.Ptr(orgName),
Description: github.Ptr("Test organization"),
Description: new("Test organization"),
}, nil
}
mockClient.GetAllOrganizationCustomPropertiesFunc = func(ctx context.Context, org string) ([]*github.CustomProperty, error) {
Expand Down
3 changes: 1 addition & 2 deletions internal/controller/repository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/google/go-github/v86/github"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/util/workqueue"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/predicate"
Expand Down Expand Up @@ -189,7 +188,7 @@ func (r *RepositoryCtl) SetupWithManager(mgr ctrl.Manager) error {
).
WithEventFilter(predicate.Or(predicate.GenerationChangedPredicate{}, predicate.AnnotationChangedPredicate{})).
WithOptions(controller.Options{
UsePriorityQueue: ptr.To[bool](true),
UsePriorityQueue: new(true),
MaxConcurrentReconciles: 20,
RateLimiter: workqueue.NewTypedMaxOfRateLimiter(
workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](
Expand Down
52 changes: 26 additions & 26 deletions internal/controller/repository_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var _ = Describe("Repository Controller - Integration Tests", func() {
testEnv.CreateTestNamespace(namespaceName)
testEnv.CreateSecret(namespaceName, secretName)
organization = testEnv.SetupOrganizationTest(nil, namespaceName, orgName)
organization.Spec.ActionsSettings.EnabledRepositories = github.Ptr("all")
organization.Spec.ActionsSettings.EnabledRepositories = new("all")
Expect(testEnv.Client.Update(testEnv.Context, organization)).To(Succeed())
})

Expand Down Expand Up @@ -94,12 +94,12 @@ var _ = Describe("Repository Controller - Integration Tests", func() {
By("Setting up mock to return existing repository")
mockClient.GetRepositoryFunc = func(ctx context.Context, owner, repo string) (*github.Repository, error) {
return &github.Repository{
ID: github.Ptr(int64(12345)),
ID: new(int64(12345)),
Name: github.Ptr(repoName),
FullName: github.Ptr(owner + "/" + repo),
Owner: &github.User{Login: github.Ptr(owner)},
Archived: github.Ptr(false),
Visibility: github.Ptr("internal"),
FullName: new(owner + "/" + repo),
Owner: &github.User{Login: new(owner)},
Archived: new(false),
Visibility: new("internal"),
}, nil
}

Expand Down Expand Up @@ -189,27 +189,27 @@ var _ = Describe("Repository Controller - Integration Tests", func() {
By("Setting up mock to return repository with ID")
mockClient.GetRepositoryFunc = func(ctx context.Context, owner, repo string) (*github.Repository, error) {
return &github.Repository{
ID: github.Ptr(int64(99999)),
ID: new(int64(99999)),
Name: github.Ptr(repoName),
FullName: github.Ptr(owner + "/" + repo),
Owner: &github.User{Login: github.Ptr(owner)},
Archived: github.Ptr(false),
Visibility: github.Ptr("internal"),
HasIssues: github.Ptr(true),
HasProjects: github.Ptr(false),
HasWiki: github.Ptr(false),
HasDownloads: github.Ptr(false),
IsTemplate: github.Ptr(false),
AutoInit: github.Ptr(true),
AllowSquashMerge: github.Ptr(false),
AllowRebaseMerge: github.Ptr(false),
AllowMergeCommit: github.Ptr(false),
DeleteBranchOnMerge: github.Ptr(true),
MergeCommitTitle: github.Ptr("MERGE_MESSAGE"),
MergeCommitMessage: github.Ptr("PR_TITLE"),
Homepage: github.Ptr(""),
Description: github.Ptr(""),
DefaultBranch: github.Ptr(""),
FullName: new(owner + "/" + repo),
Owner: &github.User{Login: new(owner)},
Archived: new(false),
Visibility: new("internal"),
HasIssues: new(true),
HasProjects: new(false),
HasWiki: new(false),
HasDownloads: new(false),
IsTemplate: new(false),
AutoInit: new(true),
AllowSquashMerge: new(false),
AllowRebaseMerge: new(false),
AllowMergeCommit: new(false),
DeleteBranchOnMerge: new(true),
MergeCommitTitle: new("MERGE_MESSAGE"),
MergeCommitMessage: new("PR_TITLE"),
Homepage: new(""),
Description: new(""),
DefaultBranch: new(""),
}, nil
}

Expand Down
3 changes: 1 addition & 2 deletions internal/controller/team_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"github.com/Interhyp/git-hubby/internal/reconciler/reconcilerfactory"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/util/workqueue"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
Expand Down Expand Up @@ -99,7 +98,7 @@ func (r *TeamCtl) SetupWithManager(mgr ctrl.Manager) error {
For(&githubv1alpha1.Team{}).
WithEventFilter(predicate.Or(predicate.GenerationChangedPredicate{}, predicate.AnnotationChangedPredicate{})).
WithOptions(controller.Options{
UsePriorityQueue: ptr.To[bool](true),
UsePriorityQueue: new(true),
MaxConcurrentReconciles: 20,
RateLimiter: workqueue.NewTypedMaxOfRateLimiter(
workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](
Expand Down
22 changes: 11 additions & 11 deletions internal/controller/team_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ var _ = Describe("TeamController", func() {
return &github.Team{
Name: github.Ptr(teamName),
Slug: github.Ptr(teamName),
Description: github.Ptr(""),
Privacy: github.Ptr("closed"),
Permission: github.Ptr("pull"),
NotificationSetting: github.Ptr("notifications_disabled"),
Description: new(""),
Privacy: new("closed"),
Permission: new("pull"),
NotificationSetting: new("notifications_disabled"),
}, nil
}

Expand All @@ -181,21 +181,21 @@ var _ = Describe("TeamController", func() {
return &github.Team{
Name: github.Ptr(teamName),
Slug: github.Ptr(teamName),
Description: github.Ptr(""),
Privacy: github.Ptr("closed"),
Permission: github.Ptr("pull"),
NotificationSetting: github.Ptr("notifications_disabled"),
Description: new(""),
Privacy: new("closed"),
Permission: new("pull"),
NotificationSetting: new("notifications_disabled"),
}, nil
}
mockClient.ListMembersFunc = func(ctx context.Context, org string) ([]*github.User, error) {
return []*github.User{
{Login: github.Ptr("new-member_memberSuffix")},
{Login: github.Ptr("existing-member_memberSuffix")},
{Login: new("new-member_memberSuffix")},
{Login: new("existing-member_memberSuffix")},
}, nil
}
mockClient.GetAllTeamMembersFunc = func(ctx context.Context, org string, slug string) ([]*github.User, error) {
return []*github.User{
{Login: github.Ptr("existing-member_memberSuffix")},
{Login: new("existing-member_memberSuffix")},
}, nil
}

Expand Down
Loading
Loading