8000 feat: migrate experiments config from array to bools by mwbrooks · Pull Request #398 · slackapi/slack-cli · GitHub
[go: up one dir, main page]

Skip to content

feat: migrate experiments config from array to bools#398

Draft
mwbrooks wants to merge 2 commits intomainfrom
mwbrooks-config-experiments-type
Draft

feat: migrate experiments config from array to bools#398
mwbrooks wants to merge 2 commits intomainfrom
mwbrooks-config-experiments-type

Conversation

@mwbrooks
Copy link
Member

Changelog

  • N/A

Summary

This pull request migrates the experiments config format from an array to a map of boolean values. It includes backwards-compatible JSON unmarshaling that will auto-migrate config.json files.

Motivation

The motivation is to enable friendly dot-notation access for a future slack config <key> [value] command.

The command's <key> can expressed a nested JSON key as dot-notation (e.g. config experiments or config manifest.source). However, the [value] is more tricky.

In order for setting [value] to be simple and intuitive, we should restrict the config.json files to use simple value types that can be expressed on the command-line (e.g. string, number, and boolean). Arrays are complex and error-prone to express (["value1", "value2"] or value1, value2) and all elements must be included each time.

This is why this pull request migrates the experiments to an object of key: boolean pairs. An added bonus is that the new format naturally supports disabling experiments from the config file.

Example

Before:

{
  "experiments": ["sandboxes"],
  "manifest": {
    "source": "local"
  },
  "project_id": "..."
}

After:

{
  "experiments": {
    "sandboxes": true,
    "charm" :false
  },
  "manifest": {
    "source": "local"
  },
  "project_id": "..."
}

Requirements

Change the experiments field in SystemConfig, ProjectConfig, and Config
from []experiment.Experiment to map[string]bool. This enables dot-notation
access for the upcoming config command and allows explicit enable/disable
of experiments.

Includes backwards-compatible JSON unmarshaling that auto-converts the old
array format (["charm"]) to the new map format ({"charm": true}).

Updates help output to show all available experiments with ENABLED/DISABLED
status for better discoverability.
Reverts the EXPERIMENTS section changes from the experiments
migration commit to keep PR #1 focused on the array-to-map
refactor. Help menu improvements will be done in a separate PR.
@mwbrooks mwbrooks added this to the Next Release milestone Mar 14, 2026
@mwbrooks mwbrooks self-assigned this Mar 14, 2026
@mwbrooks mwbrooks added enhancement M-T: A feature request for new functionality experiment Experimental feature accessed behind the --experiment flag or toggle semver:patch Use on pull requests to describe the release version increment labels Mar 14, 2026
@mwbrooks mwbrooks changed the title feat: migrate experiments config from array to map feat: migrate experiments config from array to bools Mar 14, 2026
@codecov
Copy link
codecov bot commented Mar 14, 2026

Codecov Report

❌ Patch coverage is 85.29412% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.94%. Comparing base (35e1743) to head (95d3cd1).

Files with missing lines Patch % Lines
internal/config/experiments.go 90.32% 2 Missing and 1 partial ⚠️
internal/config/experiments_unmarshal.go 80.00% 2 Missing and 1 partial ⚠️
internal/config/project.go 81.81% 1 Missing and 1 partial ⚠️
internal/config/system.go 81.81% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #398      +/-   ##
==========================================
+ Coverage   67.90%   67.94%   +0.04%     
==========================================
  Files         218      219       +1     
  Lines       18050    18103      +53     
==========================================
+ Hits        12256    12300      +44     
- Misses       4640     4646       +6     
- Partials     1154     1157       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality experiment Experimental feature accessed behind the --experiment flag or toggle semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0