Repository navigation
feat(project): expose the project feature access levels GitLab accepts - #419
markussiebert wants to merge 1 commit into
Conversation
|
Hi Markus, thanks a lot for this one as well. Closing the gap that A few things I'd love to sort out before we merge (see also my notes on #418, which this builds on): Before merging1.
2. The new tests don't exercise the new code yet
3. Older self-managed GitLab versions
4. Rebase onto master
Smaller things5. Optional: enum validation for the new fields. Nine of them accept only 6. Release note. After upgrading, these ten values are late-initialized into existing CRs. From then on the provider reverts changes made to them in the GitLab UI, which is worth calling out. 7. Nits.
What I checked and found correct
Thanks again, this fills a real gap. Happy to help with any of it. |
ff54e70 to
44913f4
Compare
6fa0e1e to
f74ce41
Compare
GitLab accepts nineteen `*_access_level` parameters on the Projects API; the Project spec covered nine of them. Ten project features were therefore not configurable through this provider at all: analytics, releases, environments, feature flags, infrastructure, monitor, package registry, security and compliance, model experiments and model registry. Five of them are what GitLab split `operations_access_level` into, so dropping that field leaves those features with no representation in the spec. All ten are create and edit parameters in GitLab's Community Edition parameter set and are exposed by the Community Edition project entity, so they round-trip on any instance. They are sent on create and update, late-initialized from the observed project, and compared in `isProjectUpToDate`. `requirementsAccessLevel` is left out on purpose: GitLab declares it only in its Enterprise Edition parameter block and the Community Edition project entity does not expose it, so on a Community Edition instance it would be dropped silently and then stay permanently out of date. `packagesEnabled` is unchanged but now documented as superseded by `packageRegistryAccessLevel`. Assisted-by: Kiro:claude-opus-5 Signed-off-by: Markus Siebert <markus.siebert@deutschebahn.com>
f74ce41 to
6f432a5
Compare
Description of your changes
Follow-up to #418, and based on that branch — review that one first.
GitLab accepts nineteen
*_access_levelparameters on the Projects API. TheProjectspec covered nine, so ten project features could not be configuredthrough this provider at all:
analyticsAccessLevel,releasesAccessLevel,environmentsAccessLevel,featureFlagsAccessLevel,infrastructureAccessLevel,monitorAccessLevel,packageRegistryAccessLevel,securityAndComplianceAccessLevel,modelExperimentsAccessLevel,modelRegistryAccessLevel.Five of them are what GitLab split
operations_access_levelinto. #418 removesoperationsAccessLevelbecause GitLab no longer accepts it, which leaves themonitor, environments, releases, feature flag and infrastructure features
without any representation in the spec until these are added.
All ten are declared in GitLab's Community Edition parameter set for both
project creation and project update, and all ten are exposed by the Community
Edition project entity, so they round-trip on any instance. Each is sent on
create and update, late-initialized from the observed project, and compared in
isProjectUpToDate.requirementsAccessLevelis deliberately not added. GitLab declares it onlyin its Enterprise Edition parameter block and the Community Edition project
entity does not expose it, so on a Community Edition instance it would be
dropped silently and then report a permanent difference — the failure mode #418
is about.
packagesEnabledkeeps working and is now documented as superseded bypackageRegistryAccessLevel.Most of the test diff is
gofmtrealignment of the existing struct literals;git diff -wreduces it to the added lines.I have:
make generateandgolangci-lintto ensure this PR is ready for review.