Repository navigation
feat: support mattermost group level integration - #414
henrysachs merged 9 commits into
Conversation
Signed-off-by: BoxBoxJason <contact@boxboxjason.dev>
Signed-off-by: BoxBoxJason <contact@boxboxjason.dev>
|
Hi @BoxBoxJason, thank you so much for this! Group-level Mattermost has been wanted for a while (#320), and this is a really thorough contribution:
Taking you up on the splitThanks for offering! I'd love to keep this PR to the group Mattermost resource (the small project-level fixes can stay) and move the write-only secret tracking to a follow-up. Two reasons:
The Mattermost resource is useful without it. A few notes for that follow-up are at the end. Before merging1. Inheritance isn't sent or compared
2.
3. Comparison tests. Only 4 of the 26 compared fields have a "differs" case. Removing the 4. Empty webhook. It's omitted from the request "so that existing remote state is not cleared", but GitLab requires Smaller things
Notes for the secret-tracking follow-up
Checked and correct
Thanks again for all the work here. Happy to help or review the follow-up! |
Signed-off-by: Henry Sachs <henry.sachs@deutschebahn.com>
master moved to client-go v3 (crossplane-contrib#419), so the new group Mattermost files no longer compiled. Only the import path changes; the group integration API is the same in v3. Signed-off-by: Henry Sachs <henry.sachs@deutschebahn.com>
|
Hi @BoxBoxJason, heads-up: master moved to client-go v3 (#419), so I merged master into your branch and switched the eight Mattermost files to the v3 import (2f09714). Only the import path changed, so your commits are untouched and no force-push was needed. CI is green again. The review points above are still yours to decide, of course. Thanks again! |
Hey @henrysachs thanks for this very nice review, as always 😁 I started working on implementing everything last week but I didn't finish, I will finish all of that thursday. Thanks for the upgrade, I won't forget to sync my local branch before continuing 👍 |
Signed-off-by: BoxBoxJason <contact@boxboxjason.dev>
Signed-off-by: BoxBoxJason <contact@boxboxjason.dev>
Signed-off-by: BoxBoxJason <contact@boxboxjason.dev>
Signed-off-by: BoxBoxJason <contact@boxboxjason.dev>
|
Hi @BoxBoxJason, thanks for the update! Almost everything from the review is in, and it looks great. One thing came in with bd2fa8c that needs another look. Before merging: five newly compared fields never convergebd2fa8c compares I checked against a real GitLab (19.4.2-ee). After a
So once any of these fields is set in the spec, the resource is never up to date and gets updated on every poll. The unit tests don't catch it because the mocks put the values at the top level. Suggestions:
Smaller things
Checked and correct
Thanks again! |
|
Alright @henrysachs I fixed the problems you mentionned + some additional observation issues I found + some missing fields I had (added in client v3). Live tested against my gitlab instance, everything is still functionnal. For the follow up about secret change detection, I will test your (easier) suggestion out once this gets merged 😁. This should indeed be way simpler if we can use native kubernetes behaviour for that. |
newer fields nesting in api response CEL rule for inherited settings mode Signed-off-by: BoxBoxJason <contact@boxboxjason.dev>
|
Thanks a lot @BoxBoxJason, this is great work! The Merging now. To keep the history accurate, here's what's in and what isn't, since the description still mentions the secret hashing:
Looking forward to the secret-tracking follow-up. Happy to review it! |
Description of your changes
Adds a
groups.gitlab.(m.)crossplane.io/v1alpha1IntegrationMattermostmanaged resource to configure the Mattermost notifications integration of a GitLab group, modelled on the group Harbor integration.It also adds an opt-in way to detect changes to write-only secret values (such as the Mattermost webhook, passwords,...), which the GitLab API never returns, and fixes two small bugs in the project-level
IntegrationMattermosttypes.Closes #320
Group Mattermost integration
groupId/groupIdRef/groupIdSelectorand every option of the group integration API. Compared with the project-level resource it adds deployment, alert and vulnerability events and channels,labelsToBeNotified(Behavior)anduseInheritedSettings.webhookSecretRef), in the same way as Harbor'spasswordSecretRef, because the Mattermost webhook URL contains a secret token. It is never shown instatus.atProvider.make generate.Project
IntegrationMattermostfixesconfidentialNoteEventsandconfidentialNoteChannelwere swapped. The same wrong comment is also fixed on the unusedCommonIntegrationParameters.BRANCHprint column, which pointed at aspec.forProvider.branchNamefield that does not exist.I have:
make reviewable testto ensure this PR is ready for review.How has this code been tested
make reviewablepasses (generate, lint, unit tests).Observe/Create/Update/Delete, with and without a hasher:SecretHasher: HMAC output checked against the RFC 4231 test vector (case 2), key too short or missing, bad key tolerated while deleting, key rotation, merge-patch persistence, and disabled/nil behaviour.secretHashKeySecretRefis resolved for the legacy, namespacedv1beta2(pinned to the ProviderConfig namespace) andClusterProviderConfigflavors.unexpected drift. (should result in recreation of the resource if applicable)
unexpected drift. (should result in an update of the resource if applicable)