Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Move all files from pkg/openfeature to openfeature. #232

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

paddycarver
Copy link
Contributor

This PR

Move the package from being
github.com/open-feature/go-sdk/pkg/openfeature, which has an unnecessary pkg in the import path, to github.com/open-feature/go-sdk/openfeature, without the unnecessary "pkg" in the import path.

The existing github.com/open-feature/go-sdk/pkg/openfeature package is now a compatibility shell; exported types, constants, variables, and functions are now aliased to the new
github.com/open-feature/go-sdk/openfeature equivalents in a way that will pass equality checks, and types are interchangeable between both packages. No logic or tests live in the package anymore, only the exported identifiers, which call through to the new package for behavior.

The memprovider package, similarly, has moved.

Related Issues

Fixes #227

How to test

Any consumers of the package that already exist should be able to transparently use this version (go mod edit -replace github.com/open-feature/go-sdk=github.com/paddycarver/open-feature@no-pkg) with no code changes or changes in behavior.

@paddycarver paddycarver requested a review from a team as a code owner November 15, 2023 06:58
@Kavindu-Dodan Kavindu-Dodan changed the title Move all files from pkg/openfeature to openfeature. feat!: Move all files from pkg/openfeature to openfeature. Nov 15, 2023
Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Attention: 196 lines in your changes are missing coverage. Please review.

Comparison is base (34fb9d9) 81.61% compared to head (1098f60) 81.61%.

Files Patch % Lines
openfeature/client.go 76.76% 89 Missing and 10 partials ⚠️
openfeature/memprovider/in_memory_provider.go 75.59% 26 Missing and 5 partials ⚠️
openfeature/resolution_error.go 18.91% 30 Missing ⚠️
openfeature/hooks.go 29.03% 22 Missing ⚠️
openfeature/provider.go 65.38% 9 Missing ⚠️
openfeature/evaluation_context.go 82.60% 4 Missing ⚠️
openfeature/openfeature.go 97.67% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #232   +/-   ##
=======================================
  Coverage   81.61%   81.61%           
=======================================
  Files          10       10           
  Lines        1142     1142           
=======================================
  Hits          932      932           
  Misses        192      192           
  Partials       18       18           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Kavindu-Dodan
Copy link
Contributor

@paddycarver thank you for the contribution and I like the approach proposed through this PR (compared to #233 with root level content)

Could you please sign off your commit ? This guide should help you - https://github.com/open-feature/go-sdk/pull/232/checks?check_run_id=18694944964

Move the package from being
github.com/open-feature/go-sdk/pkg/openfeature, which has an unnecessary
pkg in the import path, to github.com/open-feature/go-sdk/openfeature,
without the unnecessary "pkg" in the import path.

The existing github.com/open-feature/go-sdk/pkg/openfeature package is
now a compatibility shell; exported types, constants, variables, and
functions are now aliased to the new
github.com/open-feature/go-sdk/openfeature equivalents in a way that
will pass equality checks, and types are interchangeable between both
packages. No logic or tests live in the package anymore, only the
exported identifiers, which call through to the new package for
behavior.

The memprovider package, similarly, has moved.

Signed-off-by: Paddy Carver <[email protected]>
@paddycarver
Copy link
Contributor Author

Should be done. :)

@toddbaert
Copy link
Member

@Kavindu-Dodan @paddycarver thanks so much for this change. I agreed very much with @craigpastro that the imports were not ideal, and I had already accepted that this would be a breaking change, so this was a welcome surprise!

There's a ! in the title. This implies this is breaking, which I believe it is not (I don't consider deprecations breaking). Since everything should work transparently with the exception of compiler warnings around deprecations, I guess we can remove the !? Otherwise our release automation will try to increment the package version to v2.0.0.

@AlexsJones
Copy link
Member

AlexsJones commented Nov 16, 2023

What problem does this solve? It's good practice to use pkg in golang

If you want to improve usability I would suggest remove the last part of the slug github.com/open-feature/go-sdk/pkg/openfeature

@beeme1mr beeme1mr changed the title feat!: Move all files from pkg/openfeature to openfeature. feat: Move all files from pkg/openfeature to openfeature. Nov 16, 2023
@beeme1mr
Copy link
Member

@AlexsJones, the reasoning was discussed in the linked issue. @paddycarver was able to introduce this change in a nonbreaking way.

@AlexsJones
Copy link
Member

If we can make the change without breaking things 👍

@Kavindu-Dodan Kavindu-Dodan mentioned this pull request Nov 16, 2023
2 tasks
@toddbaert toddbaert merged commit 991726c into open-feature:main Nov 20, 2023
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Follow official Go guidance on how to organize a module?
5 participants