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

refactor(backend): Simplify CredentialsField usage + use ProviderName globally #8725

Open
wants to merge 90 commits into
base: dev
Choose a base branch
from

Conversation

Pwuts
Copy link
Member

@Pwuts Pwuts commented Nov 20, 2024

  1. For convenience we need a single "directory" of all the providers existing in our system. ProviderName fills that gap.
  2. Defining a credentials input currently requires defining the provider and credential type(s) both on CredentialsMetaInput and CredentialsField. For better DX, this redundancy should be removed, but without compromising schema generation and data validation.

Changes 🏗️

  • Avoid double specifying provider and cred types on credentials inputs
  • Use ProviderName enum globally

Pwuts and others added 30 commits October 17, 2024 00:11
…inier/open-1961-implement-github-on-pull-request-block
…inier/open-1961-implement-github-on-pull-request-block
@aarushik93
Copy link
Contributor

Haven't reviewed or tested yet - but is this going to be a breaking change for ppls existing blocks at all?

@majdyz majdyz removed their request for review November 20, 2024 12:52
@Pwuts
Copy link
Member Author

Pwuts commented Nov 20, 2024

is this going to be a breaking change for ppls existing blocks at all?

Nope, this is purely a refactor for DX purposes. Serialization and validation of existing objects shouldn't be affected.

@Pwuts Pwuts force-pushed the reinier/open-1961-implement-github-on-pull-request-block branch from c415bd0 to 397ae0b Compare November 21, 2024 19:09
@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Nov 21, 2024
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

Resolves #8357

- Add user flow to explicitly confirm deleting credentials linked to in-use webhooks
- Add logic to deregister, remove, and unlink webhooks before deleting parent credentials
- backend: Add `NeedConfirmation` exception
- frontend: Add `AlertDialog` UI component
Resolves #8738

- Disable webhook blocks if `PLATFORM_BASE_URL` is not set
- Throw `MissingConfigError` when trying to set up a node-webhook-link if `PLATFORM_BASE_URL` is not set
- Add `MissingConfigError`
- Add field validator to `Config.platform_base_url` and `Config.frontend_base_url`
@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Nov 22, 2024
Copy link
Contributor

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

kcze
kcze previously approved these changes Nov 23, 2024
Copy link
Contributor

@kcze kcze left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -16,7 +17,7 @@

GithubCredentials = APIKeyCredentials | OAuth2Credentials
GithubCredentialsInput = CredentialsMetaInput[
Literal["github"],
Literal[ProviderName.GITHUB],
Literal["api_key", "oauth2"] if GITHUB_OAUTH_IS_CONFIGURED else Literal["api_key"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't know you could use a condition inside generic type 😮

Base automatically changed from reinier/open-1961-implement-github-on-pull-request-block to dev November 25, 2024 17:42
@Pwuts Pwuts dismissed kcze’s stale review November 25, 2024 17:42

The base branch was changed.

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Nov 25, 2024
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Nov 25, 2024
Copy link
Contributor

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

Copy link

netlify bot commented Nov 25, 2024

Deploy Preview for auto-gpt-docs ready!

Name Link
🔨 Latest commit c33ec60
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/6744b97de8dbc2000830ea4e
😎 Deploy Preview https://deploy-preview-8725--auto-gpt-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation platform/backend AutoGPT Platform - Back end platform/blocks size/l
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants