Skip to content

Conversation

Zaimwa9
Copy link
Contributor

@Zaimwa9 Zaimwa9 commented Sep 18, 2025

Closes #198

In this PR, we:

  • Add EvaluationResult getEvaluationResult(EvaluationContext context) and remove all of the old engine APIs.
  • Add support for JSONPath-enabled context values.
  • Add evaluationContext/mappers for engine-API data interop
  • Add script generate-engine-types to generate from flagsmith/sdk/evaluation-*-schema -> in pre-commit

Couple of questions concerning:

  • hide_disabled_flags deprecation => ready to remove the commented code
  • offlineHandler: It is wrapped between a wider getEnvironment that also includes getEnvironmentFromApi. I'm not seeing a huge value to migrate it but maybe I am missing something ? this would getEnvironmentFlagsFromDocument/getIdentityFlagsFromDocument -> getEnvironment -> this.offlineHandler.getEnvironment -> getEvaluationContext (using environment)
    Happy to change if misunderstood
    /**
     * Returns the current environment, fetching it from the API if needed.
     *
     * Calling this method concurrently while the environment is being fetched will not cause additional requests.
     */
    async getEnvironment(): Promise<EnvironmentModel> {
        if (this.offlineHandler) {
            return this.offlineHandler.getEnvironment();
        }
        if (this.environment) {
            return this.environment;
        }
        if (!this.environmentPromise) {
            this.environmentPromise = this.fetchEnvironment();
        }
        return this.environmentPromise;
    }

@Zaimwa9 Zaimwa9 requested a review from a team as a code owner September 18, 2025 15:50
@Zaimwa9 Zaimwa9 requested review from khvn26 and removed request for a team September 18, 2025 15:50
@Zaimwa9 Zaimwa9 changed the title feat: implement context values [DRAFT] feat: implement context values Sep 18, 2025
@Zaimwa9 Zaimwa9 changed the title [DRAFT] feat: implement context values feat: implement context values Sep 19, 2025
Copy link
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

In general, the PR looks solid to me — just a handful of comments to address.

@Zaimwa9 Zaimwa9 requested review from emyller and khvn26 September 29, 2025 15:09
@khvn26 khvn26 requested review from gagantrivedi and removed request for emyller October 2, 2025 11:51
gagantrivedi
gagantrivedi previously approved these changes Oct 6, 2025
@Zaimwa9 Zaimwa9 requested a review from gagantrivedi October 9, 2025 09:16
gagantrivedi
gagantrivedi previously approved these changes Oct 9, 2025
@Zaimwa9 Zaimwa9 requested a review from gagantrivedi October 14, 2025 08:09
value: Value2;
variants?: Variants;
priority?: Priority;
priority?: Priority1;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
priority?: Priority1;
priority: Priority1;

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.

Implement Context Values

3 participants