Skip to content

feat(backend): Require discriminator value on graph save #9858

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

Conversation

Pwuts
Copy link
Member

@Pwuts Pwuts commented Apr 22, 2025

If a node has a multi-credentials input (e.g. AI Text Generator block) but the discriminator value (e.g. model choice) is missing, the input can't be discriminated into a single-provider input. Discrimination into a single-provider input is necessary to make a graph-level credentials input for use in the Library.

Changes 🏗️

  • feat(backend): Require discriminator fields to always have a value

  • dx(frontend): Improve typing of discriminator stuff

  • dx(frontend): Fix typing in NodeOneOfDiscriminatorField component

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • Saving & running graphs with and without credentials works normally
    • Note: We don't have any blocks with a discriminator that doesn't have a default value, so currently I don't think it's possible to produce a case where this mechanism would be triggered.

@Pwuts Pwuts requested a review from a team as a code owner April 22, 2025 10:46
@Pwuts Pwuts requested review from Swiftyos and Bentlybro and removed request for a team April 22, 2025 10:46
@github-project-automation github-project-automation bot moved this to 🆕 Needs initial review in AutoGPT development kanban Apr 22, 2025
@github-actions github-actions bot added platform/backend AutoGPT Platform - Back end size/m labels Apr 22, 2025
Copy link

netlify bot commented Apr 22, 2025

Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
🔨 Latest commit ab4d9fe
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/681a5a39f1dbae0008fed36d

Copy link

netlify bot commented Apr 22, 2025

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit ab4d9fe
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/681a5a396374a600081a9083

Copy link

deepsource-io bot commented Apr 22, 2025

Here's the code health analysis summary for commits d7077b5..ab4d9fe. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ Success
❗ 2 occurences introduced
🎯 7 occurences resolved
View Check ↗
DeepSource Python LogoPython✅ Success
❗ 1 occurence introduced
🎯 5 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@Pwuts Pwuts requested review from ntindle and majdyz and removed request for Swiftyos April 22, 2025 14:24
@Pwuts Pwuts changed the title feat(backend): Prohibit saving graph with missing discriminator values feat(backend): Require discriminator value on graph save Apr 22, 2025
majdyz
majdyz previously approved these changes Apr 23, 2025
@github-project-automation github-project-automation bot moved this from 🆕 Needs initial review to 👍🏼 Mergeable in AutoGPT development kanban Apr 23, 2025
@Pwuts Pwuts added this pull request to the merge queue May 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 2, 2025
@Pwuts Pwuts added this pull request to the merge queue May 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 2, 2025
@Pwuts Pwuts added this pull request to the merge queue May 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 2, 2025
@Pwuts
Copy link
Member Author

Pwuts commented May 2, 2025

Frontend checks are failing on the "add all blocks" test. 🤔

@github-actions github-actions bot added the platform/frontend AutoGPT Platform - Front end label May 6, 2025
@github-actions github-actions bot added size/l and removed size/m labels May 6, 2025
@Pwuts Pwuts requested a review from majdyz May 7, 2025 15:20
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

@Pwuts Pwuts added this pull request to the merge queue May 8, 2025
Merged via the queue into dev with commit 1ad6c76 May 8, 2025
27 checks passed
@Pwuts Pwuts deleted the pwuts/secrt-1244-prohibit-saving-a-graph-if-it-has-nodes-with-missing branch May 8, 2025 10:10
@github-project-automation github-project-automation bot moved this to Done in Frontend May 8, 2025
@github-project-automation github-project-automation bot moved this from 👍🏼 Mergeable to ✅ Done in AutoGPT development kanban May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end size/l
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants