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

fix(platform): Stop the start up & shutdown of LaunchDarkly on local envs #8897

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

aarushik93
Copy link
Contributor

We aren't using Launch Darkly locally and so it's not set up but it was still attempting to shut down LaunchDarkly when the app shutdown, causing errors on shutdown. This PR fixes that issue by entirely disabling LD on local machines.

Changes 🏗️

Added a contextmanager to handle LaunchDarkly start up and shutdown
Added a check for local environment in said context manager

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

@aarushik93 aarushik93 requested a review from a team as a code owner December 6, 2024 11:06
@aarushik93 aarushik93 requested review from Swiftyos and Pwuts and removed request for a team December 6, 2024 11:06
@aarushik93 aarushik93 requested a review from majdyz December 6, 2024 11:07
Copy link

qodo-merge-pro bot commented Dec 6, 2024

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Error Handling
The LaunchDarkly initialization could fail and throw an exception. Consider adding error handling around the initialize_launchdarkly() call to gracefully handle initialization failures.

Code Structure
The launch_darkly_context manager could be moved to a separate module focused on feature flag management to improve code organization and separation of concerns.

@github-actions github-actions bot added platform/backend AutoGPT Platform - Back end and removed Review effort [1-5]: 2 labels Dec 6, 2024
Copy link

netlify bot commented Dec 6, 2024

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

Name Link
🔨 Latest commit c5626d8
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/6752dde52a8a63000964c670

@github-actions github-actions bot added the size/m label Dec 6, 2024
@aarushik93 aarushik93 requested a review from ntindle December 6, 2024 11:08
Copy link

netlify bot commented Dec 6, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit c5626d8
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/6752dde5d9a15c000817b031

@aarushik93 aarushik93 enabled auto-merge December 6, 2024 11:08
@aarushik93 aarushik93 disabled auto-merge December 6, 2024 11:20
@aarushik93 aarushik93 enabled auto-merge December 6, 2024 11:20
@aarushik93 aarushik93 added this pull request to the merge queue Dec 6, 2024
Merged via the queue into dev with commit ea6c9a1 Dec 6, 2024
19 checks passed
@aarushik93 aarushik93 deleted the aarushikansal/fix-local-shutdown branch December 6, 2024 13:09
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 size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants