Skip to content

Conversation

@rvwatch
Copy link
Collaborator

@rvwatch rvwatch commented Dec 11, 2025

Summary

  • Change --variables flag to --values for more generic JSON file support
  • Remove automatic Variables object wrapper around values JSON
  • Allow any JSON structure in values file to match transformation rules
  • Update help documentation and examples to use --values flag
  • Maintain -v short flag for backward compatibility

Problem

The previous implementation:

  1. Required --variables flag which implied specific variable structure
  2. Automatically wrapped JSON in {Variables: {...}} object
  3. Limited flexibility for different transformation use cases

Solution

The new implementation:

  1. Uses --values flag which is more generic and flexible
  2. Passes raw JSON directly to the API without wrapping
  3. Allows any JSON structure that matches transformation rules
  4. Better aligns with the flexible nature of transformation rules

Changes

  • Flag renamed: --variables--values (keeps -v short flag)
  • Removed wrapper: No more automatic Variables object wrapping
  • Updated TypeScript: values: Record<string, unknown> instead of Variables structure
  • Updated help: New description and examples using --values
  • Updated snapshot: Command snapshot reflects new flag name

Examples

Before:

sf orchestrator rules eval --document ./dashboard.json --variables ./variables.json --rules ./rules.json
# variables.json was automatically wrapped in {Variables: {...}}

After:

sf orchestrator rules eval --document ./dashboard.json --values ./values.json --rules ./rules.json
# values.json is passed directly as-is to match transformation rules

Test Plan

  • All existing unit tests pass
  • All integration (NUT) tests pass
  • Linting passes
  • Command snapshot updated
  • Manual testing with different JSON structures works
  • Help output updated correctly

Breaking Change

⚠️ This is a breaking change - the --variables flag is renamed to --values and the Variables wrapper behavior is removed. Users will need to update their scripts.

- Change --variables flag to --values for more generic JSON file support
- Remove automatic Variables object wrapper around values JSON
- Allow any JSON structure in values file to match transformation rules
- Update help documentation and examples to use --values flag
- Maintain -v short flag for backward compatibility
- More flexible for different transformation use cases
- Fix linting issue with unnecessary type assertion
@rvwatch rvwatch merged commit 975e1c5 into main Dec 11, 2025
14 of 15 checks passed
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.

2 participants