Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 1ce5451

Browse files
committed
Changing problematic USERNAME config value name. Fixing tsc errors.
1 parent 8ab1e1c commit 1ce5451

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
HOST=
22
DATABASE=
3-
USERNAME=
3+
DB_USERNAME=
44
PASSWORD=

src/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const instanceConfigFields: IntegrationInstanceConfigFieldMap = {
1616
type: 'string',
1717
mask: false,
1818
},
19-
username: {
19+
dbUsername: {
2020
type: 'string',
2121
mask: false,
2222
},
@@ -29,7 +29,7 @@ export const instanceConfigFields: IntegrationInstanceConfigFieldMap = {
2929
export interface IntegrationConfig extends IntegrationInstanceConfig {
3030
host: string;
3131
database: string;
32-
username: string;
32+
dbUsername: string;
3333
password: string;
3434
}
3535

@@ -40,11 +40,11 @@ export async function validateInvocation({
4040
if (
4141
!config.host ||
4242
!config.database ||
43-
!config.username ||
43+
!config.dbUsername ||
4444
!config.password
4545
) {
4646
throw new IntegrationValidationError(
47-
'Config requires all of host, database, username, password',
47+
'Config requires all of host, database, dbUsername, password',
4848
);
4949
}
5050

src/configuration-manager/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async function createMicrosoftConfigurationManagerClient(
2525
client = await createClient({
2626
dbHost: config.host,
2727
dbName: config.database,
28-
dbUsername: config.username,
28+
dbUsername: config.dbUsername,
2929
dbPassword: config.password,
3030
onRequestFailed(err) {
3131
logger.error({ err }, 'Error running request');

test/config.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,17 @@ if (process.env.LOAD_ENV) {
1111
});
1212
}
1313

14-
export const integrationConfig: IntegrationConfig = {};
14+
const DEFAULT_HOST = 'test_host';
15+
const DEFAULT_DATABASE = 'test_db';
16+
const DEFAULT_USERNAME = 'test_username';
17+
const DEFAULT_PASSWORD = 'fakepassword';
18+
19+
export const integrationConfig: IntegrationConfig = {
20+
host: process.env.HOST || DEFAULT_HOST,
21+
database: process.env.DATABASE || DEFAULT_DATABASE,
22+
dbUsername: process.env.DB_USERNAME || DEFAULT_USERNAME,
23+
password: process.env.PASSWORD || DEFAULT_PASSWORD,
24+
};
1525

1626
export function buildStepTestConfigForStep(stepId: string): StepTestConfig {
1727
return {

0 commit comments

Comments
 (0)