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(blocks): Add Slant 3D printing via API service #8805

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

Conversation

ntindle
Copy link
Member

@ntindle ntindle commented Nov 27, 2024

I want to be able to have agents 3d print things and deliver them to my house!

Changes 🏗️

  • Adds slant3d as a provider
  • Adds slant3d order webhook (disabled on the cloud by default due to how it notifies users)
  • Adds several blocks to order from slant3d
  • Diables Get Orders (for the same reason as webhook)

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
Test Plan

Copy link

netlify bot commented Nov 27, 2024

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

Name Link
🔨 Latest commit 8a7cc52
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/674e16dfebf8470008d755d8

@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end platform/blocks size/xl labels Nov 27, 2024
Copy link

netlify bot commented Nov 27, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 8a7cc52
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/674e16df4458220007e149a3

@ntindle ntindle marked this pull request as ready for review November 29, 2024 07:27
@ntindle ntindle requested a review from a team as a code owner November 29, 2024 07:27
@ntindle ntindle requested review from aarushik93 and majdyz and removed request for a team November 29, 2024 07:27
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 Security concerns

API Key Exposure:
The code includes test credentials with a mock API key ('mock-slant3d-api-key') in _api.py. While this is just for testing, care should be taken to ensure these test credentials are never used in production environments. Additionally, the webhook implementation should validate the source of incoming webhook requests to prevent unauthorized access.

⚡ Recommended focus areas for review

Input Validation
The order creation endpoint accepts raw input without validating file URLs or quantity values. Should add validation to ensure file URLs are valid STL files and quantities are positive numbers.

Error Handling
The _make_request method catches all exceptions generically and returns "Unknown error". Should handle specific HTTP/API errors separately with more detailed error messages.

Missing Functionality
The webhook deregistration is not implemented and just logs a warning. This could lead to lingering webhook subscriptions that cannot be cleaned up properly.


if color_tag not in valid_tags:
raise ValueError(
f"Invalid color profile combination {color_tag}. Valid colors for {profile.value} are: {','.join([filament['colorTag'].replace(profile.value.lower(), '') for filament in response['filaments'] if filament['profile'] == profile.value])}"
Copy link
Member

Choose a reason for hiding this comment

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

Please split this into multiple lines

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Comment on lines 50 to 52
# Slant3D doesn't return a webhook ID, so we generate one
# The actual webhook is identified by its endpoint URL
webhook_id = str(__import__("uuid").uuid4())
Copy link
Member

Choose a reason for hiding this comment

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

  1. __import__("uuid").uuid4() 👎🏼
  2. This isn't a structural solution. If there is no real ID the field should be left empty.

Copy link
Member Author

Choose a reason for hiding this comment

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

This should be documented better, I'd expect this to be None, but the signature only allows str

@majdyz majdyz removed their request for review December 2, 2024 02:55
@Pwuts Pwuts changed the title feat(blocks): Add slant3d 3d printing via api service feat(blocks): Add Slant 3D printing via API service Dec 2, 2024
@ntindle
Copy link
Member Author

ntindle commented Dec 2, 2024

image

Not positive what I ordered but it should ship

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

Successfully merging this pull request may close these issues.

3 participants