Skip to content

feat: global variables in Go - #9

Merged
fahad19 merged 3 commits into
mainfrom
top-vars
Aug 29, 2026
Merged

feat: global variables in Go#9
fahad19 merged 3 commits into
mainfrom
top-vars

Conversation

@fahad19

@fahad19 fahad19 commented Aug 29, 2026

Copy link
Copy Markdown
Member

What's done

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

It adds full support for global variables, updates feature dependency evaluation, aligns lifecycle modules and events, expands conformance coverage, and updates both Go modules to their v3 import paths.

What changed

Global variables

  • Added evaluation support for independently defined global variables.
  • Added EvaluateGlobalVariable and GetGlobalVariable.
  • Added typed Boolean, string, integer, double, array, object, and JSON helpers.
  • Added decoding helpers for arrays and objects.
  • Added GetGlobalVariableKeys and GetVariableEvaluations.
  • Added support for defaults, sticky values, ordered and nested overrides, conditions, segments, and requiredFeatures.
  • Included override keys and paths in evaluation details.
  • Added equivalent global variable support to child instances.

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 required_features_unmet evaluation details.

Sticky values

  • Split sticky state into StickyFeatures and StickyVariables.
  • Added SetStickyFeatures and SetStickyVariables.
  • Added sticky_features_set and sticky_variables_set events.
  • Aligned child instance sticky behaviour with the JavaScript SDK.

Evaluation and modules

  • Added BeforeEvaluation and AfterEvaluation module callbacks that work with both features and global variables.
  • Preserved feature specific Before and After callbacks.
  • Added GetFeatureEvaluations and aligned snapshot evaluation behaviour.
  • Preserved transformed defaults throughout the module pipeline.
  • Improved evaluation metadata for global variables and nested overrides.

Datafile updates and events

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

OpenFeature provider

  • Added global variable resolution through keys such as variable:supportEmail.
  • Added configurable GlobalVariablePrefix.
  • Updated the provider to use the Go SDK v3 module.
  • Expanded provider tests for global variables and evaluation metadata.

CLI and integration

  • Added global variable support to the test and benchmark commands.
  • Expanded the shared SDK conformance fixture and tests.
  • Updated GitHub Actions to initialize example-1 through the published Featurevisor CLI instead of cloning the full monorepo.
  • Updated release validation for v3 module tags.

Breaking changes

  • Core module path is now:
 github.com/featurevisor/featurevisor-go/v3
  • OpenFeature module path is now:
github.com/featurevisor/featurevisor-go/openfeature/v3

@fahad19 fahad19 self-assigned this Aug 29, 2026
@fahad19
fahad19 merged commit c8ff91b into main Aug 29, 2026
8 checks passed
@fahad19
fahad19 deleted the top-vars branch August 29, 2026 14:33
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.

1 participant