Skip to content
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

feat: @eventual/slack-integration #89

Merged
merged 22 commits into from
Dec 13, 2022
Merged

feat: @eventual/slack-integration #89

merged 22 commits into from
Dec 13, 2022

Conversation

sam-goodwin
Copy link
Owner

@sam-goodwin sam-goodwin commented Dec 11, 2022

Partial #92

apps/test-app-runtime/src/slack-bot.ts Outdated Show resolved Hide resolved
@@ -1,6 +1,6 @@
import "@eventual/entry/injected";

import { createApiHandler } from "@eventual/core";
import { ApiRequest, createApiHandler } from "@eventual/core";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just standardise on using the Request type from the fetch api?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just standardise on using the Request type from the fetch api?

I was thinking that too but i don't think it's compatible with Itty?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that's right, the node Request type doesn't have params

packages/@eventual/slack-integration/src/receiver.ts Outdated Show resolved Hide resolved
packages/@eventual/slack-integration/src/slack.ts Outdated Show resolved Hide resolved
@sam-goodwin sam-goodwin mentioned this pull request Dec 12, 2022
3 tasks
@sam-goodwin sam-goodwin marked this pull request as ready for review December 12, 2022 14:28
apps/test-app-runtime/src/slack-bot.ts Outdated Show resolved Hide resolved
packages/@eventual/aws-runtime/src/handlers/api-handler.ts Outdated Show resolved Hide resolved
packages/@eventual/integrations-slack/src/receiver.ts Outdated Show resolved Hide resolved
packages/@eventual/integrations-slack/src/receiver.ts Outdated Show resolved Hide resolved
Comment on lines +7 to +14
credentials: new JsonSecret<SlackCredentials>(
new AWSSecret({
secretId: process.env.SLACK_SECRET_ID!,
cacheConfig: {
enabled: false,
},
})
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is the wrapper needed? AWSSecret.json<SlackCredentials>()

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible but it's also a bit shitty to make type-safe. Typing the input is easier than creating an abstract class with a asJson method that ensures the base-secret is a Secret<string>.

Comment on lines +46 to +47
this.client =
props.client ?? (_defaultClient ??= new SecretsManagerClient({}));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the memoization system the rest of them use?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would that do for me? Isn't this simple enough?

packages/@eventual/cli/src/commands/replay.ts Outdated Show resolved Hide resolved
Comment on lines +66 to +67
new Date().getTime() - this.#value.refreshTime.getTime() >
this.cachingConfig.ttl)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of refresh time, could you store expire time?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what the difference is?

packages/@eventual/integrations-slack/src/receiver.ts Outdated Show resolved Hide resolved
packages/@eventual/integrations-slack/src/receiver.ts Outdated Show resolved Hide resolved
packages/@eventual/integrations-slack/src/slack.ts Outdated Show resolved Hide resolved
@sam-goodwin sam-goodwin merged commit d361c35 into main Dec 13, 2022
@sam-goodwin sam-goodwin deleted the sam/slack-bot branch December 13, 2022 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants