Skip to content

Commit ef5fbba

Browse files
authored
Merge pull request #5801 from redis/release/3.4.1
Release v3.4.1
2 parents 2a4db5d + a96e6d2 commit ef5fbba

141 files changed

Lines changed: 6135 additions & 673 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ai/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This repository uses a centralized approach to AI development rules:
88

99
- **`AGENTS.md`** (at repository root) - Entry point for AI agents with essential commands, testing instructions, and quick reference
1010
- **`.ai/rules/`** - Detailed development standards organized by topic
11+
- **`.ai/skills/`** - Agent skills (local and from npm packages)
1112
- **`.ai/commands/`** - AI workflow commands and templates
1213

1314
These rules are used by multiple AI coding assistants:
@@ -31,6 +32,14 @@ AGENTS.md # 🎯 AI agent entry point
3132
│ ├── branches.md # Branch naming conventions
3233
│ ├── commits.md # Commit message guidelines
3334
│ └── pull-requests.md # Pull request process
35+
├── skills/ # Agent skills
36+
│ ├── branches/ # Branch naming skill
37+
│ ├── commits/ # Commit message skill
38+
│ ├── pull-requests/ # Pull request skill
39+
| └── feature-flags/SKILL.md # Feature flag lifecycle
40+
│ └── redis-ui-components/ -> node_modules/@redis-ui/components/skills/redis-ui-components
41+
│ ├── SKILL.md # Component catalog and usage patterns
42+
│ └── references/ # Per-component API docs (Button, Select, etc.)
3443
└── commands/ # AI workflow commands
3544
├── pr-plan.md # JIRA ticket implementation planning
3645
├── commit-message.md # Commit message generation
@@ -39,7 +48,8 @@ AGENTS.md # 🎯 AI agent entry point
3948
# Symlinks (all AI tools read from .ai/)
4049
.cursor/
4150
├── rules/ -> ../.ai/rules/ # Cursor AI (rules)
42-
└── commands/ -> ../.ai/commands/ # Cursor AI (commands)
51+
├── commands/ -> ../.ai/commands/ # Cursor AI (commands)
52+
└── skills/ -> ../.ai/skills/ # Cursor AI (skills)
4353
.augment/ -> .ai/ # Augment AI
4454
.windsurfrules -> .ai/ # Windsurf AI
4555
.github/copilot-instructions.md # GitHub Copilot
@@ -68,6 +78,8 @@ This directory contains comprehensive development standards that are automatical
6878
- **Branch Naming**: `.ai/rules/branches.md` - Branch naming conventions
6979
- **Commit Messages**: `.ai/rules/commits.md` - Commit message guidelines (Conventional Commits)
7080
- **Pull Request Process**: `.ai/rules/pull-requests.md` - PR creation and review guidelines
81+
- **Feature Flags**: `.ai/skills/feature-flags/SKILL.md` - Adding, promoting, and removing feature flags
82+
- **Redis UI Components**: `.ai/skills/redis-ui-components/` - Component API references, props, and usage examples (sourced from `@redis-ui/components` npm package via symlink)
7183

7284
## MCP (Model Context Protocol) Setup
7385

.ai/skills/feature-flags/SKILL.md

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
---
2+
name: feature-flags
3+
description: >-
4+
Create, modify, and remove feature flags in RedisInsight. Use when adding a
5+
new feature flag, introducing a dev flag, promoting a dev flag to regular,
6+
cleaning up old flags, or the user mentions feature flags, feature toggles,
7+
or gating features.
8+
---
9+
10+
# Feature Flags
11+
12+
RedisInsight has its own feature flag system. Flags are defined in a remote JSON config, fetched by the backend, and served to the frontend via API. This skill covers how to add, promote, and remove flags.
13+
14+
## Flag Types
15+
16+
| Type | Naming | `flag` value | Strategy | Purpose |
17+
| ---------------------------- | --------------------------------- | ------------ | ------------------------ | ------------------------------------------------------------ |
18+
| **Dev flag** | `dev-<name>` (e.g. `dev-browser`) | `false` | `CommonFlagStrategy` | Hide incomplete features during development |
19+
| **Regular flag** | `camelCase` (e.g. `azureEntraId`) | `true` | `CommonFlagStrategy` | Standard on/off toggle |
20+
| **Regular with data** | `camelCase` | `true` | `WithDataFlagStrategy` | Flag + extra config payload in `data` |
21+
| **Switchable (overridable)** | `camelCase` | `true` | `SwitchableFlagStrategy` | User can override locally via `~/.redis-insight/config.json` |
22+
23+
## Files to Change
24+
25+
Every new flag touches these files (in order):
26+
27+
### Backend (required)
28+
29+
1. **`redisinsight/api/config/features-config.json`**
30+
Add the flag entry with `flag`, `perc`, optional `filters` and `data`. Bump the `version` number.
31+
32+
2. **`redisinsight/api/src/modules/feature/constants/index.ts`**
33+
Add to the `KnownFeatures` enum.
34+
35+
3. **`redisinsight/api/src/modules/feature/constants/known-features.ts`**
36+
Add entry to the `knownFeatures` record with `name` and `storage` (usually `FeatureStorage.Database`).
37+
38+
4. **`redisinsight/api/src/modules/feature/providers/feature-flag/feature-flag.provider.ts`**
39+
Register the flag with its strategy (see Strategy Types below).
40+
41+
### Frontend (required if the flag gates UI)
42+
43+
5. **`redisinsight/ui/src/constants/featureFlags.ts`**
44+
Add to the `FeatureFlags` enum.
45+
46+
6. **`redisinsight/ui/src/slices/app/features.ts`**
47+
Add default state entry in `initialState.featureFlags.features` with `{ flag: false }`.
48+
49+
### Consuming code
50+
51+
7. Use the flag in components/hooks to gate functionality.
52+
53+
## Strategy Selection
54+
55+
Choose the strategy based on what the flag needs:
56+
57+
```
58+
CommonFlagStrategy → Most flags (dev and regular on/off)
59+
WithDataFlagStrategy → Flag needs to carry extra data payload
60+
SwitchableFlagStrategy → Flag should be overridable via local config.json
61+
```
62+
63+
Register in `feature-flag.provider.ts`:
64+
65+
```typescript
66+
this.strategies.set(
67+
KnownFeatures.YourFeature,
68+
new CommonFlagStrategy(this.featuresConfigService, this.settingsService),
69+
);
70+
```
71+
72+
## Config JSON Structure
73+
74+
### Minimal (dev flag)
75+
76+
```json
77+
"dev-myFeature": {
78+
"flag": false,
79+
"perc": [[0, 100]]
80+
}
81+
```
82+
83+
### With filters (Electron-only)
84+
85+
```json
86+
"myFeature": {
87+
"flag": true,
88+
"perc": [[0, 100]],
89+
"filters": [
90+
{ "name": "config.server.buildType", "value": "ELECTRON", "cond": "eq" }
91+
]
92+
}
93+
```
94+
95+
### Gradual rollout (10% of users)
96+
97+
```json
98+
"myFeature": {
99+
"flag": true,
100+
"perc": [[0, 10]]
101+
}
102+
```
103+
104+
### With data payload
105+
106+
```json
107+
"myFeature": {
108+
"flag": true,
109+
"perc": [[0, 100]],
110+
"data": { "strategy": "ioredis" }
111+
}
112+
```
113+
114+
## Filter Conditions
115+
116+
Filters compare a value from server state against the filter value.
117+
118+
| Condition | Meaning |
119+
| ------------ | ------------------------------- |
120+
| `eq` | equals |
121+
| `neq` | not equals |
122+
| `gt` / `gte` | greater than / greater or equal |
123+
| `lt` / `lte` | less than / less or equal |
124+
125+
Common `name` paths: `config.server.buildType` (ELECTRON, DOCKER_ON_PREMISE, REDIS_STACK), `config.server.packageVersion` (uses semver), `agreements.analytics`, `env.<VAR_NAME>`.
126+
127+
Filters support `and`/`or` composition for complex conditions.
128+
129+
## Workflows
130+
131+
### Add a dev feature flag
132+
133+
Use for features under active development that should not be visible in production.
134+
135+
1. `features-config.json` → add `"dev-myFeature": { "flag": false, "perc": [[0, 100]] }`
136+
2. `constants/index.ts` → add `DevMyFeature = 'dev-myFeature'` to `KnownFeatures`
137+
3. `constants/known-features.ts` → add record entry
138+
4. `feature-flag.provider.ts` → register with `CommonFlagStrategy`
139+
5. `ui/src/constants/featureFlags.ts` → add `devMyFeature = 'dev-myFeature'`
140+
6. `ui/src/slices/app/features.ts` → add default `{ flag: false }`
141+
142+
### Promote dev flag to regular flag
143+
144+
When the feature is complete and ready for rollout.
145+
146+
1. Rename `dev-myFeature``myFeature` in all the files above
147+
2. Set `flag: true` in `features-config.json`
148+
3. Optionally set `perc` for gradual rollout (e.g. `[[0, 10]]`)
149+
4. Change strategy if needed (e.g. to `SwitchableFlagStrategy` for overridable)
150+
5. Bump config `version`
151+
152+
### Clean up a flag
153+
154+
When a feature is fully rolled out and the flag is no longer needed.
155+
156+
1. Remove from `features-config.json`
157+
2. Remove from `KnownFeatures` enum
158+
3. Remove from `knownFeatures` record
159+
4. Remove strategy registration from `feature-flag.provider.ts`
160+
5. Remove from FE `FeatureFlags` enum
161+
6. Remove default state from `features.ts`
162+
7. Remove all gating code (conditionals, `FeatureFlagComponent` wrappers) in consuming components
163+
164+
## FE Usage Patterns
165+
166+
### Check flag in a component
167+
168+
```typescript
169+
import { FeatureFlags } from 'uiSrc/constants';
170+
import { appFeatureFlagsFeaturesSelector } from 'uiSrc/slices/app/features';
171+
172+
const features = useSelector(appFeatureFlagsFeaturesSelector);
173+
const isEnabled = features[FeatureFlags.myFeature]?.flag;
174+
```
175+
176+
### Custom selector for complex logic
177+
178+
```typescript
179+
export const isMyFeatureEnabledSelector = (state: RootState): boolean => {
180+
const features = state.app.features.featureFlags.features;
181+
return features[FeatureFlags.myFeature]?.flag ?? false;
182+
};
183+
```

.ai/skills/redis-ui-components

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../node_modules/@redis-ui/components/skills/redis-ui-components
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../.ai/skills/feature-flags/SKILL.md

.cursor/skills/redis-ui-components

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../.ai/skills/redis-ui-components
Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
11
name: Install Windows certs
22

33
inputs:
4-
WIN_CSC_PFX_BASE64:
4+
WIN_CSC_DIGICERT_API_KEY:
5+
required: true
6+
WIN_CSC_DIGICERT_CLIENT_CERT_B64:
7+
required: true
8+
WIN_CSC_DIGICERT_CLIENT_CERT_PASSWORD:
9+
required: true
10+
WIN_CSC_DIGICERT_HOST:
11+
required: false
12+
default: 'https://clientauth.one.digicert.com'
13+
WIN_CSC_DIGICERT_KEYPAIR_ALIAS:
514
required: true
615

716
runs:
817
using: 'composite'
918
steps:
10-
- name: Setup sign certificates
19+
- name: Setup certificate from base64 secret
20+
shell: bash
21+
run: |
22+
echo "${{ inputs.WIN_CSC_DIGICERT_CLIENT_CERT_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
23+
24+
- name: Set DigiCert environment variables
1125
shell: bash
12-
env:
13-
WIN_CSC_PFX_BASE64: ${{ inputs.WIN_CSC_PFX_BASE64 }}
1426
run: |
15-
mkdir -p certs
16-
echo "$WIN_CSC_PFX_BASE64" | base64 -d > certs/redislabs_win.pfx
27+
echo "SM_HOST=${{ inputs.WIN_CSC_DIGICERT_HOST }}" >> "$GITHUB_ENV"
28+
echo "SM_API_KEY=${{ inputs.WIN_CSC_DIGICERT_API_KEY }}" >> "$GITHUB_ENV"
29+
echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV"
30+
echo "SM_CLIENT_CERT_PASSWORD=${{ inputs.WIN_CSC_DIGICERT_CLIENT_CERT_PASSWORD }}" >> "$GITHUB_ENV"
31+
echo "C:\Program Files\DigiCert\DigiCert Keylocker Tools" >> $GITHUB_PATH
32+
33+
- name: Install DigiCert KeyLocker tools
34+
shell: cmd
35+
run: |
36+
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/Keylockertools-windows-x64.msi/download -H "x-api-key:%SM_API_KEY%" -o Keylockertools-windows-x64.msi
37+
msiexec /i Keylockertools-windows-x64.msi /quiet /qn
38+
39+
- name: Register KSP and sync certificate to Windows certificate store
40+
shell: cmd
41+
run: |
42+
smctl windows ksp register
43+
smctl windows certsync --keypair-alias=${{ inputs.WIN_CSC_DIGICERT_KEYPAIR_ALIAS }}

.github/build/release-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e
33

44
HELP="Args:
5-
-v - Semver (3.4.0)
5+
-v - Semver (3.4.1)
66
-d - Build image repository (Ex: -d redisinsight)
77
-r - Target repository (Ex: -r redis/redisinsight)
88
"

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "npm"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
cooldown:
9+
default-days: 3
10+
semver-major-days: 7
11+
semver-minor-days: 3
12+
semver-patch-days: 1
13+
14+
- package-ecosystem: "github-actions"
15+
directory: "/"
16+
schedule:
17+
interval: "weekly"
18+
cooldown:
19+
default-days: 3

0 commit comments

Comments
 (0)