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: introduce new bot-framework library #5236

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

feat: introduce new bot-framework library #5236

wants to merge 27 commits into from

Conversation

chingor13
Copy link
Contributor

@chingor13 chingor13 commented Sep 25, 2023

Reimplements gcf-utils as bot-framework without probot as a dependency. @octokit/webhooks already handles webhook routing and signature verification.

The design principles I tried to follow were:

  • to explicitly specify configuration at construction time
  • abstract away Cloud APIs into optional interfaces that are replaceable (via dependency injection) at construction time
    • TaskEnqueuer - queue payload for a background task
    • PayloadCache - save payload in a cache to save space in background task
    • SecretLoader - load secrets (private key, webhook secret, etc) for a bot
    • InstallationHandler - fetch bot installations (mostly used for test mocking)

Rather than making this rewrite a completely breaking change for gcf-utils, I opted to make this a new library that should more or less be a drop in replacement for gcf-utils.

Other considerations:

  • consider splitting gcf-logger into its own standalone package
  • separate core interfaces from Google-specific implementations (bot-framework library, then google-bot-framework library that provides GCP implementations).

@generated-files-bot
Copy link

Warning: This pull request is touching the following templated files:

  • .github/workflows/ci.yaml - .github/workflows/ci.yaml (GitHub Actions) should be updated in synthtool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was for local testing and can be removed later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for local testing and can be removed later.

@chingor13 chingor13 marked this pull request as ready for review October 3, 2023 17:21
@chingor13 chingor13 requested a review from a team as a code owner October 3, 2023 17:21
@@ -0,0 +1,18 @@
# foo
Copy link
Contributor

Choose a reason for hiding this comment

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

Imagine I want to write a new bot.* Please describe the list of services provided by this library and why I would want to use them.

  • I know we said we never want to write a new bot, but I think imagining we might will result in a README that better helps maintainers.

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.

2 participants