Skip to content

Commit 4943e32

Browse files
authored
Replace Redis configuration with Valkey configuration and update related tests and documentation (#90)
* Replace Redis configuration with Valkey configuration and update related tests and documentation * Replace Redis configuration with Valkey configuration * Bump version to 1.5.0
1 parent 864796d commit 4943e32

File tree

7 files changed

+40
-40
lines changed

7 files changed

+40
-40
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Changelog](https://img.shields.io/github/v/release/jkpe/do-db-config-ui?include_prereleases&label=changelog)](https://github.com/jkpe/do-db-config-ui/releases)
44

5-
This project is a web application built with React and React Router that provides a user interface for configuring advanced settings on DigitalOcean Managed Databases. The tool allows you to customize configuration options for various database engines (MySQL, PostgreSQL, Redis, MongoDB, Kafka, OpenSearch) and then generates API requests (including preformatted `curl` and `doctl` commands) so you can update your databases via DigitalOcean's API.
5+
This project is a web application built with React and React Router that provides a user interface for configuring advanced settings on DigitalOcean Managed Databases. The tool allows you to customize configuration options for various database engines (MySQL, PostgreSQL, Valkey, MongoDB, Kafka, OpenSearch) and then generates API requests (including preformatted `curl` and `doctl` commands) so you can update your databases via DigitalOcean's API.
66

77
---
88

@@ -24,7 +24,7 @@ When you open the application in your browser, you will see a multi-section inte
2424
An input field where you provide your database's unique ID. (You can get your database ID by using the `doctl databases list` command.)
2525

2626
- **Configuration Forms:**
27-
A tabbed interface lets you choose which database engine's settings you'd like to adjust (MySQL, PostgreSQL, Redis, MongoDB, Kafka, or OpenSearch). Each tab displays relevant fields along with details (range, expected input format, examples).
27+
A tabbed interface lets you choose which database engine's settings you'd like to adjust (MySQL, PostgreSQL, Valkey, MongoDB, Kafka, or OpenSearch). Each tab displays relevant fields along with details (range, expected input format, examples).
2828

2929
- **Command Generation:**
3030
Once you fill out the settings, the tool generates preformatted `curl` and `doctl` commands based on your inputs. Click the "Copy" button to copy the command to your clipboard.

src/__tests__/DatabaseConfigApp.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('DatabaseConfigApp', () => {
1515
// Check if all database type tabs are present
1616
expect(screen.getByText('MySQL')).toBeInTheDocument();
1717
expect(screen.getByText('PostgreSQL')).toBeInTheDocument();
18-
expect(screen.getByText('Caching')).toBeInTheDocument();
18+
expect(screen.getByText('Valkey')).toBeInTheDocument();
1919
expect(screen.getByText('MongoDB')).toBeInTheDocument();
2020
expect(screen.getByText('Kafka')).toBeInTheDocument();
2121
expect(screen.getByText('OpenSearch')).toBeInTheDocument();

src/components/DatabaseConfigApp.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React, { useState } from 'react';
22
import MySQLConfigForm from './forms/MySQLConfigForm';
33
import PostgreSQLConfigForm from './forms/PostgreSQLConfigForm';
4-
import RedisConfigForm from './forms/RedisConfigForm';
4+
import ValkeyConfigForm from './forms/ValkeyConfigForm';
55
import MongoConfigForm from './forms/MongoConfigForm';
66
import KafkaConfigForm from './forms/KafkaConfigForm';
77
import OpenSearchConfigForm from './forms/OpenSearchConfigForm';
88
import {
99
mysqlConfigFields,
1010
postgresConfigFields,
11-
redisConfigFields,
11+
valkeyConfigFields,
1212
mongoConfigFields,
1313
kafkaConfigFields,
1414
openSearchConfigFields
@@ -20,7 +20,7 @@ const configCounts = {
2020
mysql: Object.keys(mysqlConfigFields).length,
2121
postgres: Object.values(postgresConfigFields).reduce((count, section) =>
2222
count + Object.keys(section.fields).length, 0),
23-
redis: Object.keys(redisConfigFields).length,
23+
valkey: Object.keys(valkeyConfigFields).length,
2424
mongodb: Object.keys(mongoConfigFields).length,
2525
kafka: Object.keys(kafkaConfigFields).length,
2626
opensearch: Object.keys(openSearchConfigFields).length
@@ -44,7 +44,7 @@ const DatabaseConfigApp = () => {
4444
const tabs = [
4545
{ id: 'mysql', name: 'MySQL' },
4646
{ id: 'postgres', name: 'PostgreSQL' },
47-
{ id: 'redis', name: 'Caching' },
47+
{ id: 'valkey', name: 'Valkey' },
4848
{ id: 'mongodb', name: 'MongoDB' },
4949
{ id: 'kafka', name: 'Kafka' },
5050
{ id: 'opensearch', name: 'OpenSearch' }
@@ -133,8 +133,8 @@ const DatabaseConfigApp = () => {
133133
onDatabaseIdChange={setDatabaseId}
134134
/>
135135
)}
136-
{activeTab === 'redis' && (
137-
<RedisConfigForm
136+
{activeTab === 'valkey' && (
137+
<ValkeyConfigForm
138138
databaseId={databaseId}
139139
onDatabaseIdChange={setDatabaseId}
140140
/>

src/components/forms/RedisConfigForm.tsx renamed to src/components/forms/ValkeyConfigForm.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,42 @@ import React, { useState } from 'react';
22
import ConfigField from '../ConfigField';
33
import GeneratedCommands from '../GeneratedCommands';
44
import { generateCommands } from '../../utils/generateCommands';
5-
import { redisConfigFields, RedisConfig } from '../../config/redis';
5+
import { valkeyConfigFields, ValkeyConfig } from '../../config/valkey';
66

7-
interface RedisConfigFormProps {
7+
interface ValkeyConfigFormProps {
88
databaseId: string;
99
onDatabaseIdChange: (id: string) => void;
1010
}
1111

12-
const RedisConfigForm = ({ databaseId, onDatabaseIdChange }: RedisConfigFormProps) => {
13-
const [config, setConfig] = useState<RedisConfig>({});
12+
const ValkeyConfigForm = ({ databaseId, onDatabaseIdChange }: ValkeyConfigFormProps) => {
13+
const [config, setConfig] = useState<ValkeyConfig>({});
1414

1515
const handleInputChange = (name: string, value: any) => {
1616
if (value === null || value === undefined) {
1717
const newConfig = { ...config };
18-
delete newConfig[name as keyof RedisConfig];
18+
delete newConfig[name as keyof ValkeyConfig];
1919
setConfig(newConfig);
2020
} else {
21-
const field = redisConfigFields[name as keyof typeof redisConfigFields];
21+
const field = valkeyConfigFields[name as keyof typeof valkeyConfigFields];
2222
const processedValue = (field.type === 'number' || field.type === 'integer') ? Number(value) : value;
23-
setConfig((prev: RedisConfig) => ({
23+
setConfig((prev: ValkeyConfig) => ({
2424
...prev,
2525
[name]: processedValue
2626
}));
2727
}
2828
};
2929

30-
const commands = generateCommands(databaseId, config, 'redis');
30+
const commands = generateCommands(databaseId, config, 'valkey');
3131

3232
return (
3333
<div className="space-y-6">
3434
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
35-
{Object.entries(redisConfigFields).map(([name, field]) => (
35+
{Object.entries(valkeyConfigFields).map(([name, field]) => (
3636
<ConfigField
3737
key={name}
3838
name={name}
3939
field={field as ConfigField}
40-
value={config[name as keyof RedisConfig]}
40+
value={config[name as keyof ValkeyConfig]}
4141
onChange={handleInputChange}
4242
/>
4343
))}
@@ -50,4 +50,4 @@ const RedisConfigForm = ({ databaseId, onDatabaseIdChange }: RedisConfigFormProp
5050
);
5151
};
5252

53-
export default RedisConfigForm;
53+
export default ValkeyConfigForm;

src/config/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export * from './mysql';
22
export * from './postgres';
3-
export * from './redis';
3+
export * from './valkey';
44
export * from './mongo';
55
export * from './kafka';
66
export * from './opensearch';

src/config/redis.ts renamed to src/config/valkey.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { ConfigField } from './mysql';
22

3-
export interface RedisConfig {
3+
export interface ValkeyConfig {
44
[key: string]: string | number | boolean;
55
}
66

7-
export const redisConfigFields: Record<string, ConfigField> = {
8-
redis_maxmemory_policy: {
7+
export const valkeyConfigFields: Record<string, ConfigField> = {
8+
valkey_maxmemory_policy: {
99
type: 'select',
1010
options: ['noeviction', 'allkeys-lru', 'allkeys-random', 'volatile-lru', 'volatile-random', 'volatile-ttl'],
11-
description: `A string specifying the desired eviction policy for the Redis cluster.
11+
description: `A string specifying the desired eviction policy for the Valkey cluster.
1212
1313
noeviction: Don't evict any data, returns error when memory limit is reached.
1414
allkeys-lru: Evict any key, least recently used (LRU) first.
@@ -18,66 +18,66 @@ volatile-random: Evict keys with expiration only in a random order.
1818
volatile-ttl: Evict keys with expiration only, shortest time-to-live (TTL) first.`,
1919
example: 'volatile_lru'
2020
},
21-
redis_pubsub_client_output_buffer_limit: {
21+
valkey_pubsub_client_output_buffer_limit: {
2222
type: 'integer',
2323
min: 32,
2424
max: 512,
2525
description: 'Set output buffer limit for pub/sub clients in MB. The value is the hard limit, the soft limit is 1/4 of the hard limit. When setting the limit, be mindful of the available memory in the selected service plan.',
2626
example: 128
2727
},
28-
redis_number_of_databases: {
28+
valkey_number_of_databases: {
2929
type: 'integer',
3030
min: 1,
3131
max: 128,
32-
description: 'Set number of redis databases. Changing this will cause a restart of redis service.',
32+
description: 'Set number of valkey databases. Changing this will cause a restart of valkey service.',
3333
example: 4
3434
},
35-
redis_io_threads: {
35+
valkey_io_threads: {
3636
type: 'integer',
3737
min: 1,
3838
max: 32,
39-
description: 'Redis IO thread count',
39+
description: 'Valkey IO thread count',
4040
example: 4
4141
},
42-
redis_lfu_log_factor: {
42+
valkey_lfu_log_factor: {
4343
type: 'integer',
4444
min: 0,
4545
max: 100,
4646
description: 'Counter logarithm factor for volatile-lfu and allkeys-lfu maxmemory-policies',
4747
example: 12
4848
},
49-
redis_lfu_decay_time: {
49+
valkey_lfu_decay_time: {
5050
type: 'integer',
5151
min: 1,
5252
max: 120,
5353
description: 'LFU maxmemory-policy counter decay time in minutes',
5454
example: 5
5555
},
56-
redis_ssl: {
56+
valkey_ssl: {
5757
type: 'checkbox',
58-
description: 'Require SSL to access Redis. When enabled, Redis accepts only SSL connections on port `25061`. When disabled, port `25060` is opened for non-SSL connections, while port `25061` remains available for SSL connections.',
58+
description: 'Require SSL to access Valkey. When enabled, Valkey accepts only SSL connections on port `25061`. When disabled, port `25060` is opened for non-SSL connections, while port `25061` remains available for SSL connections.',
5959
},
60-
redis_timeout: {
60+
valkey_timeout: {
6161
type: 'integer',
6262
min: 0,
6363
max: 31536000,
64-
description: 'Redis idle connection timeout in seconds',
64+
description: 'Valkey idle connection timeout in seconds',
6565
example: 120
6666
},
67-
redis_notify_keyspace_events: {
67+
valkey_notify_keyspace_events: {
6868
type: 'text',
6969
pattern: '^[KEg\\$lshzxeA]*$',
7070
maxLength: 32,
7171
description: 'Set notify-keyspace-events option. Requires at least `K` or `E` and accepts any combination of the following options: K (Keyspace events), E (Keyevent events), g (Generic commands), $ (String commands), l (List commands), s (Set commands), h (Hash commands), z (Sorted set commands), t (Stream commands), d (Module key type events), x (Expired events), e (Evicted events), m (Key miss events), n (New key events), A (Alias for "g$lshztxed")',
7272
example: 'Ex'
7373
},
74-
redis_persistence: {
74+
valkey_persistence: {
7575
type: 'select',
7676
options: ['off', 'rdb'],
7777
description: 'Creates an RDB dump of the database every 10 minutes that can be used to recover data after a node crash. The database does not create the dump if no keys have changed since the last dump. When set to `off`, the database cannot fork services, and data can be lost if a service is restarted or powered off.',
7878
example: 'rdb'
7979
},
80-
redis_acl_channels_default: {
80+
valkey_acl_channels_default: {
8181
type: 'select',
8282
options: ['allchannels', 'resetchannels'],
8383
description: 'Determines default pub/sub channels\' ACL for new users if ACL is not supplied. When this option is not defined, all_channels is assumed to keep backward compatibility.',

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This file is automatically updated by our release process
2-
export const VERSION = '1.4.0';
2+
export const VERSION = '1.5.0';
33
export const BUILD_DATE = new Date().toISOString();

0 commit comments

Comments
 (0)