You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add GitHub integration controller for GitLab projects.
This adds a new IntegrationGithub managed resource that allows users to
manage GitLab's GitHub integration declaratively via Kubernetes. The
implementation follows the same pattern as the existing Mattermost integration.
@mjtbdl thanks for the PR, this is a useful addition. I took another pass over the diff and the surrounding controller/client flow and I think there are still a few issues we should address before merge:
Finalization currently skips the actual remote delete Observe() returns ResourceExists: false as soon as meta.WasDeleted(cr) is true.
In crossplane-runtime, Delete() is only called during finalization when observation.ResourceExists && policy.ShouldDelete().
With the current logic, a deleted IntegrationGithub can lose its finalizer without ever calling DeleteGithubService(), so the GitLab integration may stay enabled remotely.
Token-only changes will never reconcile IsIntegrationGithubUpToDate() ignores token, which means rotating spec.forProvider.token does not make the resource out-of-date.
Since the token is write-only and GitLab does not return it, this means token rotation is effectively a no-op unless some other compared field changes as well.
The new resource is not packaged yet
I don’t see the generated package CRDs in this PR:
Without those, the published provider package will not install the new IntegrationGithub resource at all.
The CRD currently allows specs that can only fail at reconcile time repositoryUrl is optional in the API, and an empty token still passes schema validation, but SetGithubService needs real setup inputs.
So right now users can submit manifests Kubernetes accepts, while the controller can only fail later against the GitLab API.
It would be better to enforce that in schema/validation, or at least reject it explicitly before making the API call.
EDIT: Furthermore ci is failing and you probably need to rebase because of the trivy github action.. sorry for that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add GitHub integration controller for GitLab projects.
This adds a new
IntegrationGithubmanaged resource that allows users tomanage GitLab's GitHub integration declaratively via Kubernetes. The
implementation follows the same pattern as the existing Mattermost integration.
New files:
Fixes #289
I have:
make reviewable testto ensure this PR is ready for review.How has this code been tested
Unit tests added for all client helper functions and controller operations
(Observe, Create, Update, Delete). All tests pass with
go test ./....