open-feature / open-feature/go-sdk
Deprecate TransactionContext functions
- Dominant language
- Go
- Stars
- 250
- Forks
- 62
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 25
Description
Related to #413
https://github.com/open-feature/go-sdk/blob/4b3d6d953076f3056d78c512b31c9fc2ec29ab89/openfeature/evaluation_context.go#L60-L91
My proposal is that we deprecate these functions and turn them into package-level variables that are assigned to the new functions.
- [WithTransactionContext](https://github.com/open-feature/go-sdk/blob/v1.17.0/openfeature/evaluation_context.go#L67) should be named `ContextWithEvaluationContext`.
- [TransactionContext](https://github.com/open-feature/go-sdk/blob/v1.17.0/openfeature/evaluation_context.go#L86) should be named `EvaluationContextFromContext`.
See the [OTel trace package](https://pkg.go.dev/go.opentelemetry.io/otel/trace#ContextWithRemoteSpanContext) for good names for these types of functions.
The convention here is `TypeNameFromContext` and `ContextWithTypeName`, where `TypeName` is the name of the type of identifier being stored/retrieved from the context.
Note that `MergeTransactionContext` will be handled in a separate issue, as it's a bit more involved.
Contributor guide
Research direction
Start in openfeature/evaluation_context.go around lines 60-91 and review related issue #413. Update the transaction-context function names and preserve the old functions as deprecated package-level variables assigned to the new functions; leave MergeTransactionContext for its separate issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 57/100