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 Hubspot blocks #8786

Merged
merged 4 commits into from
Nov 29, 2024
Merged

feat(blocks): Add Hubspot blocks #8786

merged 4 commits into from
Nov 29, 2024

Conversation

aarushik93
Copy link
Contributor

@aarushik93 aarushik93 commented Nov 26, 2024

This PR adds the first few Hubspot blocks so we can create real sales and marketing agents.

Changes πŸ—οΈ

Added Hubspot blocks;

  • Aded auth for hubspot
  • Added Company block
  • Added Contact block
  • Added Engagement block

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:
    • ...
Example test plan
  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

For configuration changes:

  • .env.example is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)
Examples of configuration changes
  • Changing ports
  • Adding new services that need to communicate with each other
  • Secrets or environment variable changes
  • New or infrastructure changes such as databases

Copy link

netlify bot commented Nov 26, 2024

βœ… Deploy Preview for auto-gpt-docs canceled.

Name Link
πŸ”¨ Latest commit b84dda7
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/67478beb790a6d00083b0cb7

Copy link

netlify bot commented Nov 27, 2024

βœ… Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
πŸ”¨ Latest commit b84dda7
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/67478bebf6938d000899d610

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

PR Reviewer Guide πŸ”

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 πŸ”΅πŸ”΅πŸ”΅πŸ”΅βšͺ
πŸ§ͺΒ No relevant tests
πŸ”’Β Security concerns

API Key Exposure:
The API key is being passed in request headers without any additional encryption or security measures. While using HTTPS provides transport security, consider adding rate limiting and request validation to prevent potential abuse of the API key.

⚑ Recommended focus areas for review

Error Handling
The block lacks proper error handling for API requests. Failed requests could raise exceptions that are not caught and handled gracefully.

Hardcoded Value
The hubspot_owner_id is hardcoded to "1" in the email sending logic. This should be configurable through the input schema.

Data Validation
The contact_data and email inputs lack validation for required fields and format before making API calls.

@github-actions github-actions bot added the platform/frontend AutoGPT Platform - Front end label Nov 27, 2024
@aarushik93 aarushik93 added this pull request to the merge queue Nov 29, 2024
Merged via the queue into dev with commit 29f177e Nov 29, 2024
21 checks passed
@aarushik93 aarushik93 deleted the aarushikansal/hubspot branch November 29, 2024 09:40
Copy link
Member

Choose a reason for hiding this comment

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

These were alphabetically sorted lists, which helps a lot to avoid merge conflicts. Please keep this in mind in the future.

Comment on lines +16 to +19
operation: str = SchemaField(
description="Operation to perform (send_email, track_engagement)",
default="send_email",
)
Copy link
Member

Choose a reason for hiding this comment

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

Why aren't these separate blocks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They don't need to be seperate blocks. I plan to update the user experience though later to show and hide inputs based on what event is being done.

Copy link
Member

@Pwuts Pwuts Nov 29, 2024

Choose a reason for hiding this comment

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

I'm not familiar with Hubspot, but they seem two non-overlapping operations to me. So why are they in one block? The same goes for the HubspotCompanyBlock and HubspotContactBlock, which both support create/update/get operations with non-overlapping implementations.

Merging these in one block is a break of pattern regarding how we implement blocks.

It's important to get it right from the start because we currently don't have a way to make functional changes to blocks without breaking graphs where they are in use.

aarushik93 added a commit that referenced this pull request Dec 1, 2024
This PR adds the first few Hubspot blocks so we can create _real_ sales
and marketing agents.

### Changes πŸ—οΈ

Added Hubspot blocks; 

- Aded auth for hubspot
- Added Company block
- Added Contact block
- Added Engagement block

### 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:
  <!-- Put your test plan here: -->
  - [ ] ...

<details>
  <summary>Example test plan</summary>
  
  - [ ] Create from scratch and execute an agent with at least 3 blocks
- [ ] Import an agent from file upload, and confirm it executes
correctly
  - [ ] Upload agent to marketplace
- [ ] Import an agent from marketplace and confirm it executes correctly
  - [ ] Edit an agent from monitor, and confirm it executes correctly
</details>

#### For configuration changes:
- [ ] `.env.example` is updated or already compatible with my changes
- [ ] `docker-compose.yml` is updated or already compatible with my
changes
- [ ] I have included a list of my configuration changes in the PR
description (under **Changes**)

<details>
  <summary>Examples of configuration changes</summary>

  - Changing ports
  - Adding new services that need to communicate with each other
  - Secrets or environment variable changes
  - New or infrastructure changes such as databases
</details>
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