open-feature / open-feature/php-sdk

[FEATURE] expose flags metadata as per OpenFeature specification

Open
#181 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Needs Triage
Dominant language
PHP
Stars
43
Forks
14
Avg merge
4d 12h
Merged PRs (30d)
4

Description

Requirements
Requirements

Summary

The SDK should expose the Flags Metadata to the client through EvaluationDetails and ResolutionDetails models, to align with OpenFeature Specification Requirement 1.4.14 and Requirement 2.2.9/2.2.10

Motivation

Currently, the SDK is missing the flag's metadata property in EvaluationDetails and ResolutionDetails, in the same way the setter for flag's metadata is missing in the builders EvaluationDetailsBuilderand ResolutionDetailsBuilder. Other SDKs are already aligned with the current OpenFeature Specification regarding flag's metadata and this one should follow the path of alignment with current specifications.

Proposed solution

  • Add the getMetadata() method into the EvaluationDetails and ResolutionDetails interfaces.
  • Add the withMetadata() method into the EvaluationDetailsBuilder and ResolutionDetailsBuilder builders.
  • Update any other codebase if needed.

Impact on current adoption

This is an additive change and current adoption from clients should be uneffected.

Open Questions

Should this be considered major update or minor update? PHP seems to not support default implementation for interface methods, this means that any possible external implementation of EvaluationDetails and ResolutionDetails may break on current adoption, anyway it's possible that other repos and projects directly use the implementation or the builders and going to minor update would be possible. With the current proposed approach I'd go for not breaking changes if possible, staying on minor update, if someone has other ideas or feedback you're welcome to share 🙏.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/interfaces/flags/EvaluationDetails.php and src/interfaces/provider/ResolutionDetails.php, then inspect the corresponding EvaluationDetailsBuilder.php and ResolutionDetailsBuilder.php files. Trace their usages and existing tests, and compare the requested methods with the linked OpenFeature requirements. Done means metadata is exposed consistently while the compatibility impact of changing the interfaces is understood.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.