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): Apply lint on autogpt_lib folder on backend/linter.py #8751

Conversation

majdyz
Copy link
Contributor

@majdyz majdyz commented Nov 25, 2024

linter.py, only applies in the backend module, not autogpt_libs.

The scope of this PR is to clear this out.

Changes 🏗️

  • Add a linting scope to both the backend & autogpt_libs modules, and apply the linter.

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

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

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

Code Smell
The settings variable is redefined multiple times across different files. Consider refactoring to avoid redundancy and potential inconsistencies.

Code Smell
The import statements for Config and Secrets from autogpt_libs.utils.settings are repeated in multiple files. Consider centralizing these imports to improve maintainability.

Possible Bug
The docs_url assignment logic might not work as intended if settings.config.app_env is not local. Ensure that the URL is correctly set for other environments.

Copy link

netlify bot commented Nov 25, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 0fa679b
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/674d16a892020600088ba301

@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 26, 2024
Copy link
Contributor

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

@majdyz majdyz enabled auto-merge (squash) November 26, 2024 04:13
@majdyz majdyz force-pushed the zamilmajdy/open-1980-update-rest-server-to-have-a-db-manager-process branch from 966dcba to 4ace1aa Compare November 26, 2024 04:31
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Nov 26, 2024
@ntindle
Copy link
Member

ntindle commented Nov 26, 2024

why do we have the lib? market is moving into the backend in #8306 right? why not just delete the whole thing and put it in backend

@majdyz
Copy link
Contributor Author

majdyz commented Nov 26, 2024

why do we have the lib? market is moving into the backend in #8306 right? why not just delete the whole thing and put it in backend

I think this is a separate useful discussion, Currently, it's very easy to introduce something that will be used in multiple services running in different nodes without even noticing. The aim for this PR is to reduce as much as possible the usage of backend code in IntegrationCredentialManagerStore code in lib, which was introduced as a hack.

@ntindle @Pwuts I think you can decide whether the libs still provide value or not.

@aarushik93
Copy link
Contributor

Imo, until market actually is merged as one we should keep autogpt_libs and if we want to delete it do it in a different PR afterwards

@majdyz
Copy link
Contributor Author

majdyz commented Nov 27, 2024

Agree... Can I get review on this? :)))

Copy link

netlify bot commented Nov 27, 2024

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

Name Link
🔨 Latest commit 0fa679b
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/674d16a9c393d20008a5e87b

@Pwuts Pwuts changed the title feat(backend): Move Settings to AutoGPTLib & Spin-up Database manager on rest.py refactor(backend): Move Settings to AutoGPTLib & Spin-up Database manager on rest.py Nov 27, 2024
@github-actions github-actions bot added size/s and removed size/m labels Nov 27, 2024
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
@ntindle
Copy link
Member

ntindle commented Nov 29, 2024

Can we pretty please wait to do this until after #8648 if it turns into a ton of edited files

@aarushik93 aarushik93 disabled auto-merge December 1, 2024 15:28
@aarushik93 aarushik93 enabled auto-merge December 1, 2024 15:28
aarushik93
aarushik93 previously approved these changes Dec 1, 2024
@aarushik93 aarushik93 added this pull request to the merge queue Dec 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 1, 2024
@majdyz majdyz enabled auto-merge December 1, 2024 22:56
@majdyz majdyz disabled auto-merge December 2, 2024 01:50
@majdyz majdyz enabled auto-merge December 2, 2024 02:08
@majdyz majdyz requested a review from aarushik93 December 2, 2024 07:50
Copy link
Member

@Pwuts Pwuts left a comment

Choose a reason for hiding this comment

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

LGTM! :)

@majdyz majdyz added this pull request to the merge queue Dec 2, 2024
Merged via the queue into dev with commit 5c49fc8 Dec 2, 2024
19 checks passed
@majdyz majdyz deleted the zamilmajdy/open-1980-update-rest-server-to-have-a-db-manager-process branch December 2, 2024 10:11
github-merge-queue bot pushed a commit that referenced this pull request Dec 3, 2024
- Resolves #8859
- Follow-up to #8751

### Changes
- Add `autogpt_libs` to the backend CI path filter
- Add `ruff format` step for `autogpt_libs` to `linter.py` and
`pre-commit` config
- Run `poetry run format` with the new setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants