-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] Support logging for generic cloud events, UI for viewing an…
…d system config option. (#1133) * support generic tracking loggin * [feature] Log surfacing for Slack configuration * slowly working the way through systemconfig * slack config now mostly working, working on encryption now * random headers turning up still ready to be encrypted but cannot be * fixed formatting and now appears working * problems with generics * end testing worked! * all testing passing on branch * UI fixups * various updates + slack button * system config updates * turn off the system config by default * tests for webhooks and stuff all working * auto connect for oauth token complete * disable everything by default --------- Co-authored-by: Irina Southwell <“[email protected]”>
- Loading branch information
Showing
137 changed files
with
5,805 additions
and
649 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {Given} from "@cucumber/cucumber"; | ||
import {getWebserverExternalAddress} from "../support/make_me_a_webserver"; | ||
import {SdkWorld} from "../support/world"; | ||
import {expect} from "chai"; | ||
import {UpdatedSystemConfig, UpdatedSystemConfigs} from "../apis/mr-service"; | ||
|
||
|
||
Given('I update the system config for Slack delivery', async function() { | ||
const slackApiUrl = `${getWebserverExternalAddress()}/featurehub/slack`; | ||
|
||
const fields = { | ||
'slack.enabled': true, | ||
'slack.bearerToken': '1234', | ||
'slack.defaultChannel': 'Cabcde', | ||
'slack.delivery.url': slackApiUrl, | ||
}; | ||
|
||
const world = (this as SdkWorld); | ||
const sData = await world.systemConfigApi.getSystemConfig(['slack.']); | ||
expect(sData.status).to.eq(200); | ||
const configs = sData.data; | ||
|
||
const update = new UpdatedSystemConfigs({configs: []}); | ||
for(let field in fields) { | ||
const existingVal = configs.configs.find(i => i.key == field); | ||
// @ts-ignore | ||
const v = fields[field]; | ||
const val = new UpdatedSystemConfig({ | ||
key: field, | ||
version: existingVal?.version ?? -1, | ||
value: v | ||
}); | ||
update.configs.push(val); | ||
} | ||
|
||
await world.systemConfigApi.createOrUpdateSystemConfigs(update); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import { makeid } from './random'; | |
import { SdkWorld } from './world'; | ||
import { discover } from './discovery'; | ||
import {resetCloudEvents, startWebServer, terminateServer} from './make_me_a_webserver'; | ||
import {logger} from "./logging"; | ||
|
||
const superuserEmailAddress = '[email protected]'; | ||
// const superuserEmailAddress = '[email protected]'; | ||
|
@@ -62,10 +63,14 @@ Before(function () { | |
|
||
After(function () { | ||
const world = this as SdkWorld; | ||
if (world.edgeServer) { | ||
console.log('shutting down edge connection', world.edgeServer.getApiKeys(), world.edgeServer.url()); | ||
world.edgeServer.close(); | ||
console.log('edge connection closed'); | ||
try { | ||
if (world.edgeServer) { | ||
console.log('shutting down edge connection', world.edgeServer.getApiKeys(), world.edgeServer.url()); | ||
world.edgeServer.close(); | ||
console.log('edge connection closed'); | ||
} | ||
} catch (e) { | ||
logger.error('failed', e); | ||
} | ||
}); | ||
|
||
|
@@ -74,7 +79,11 @@ Before('@needs-webserver', async function() { | |
}); | ||
|
||
After('@needs-webserver', async function() { | ||
await terminateServer(); | ||
try { | ||
await terminateServer(); | ||
} catch (e) { | ||
logger.error('failed to terminate web server', e); | ||
} | ||
}); | ||
|
||
BeforeAll(async function() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.