GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: global variables in Java by fahad19 · Pull Request #6 · featurevisor/featurevisor-java

Conversation

@fahad19

@fahad19 fahad19 commented Aug 29, 2026

Copy link
Copy Markdown
Member

What's done

This PR aligns the Featurevisor Java SDK with the latest JavaScript SDK behaviour and prepares the next breaking release as Java SDK v4.

It adds complete support for global variables, updates feature dependency evaluation, aligns sticky state and lifecycle modules, improves datafile change events, extends the OpenFeature provider, and substantially expands conformance coverage.

What changed

Global variables

  • Added support for independently defined global variables.
  • Added overloaded evaluateVariable and getVariable APIs using a single global variable key.
  • Added overloaded Boolean, string, integer, double, array, object, and JSON helpers.
  • Added getVariableKeys for global variable keys.
  • Added getVariableEvaluations for aggregate global variable evaluation.
  • Added support for caller defaults, sticky values, ordered and nested overrides, conditions, segments, and requiredFeatures.
  • Included override keys and nested override paths in evaluation details.
  • Added equivalent global variable support to child instances.

Example:

String message = f.getVariableString("welcomeMessage", context);
Object settings = f.getVariable("checkoutSettings", context);
Evaluation evaluation = f.evaluateVariable("checkoutSettings", context);

Required features

  • Added the canonical requiredFeatures datafile model.
  • Supported required feature checks using enabled state, variation, or both.
  • Applied required feature checks to features, feature variables, global variables, and variable overrides.
  • Ensured required feature evaluations pass through the complete module pipeline.
  • Added the required_features_unmet evaluation reason and corresponding metadata.

Sticky features and variables

  • Split sticky state into stickyFeatures and stickyVariables.
  • Added setStickyFeatures and setStickyVariables.
  • Added sticky_features_set and sticky_variables_set events.
  • Added separate sticky feature and global variable support to child instances.
  • Aligned sticky replacement and inheritance behaviour with the JavaScript SDK.

Aggregate evaluations

  • Added getFeatureEvaluations for feature snapshots.
  • Added getVariableEvaluations for global variable snapshots.
  • Added support for selecting specific feature or global variable keys.
  • Applied context and caller override options consistently.

Evaluation modules

  • Added beforeEvaluation and afterEvaluation callbacks that work with both feature and global variable evaluations.
  • Preserved feature specific before and after callbacks.
  • Defined deterministic callback ordering.
  • Ensured required feature checks use the complete module pipeline.
  • Preserved transformed caller defaults through evaluation.

Datafile updates and events

  • Added global variables to datafile parsing, merging, and replacement.
  • Added dependency aware change detection across features, segments, required features, and global variables.
  • Updated datafile_set events to report affected feature and global variable keys.
  • Kept partial datafile update behaviour aligned with the JavaScript SDK.

OpenFeature provider

  • Added global variable resolution through keys such as variable:welcomeMessage.
  • Added configurable globalVariablePrefix.
  • Added global variable override metadata and required feature reason mapping.
  • Preserved ownership semantics when using an existing Featurevisor instance.
  • Expanded provider tests for global variables and custom prefixes.
  • Kept the OpenFeature provider as a separate Maven artifact.

CLI and integration

  • Added global variable support to the test and benchmark commands.
  • Added support for sticky global variables in project assertions.
  • Added global variable evaluation metadata to CLI output.
  • Expanded the shared SDK v3 conformance fixture and tests.
  • Updated the CLI version to 4.0.0.

Breaking changes

  • The Java SDK version is now 4.0.0.
  • Sticky APIs now distinguish between features and global variables.
  • Aggregate feature evaluations use getFeatureEvaluations.
  • Global aggregate evaluations use getVariableEvaluations.
  • Event names and public models have been aligned with the latest JavaScript SDK.
  • Datafile dependency declarations use requiredFeatures.

Update the Maven dependency to:

<dependency>
  <groupId>com.featurevisor</groupId>
  <artifactId>featurevisor-java</artifactId>
  <version>4.0.0</version>
</dependency>

Applications using OpenFeature should use the matching provider:

<dependency>
  <groupId>com.featurevisor</groupId>
  <artifactId>featurevisor-openfeature</artifactId>
  <version>4.0.0</version>
</dependency>

Verification

  • Java SDK unit tests.
  • OpenFeature provider tests.
  • CLI tests.
  • Shared Featurevisor SDK v3 conformance suite.
  • Global variable and requiredFeatures alignment tests.
  • Module ordering and transformed default tests.
  • Child instance tests.
  • Datafile event dependency tests.
  • Maven artifact boundary verification.
  • Build and test coverage for all Maven modules.

Release

This PR prepares all Maven artifacts for tag:

v4.0.0

The tag workflow publishes the parent POM, Featurevisor Java SDK, and OpenFeature provider to GitHub Packages.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
fahad19 added 4 commits August 28, 2026 22:55
@fahad19
feat: global variables
6d9a627
@fahad19
conformance
e0cdc0c
@fahad19
release preparation
cdccc2b
@fahad19
README updates
0e6b4cf
@fahad19 fahad19 self-assigned this Aug 29, 2026
@fahad19
fahad19 merged commit a8c9329 into main Aug 29, 2026
3 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@fahad19
fahad19 deleted the top-vars branch August 29, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@fahad19 fahad19

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@fahad19
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.