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

dx: Reduce number of files needed for OAuth and/or Webhook-triggered blocks #8735

Open
Tracked by #8358
Pwuts opened this issue Nov 21, 2024 · 2 comments
Open
Tracked by #8358

Comments

@Pwuts
Copy link
Member

Pwuts commented Nov 21, 2024

The number of files you need to add/edit for new blocks with auth, and webhook-triggered blocks, is quite large. For DX we should try to reduce/simplify this.

File you have to add/edit for a new block:

  • backend/blocks/my_block.py

Files where references have to be added for a new provider (in the credentials system):

  • backend/integrations/providers.py - ProviderName enum
  • frontend/src/components/integrations/credentials-input.tsx - providerIcons
  • frontend/src/components/integrations/credentials-provider.tsx - providerDisplayNames
  • frontend/src/lib/autogpt-server-api/types.ts - PROVDER_NAMES

Extra files for a new OAuth provider:

  • backend/integrations/oauth/{provider}.py
  • references in:
    • backend/integrations/oauth/__init__.py
    • backend/util/settings.py + .env.example - OAuth server credentials

Extra files for a new WebhooksManager:

  • backend/integrations/webhooks/{provider}.py
  • reference in backend/integrations/webhooks/__init__.py

I'm sure we can put the front end stuff together in one file. Not so sure about the back end. As long as it's clearly documented, I don't see an issue with having to add (references in) multiple files, but if we can reasonably avoid it that's still good.

Originally posted by @Pwuts in #8358 (comment)

Copy link
Member Author

Pwuts commented Nov 21, 2024

I wonder if we can do reflection to handle some of this via enumerators like we do enumerating the blocks in the directory

~ @ntindle

1 similar comment
Copy link
Member Author

Pwuts commented Nov 21, 2024

I wonder if we can do reflection to handle some of this via enumerators like we do enumerating the blocks in the directory

~ @ntindle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant