Skip to content

feat(controller): move configuration from internal to pkg#2281

Merged
jakobmoellerdev merged 6 commits into
open-component-model:mainfrom
fabianburth:feat/public-config-pkg
Apr 14, 2026
Merged

feat(controller): move configuration from internal to pkg#2281
jakobmoellerdev merged 6 commits into
open-component-model:mainfrom
fabianburth:feat/public-config-pkg

Conversation

@fabianburth

Copy link
Copy Markdown
Contributor

What this PR does / why we need it

Move internal/configuration to pkg/configuration to make the
configuration loading API available to external consumers. Add package
documentation with an API stability disclaimer. Update all internal
import paths accordingly.

Which issue(s) this PR fixes

Testing

How to test the changes
Verification
  • I have tested the changes locally by running ocm

…mption

  Move internal/configuration to pkg/configuration to make the
  configuration loading API available to external consumers. Add package
  documentation with an API stability disclaimer. Update all internal
  import paths accordingly.

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
@fabianburth fabianburth requested a review from a team as a code owner April 14, 2026 07:51
@netlify

netlify Bot commented Apr 14, 2026

Copy link
Copy Markdown

Deploy Preview for ocm-website canceled.

Name Link
🔨 Latest commit 1626d77
🔍 Latest deploy log https://app.netlify.com/projects/ocm-website/deploys/69de015cc2aeac0008063099

@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/s Small labels Apr 14, 2026
@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR migrates the controller's configuration package from internal/configuration to pkg/configuration across all dependent modules, making the configuration API public. The Docker build context is updated to include the new package directory, and package-level documentation is added to the new public configuration module.

Changes

Cohort / File(s) Summary
Docker Build Infrastructure
kubernetes/controller/Dockerfile
Added COPY pkg/ pkg/ to the builder stage to include the new package directory in the build context.
Controller Reconciliation Layer
kubernetes/controller/internal/controller/component/component_controller.go, kubernetes/controller/internal/controller/deployer/deployer_controller.go, kubernetes/controller/internal/controller/repository/repository_controller.go, kubernetes/controller/internal/controller/resource/resource_controller.go
Updated configuration imports from internal/configuration to pkg/configuration in all four controller files; reconciliation and loading logic remains unchanged.
Resolution & Caching Layer
kubernetes/controller/internal/resolution/cached_repository.go, kubernetes/controller/internal/resolution/service.go, kubernetes/controller/internal/resolution/service_test.go
Updated configuration imports and adjusted field types in RepositoryOptions struct from internal/configuration.Configuration to pkg/configuration.Configuration; underlying method behavior unchanged.
OCM Resource Verification
kubernetes/controller/internal/ocm/resource.go
Updated VerifyResource() function signature to use *pkg/configuration.Configuration instead of *internal/configuration.Configuration; verification logic unchanged.
Tests & Package Documentation
kubernetes/controller/internal/setup/integration_test.go, kubernetes/controller/pkg/configuration/doc.go, kubernetes/controller/pkg/configuration/config.go
Added package-level documentation in new doc.go describing configuration loading/merging behavior; updated integration test imports; removed descriptive comments from config.go.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

kind/chore, size/m

Suggested reviewers

  • morri-son
  • Skarlso

Poem

🐰 The config hops from dark inside
To pkg light, with open pride,
Controllers dance their reconcile,
Building strong, with public style! 📦✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(controller): move configuration from internal to pkg' clearly and concisely describes the main change: moving the configuration package from internal to pkg to expose it as a public API.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for moving configuration to pkg, mentioning the addition of package documentation with stability disclaimer, and noting all internal import paths are updated accordingly.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread kubernetes/controller/pkg/configuration/doc.go Outdated
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
matthiasbruns
matthiasbruns previously approved these changes Apr 14, 2026
Comment thread kubernetes/controller/pkg/configuration/doc.go Outdated
Co-authored-by: Matthias Bruns <github@matthiasbruns.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@kubernetes/controller/pkg/configuration/doc.go`:
- Around line 4-9: The package comment in
kubernetes/controller/pkg/configuration/doc.go currently has an incomplete
sentence ending with “credentials and” before the bullet list; update the
package-level GoDoc so the sentence is complete and grammatically correct (e.g.,
remove the trailing "and" or merge that clause into the bullet intro),
preserving the existing bullets that describe behavior (flattening into
Configuration, calculating a hash, enforcing the allowlist) and referencing the
Configuration type in the text where appropriate; ensure the comment reads as a
single coherent paragraph before the list to satisfy GoDoc conventions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 994209b9-cb81-416b-a1e5-5c47d098badd

📥 Commits

Reviewing files that changed from the base of the PR and between 9bc206d and 1626d77.

📒 Files selected for processing (13)
  • kubernetes/controller/Dockerfile
  • kubernetes/controller/internal/controller/component/component_controller.go
  • kubernetes/controller/internal/controller/deployer/deployer_controller.go
  • kubernetes/controller/internal/controller/repository/repository_controller.go
  • kubernetes/controller/internal/controller/resource/resource_controller.go
  • kubernetes/controller/internal/ocm/resource.go
  • kubernetes/controller/internal/resolution/cached_repository.go
  • kubernetes/controller/internal/resolution/service.go
  • kubernetes/controller/internal/resolution/service_test.go
  • kubernetes/controller/internal/setup/integration_test.go
  • kubernetes/controller/pkg/configuration/config.go
  • kubernetes/controller/pkg/configuration/config_test.go
  • kubernetes/controller/pkg/configuration/doc.go
💤 Files with no reviewable changes (1)
  • kubernetes/controller/pkg/configuration/config.go

Comment thread kubernetes/controller/pkg/configuration/doc.go
@jakobmoellerdev jakobmoellerdev merged commit 351735d into open-component-model:main Apr 14, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature new feature, enhancement, improvement, extension size/s Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants