Skip to content

refactor(core): introduce separate go module for apis#2011

Open
IvoGoman wants to merge 2 commits into
mainfrom
feat/dedicated-api-module
Open

refactor(core): introduce separate go module for apis#2011
IvoGoman wants to merge 2 commits into
mainfrom
feat/dedicated-api-module

Conversation

@IvoGoman
Copy link
Copy Markdown
Contributor

@IvoGoman IvoGoman commented May 21, 2026

Description

This separation is introduced to make imports of the
API types easier for dependent projects

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Added to documentation?

  • 📜 README.md
  • 🤝 Documentation pages updated
  • 🙅 no documentation needed
  • (if applicable) generated OpenAPI docs for CRD changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Copilot AI review requested due to automatic review settings May 21, 2026 07:40
@IvoGoman IvoGoman requested review from a team as code owners May 21, 2026 07:40
@github-actions github-actions Bot added documentation Improvements or additions to documentation size/L labels May 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR splits the Kubernetes API types into a dedicated Go module (github.com/cloudoperators/greenhouse/api) to make importing API packages easier for external consumers, and updates core code to consume API-owned types (notably SCIM auth types) instead of internal equivalents.

Changes:

  • Introduces a separate api/ Go module with its own go.mod/go.sum and API-only test suites.
  • Moves SCIM auth type definitions from internal/scim into the public API package and updates call sites accordingly.
  • Updates the build/test flow to run go test for the new API module from the Makefile.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Makefile Adds test-api target and wires it into make test.
go.mod Adds local replace + requirement for the new api module; bumps some k8s requires.
internal/webhook/v1alpha1/organization_webhook.go Switches SCIM auth-type comparisons to API constants.
internal/webhook/v1alpha1/organization_webhook_test.go Updates webhook tests to use API SCIM auth-type constants.
internal/util/scim_config.go Updates SCIM config translation to use API SCIM auth-type constants.
internal/scim/scim_types.go Removes internal SCIM auth type definitions (now owned by API module).
internal/scim/scim_client.go Updates SCIM client config to use API AuthType.
internal/scim/scim_client_test.go Updates SCIM client tests to use API auth-type constants.
internal/controller/organization/organization_controller_test.go Updates controller tests to use API SCIM auth-type constants.
api/v1alpha1/organization_types.go Introduces API-owned AuthType + constants and updates SCIMConfig field type.
api/v1alpha1/api_suite_test.go Removes dependency on internal test helpers from API-module suite setup.
api/meta/v1alpha1/suite_test.go Removes dependency on internal test helpers from API-module suite setup.
api/v1alpha1/zz_generated.deepcopy.go Regenerated deepcopy with adjusted metav1 import aliasing.
api/meta/v1alpha1/zz_generated.deepcopy.go Removes empty import block from generated deepcopy file.
api/go.mod New module definition for github.com/cloudoperators/greenhouse/api.
api/go.sum New module dependency lockfile for the API module.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread go.mod Outdated
Comment on lines +64 to +68
k8s.io/api v0.35.2
k8s.io/apiextensions-apiserver v0.35.2
k8s.io/apimachinery v0.35.2
k8s.io/cli-runtime v0.35.1
k8s.io/client-go v0.35.1
k8s.io/client-go v0.35.2
Comment thread Makefile
Comment thread internal/scim/scim_types.go
@IvoGoman IvoGoman force-pushed the feat/dedicated-api-module branch 3 times, most recently from 5969422 to 76753e3 Compare May 21, 2026 14:40
IvoGoman and others added 2 commits May 22, 2026 14:48
This separation is introduced to make imports of the
API types easier for dependent projects

Signed-off-by: Ivo Gosemann <ivo.gosemann@sap.com>
Signed-off-by: Ivo Gosemann <ivo.gosemann@sap.com>
@IvoGoman IvoGoman force-pushed the feat/dedicated-api-module branch from 76753e3 to 13275c0 Compare May 22, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-apis dependencies documentation Improvements or additions to documentation feature size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants