-
Notifications
You must be signed in to change notification settings - Fork 397
RI-6927: Rename some provider and telemetry event names #4855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ef437cd
8923cb0
2db814c
25205d4
fe9bd35
b042f04
34f1944
7c0913c
48bac98
841d3c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class UpdateProviderNames1755086732238 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
UPDATE database_instance | ||
SET provider = CASE provider | ||
WHEN 'RE_CLOUD' THEN 'REDIS_CLOUD' | ||
WHEN 'RE_CLUSTER' THEN 'REDIS_SOFTWARE' | ||
WHEN 'REDIS_ENTERPRISE' THEN 'OTHER_REDIS_MANAGED' | ||
ELSE provider | ||
END | ||
WHERE provider IN ('RE_CLOUD', 'RE_CLUSTER', 'REDIS_ENTERPRISE'); | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
UPDATE database_instance | ||
SET provider = CASE provider | ||
WHEN 'REDIS_CLOUD' THEN 'RE_CLOUD' | ||
WHEN 'REDIS_SOFTWARE' THEN 'RE_CLUSTER' | ||
WHEN 'OTHER_REDIS_MANAGED' THEN 'REDIS_ENTERPRISE' | ||
ELSE provider | ||
END | ||
WHERE provider IN ('REDIS_CLOUD', 'REDIS_SOFTWARE', 'OTHER_REDIS_MANAGED'); | ||
`); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,12 +21,12 @@ export enum TelemetryEvents { | |
DatabaseImportPartiallySucceeded = 'CONFIG_DATABASES_REDIS_IMPORT_PARTIALLY_SUCCEEDED', | ||
|
||
// Events for autodiscovery flows | ||
REClusterDiscoverySucceed = 'CONFIG_DATABASES_RE_CLUSTER_AUTODISCOVERY_SUCCEEDED', | ||
REClusterDiscoveryFailed = 'CONFIG_DATABASES_RE_CLUSTER_AUTODISCOVERY_FAILED', | ||
RECloudSubscriptionsDiscoverySucceed = 'CONFIG_DATABASES_RE_CLOUD_AUTODISCOVERY_SUBSCRIPTIONS_SUCCEEDED', | ||
RECloudSubscriptionsDiscoveryFailed = 'CONFIG_DATABASES_RE_CLOUD_AUTODISCOVERY_SUBSCRIPTIONS_FAILED', | ||
RECloudDatabasesDiscoverySucceed = 'CONFIG_DATABASES_RE_CLOUD_AUTODISCOVERY_DATABASES_SUCCEEDED', | ||
RECloudDatabasesDiscoveryFailed = 'CONFIG_DATABASES_RE_CLOUD_AUTODISCOVERY_DATABASES_FAILED', | ||
RedisSoftwareDiscoverySucceed = 'CONFIG_DATABASES_REDIS_SOFTWARE_AUTODISCOVERY_SUCCEEDED', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: I might be missing something here, but why change both the constant names and their values? Usually, we use constants to hide the magic strings so we don’t need to update the whole codebase later. Or in this case, were the names actually wrong/misleading and needed to be updated too? PS: Since you already made the effort to migrate everything, don't make any further changes, I'm just curious 🙂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get your point and it makes sense for constants name to stay in general, but maybe if the constant name was descriptive and general enough, but this "RECloud" part I think it is both not descriptive and will look like a leftover we wouldn't have cleaned, at least to me ... |
||
RedisSoftwareDiscoveryFailed = 'CONFIG_DATABASES_REDIS_SOFTWARE_AUTODISCOVERY_FAILED', | ||
RedisCloudSubscriptionsDiscoverySucceed = 'CONFIG_DATABASES_REDIS_CLOUD_AUTODISCOVERY_SUBSCRIPTIONS_SUCCEEDED', | ||
RedisCloudSubscriptionsDiscoveryFailed = 'CONFIG_DATABASES_REDIS_CLOUD_AUTODISCOVERY_SUBSCRIPTIONS_FAILED', | ||
RedisCloudDatabasesDiscoverySucceed = 'CONFIG_DATABASES_REDIS_CLOUD_AUTODISCOVERY_DATABASES_SUCCEEDED', | ||
RedisCloudDatabasesDiscoveryFailed = 'CONFIG_DATABASES_REDIS_CLOUD_AUTODISCOVERY_DATABASES_FAILED', | ||
SentinelMasterGroupsDiscoverySucceed = 'CONFIG_DATABASES_REDIS_SENTINEL_AUTODISCOVERY_SUCCEEDED', | ||
SentinelMasterGroupsDiscoveryFailed = 'CONFIG_DATABASES_REDIS_SENTINEL_AUTODISCOVERY_FAILED', | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.