You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: web/strategy-switch-console/README.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,22 +57,23 @@ For editable admin settings, bind a Cloudflare KV namespace named `STRATEGY_SWIT
57
57
```text
58
58
auth_config
59
59
account_options
60
+
strategy_profiles
60
61
audit_log
61
62
```
62
63
63
64
Without the KV binding, `/admin` is read-only and the Worker falls back to `ALLOWED_GITHUB_LOGINS`, `ALLOWED_GITHUB_ORGS`, `STRATEGY_SWITCH_ADMIN_LOGINS`, `STRATEGY_SWITCH_ADMIN_ORGS`, and `STRATEGY_SWITCH_ACCOUNT_OPTIONS_JSON`.
64
65
65
66
## Page Asset
66
67
67
-
`worker.js` serves `web/strategy-switch-console/index.html` through `page_asset.js`.
68
+
`worker.js` serves `web/strategy-switch-console/index.html` through `page_asset.js` and the fallback live-enabled strategy catalog through `strategy_profiles_asset.js`.
68
69
69
-
After editing `web/strategy-switch-console/index.html`, regenerate the asset:
70
+
After editing `web/strategy-switch-console/index.html` or `strategy-profiles.example.json`, regenerate the assets:
Deploy `worker.js`, `page_asset.js`, and `strategy_profiles_asset.js` together.
76
77
77
78
## Account Dropdowns
78
79
@@ -108,6 +109,8 @@ Each account item supports:
108
109
109
110
The Worker validates dispatch inputs against this config. Keep only routing metadata here. Do not store broker passwords, tokens, or API keys in this config.
110
111
112
+
`/api/strategy-profiles` returns the public live-enabled strategy catalog for the dropdown. It reads the KV `strategy_profiles` key first, then `STRATEGY_SWITCH_STRATEGY_PROFILES_JSON`, then `strategy-profiles.example.json`.
113
+
111
114
For signed-in users, `/api/config` also reads the target repositories' current GitHub Variables. It prefers account-specific `CLOUD_RUN_SERVICE_TARGETS_JSON`, then matching `RUNTIME_TARGET_JSON.strategy_profile`, then `STRATEGY_PROFILE`; if none can be read safely, the page falls back to `default_strategy_profile`.
112
115
113
116
## Strategy Profile Alignment
@@ -116,8 +119,10 @@ Treat `strategy_profile` as the canonical strategy id across the switch console,
116
119
117
120
When adding or renaming a strategy profile:
118
121
119
-
- Add the profile id and display label to `web/strategy-switch-console/index.html`.
122
+
- Add the runtime-enabled profile id and display label to `strategy-profiles.example.json`.
123
+
- Run `python3 scripts/sync_strategy_switch_page_asset.py` so `strategy_profiles_asset.js` is regenerated.
120
124
- Set each affected account's `default_strategy_profile` in `account-options.example.json` and the deployed KV account config.
125
+
- Update the deployed KV `strategy_profiles` key from `strategy-profiles.example.json`.
121
126
- Make sure the platform repository's current `RUNTIME_TARGET_JSON.strategy_profile` or account-specific `CLOUD_RUN_SERVICE_TARGETS_JSON` uses the same id.
122
127
- Use lower-case ids with letters, numbers, dot, underscore, dash, or equals only. Do not encode account names or secrets in profile ids.
0 commit comments