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

Clean config #3794

Closed
wants to merge 9 commits into from
Closed

Clean config #3794

wants to merge 9 commits into from

Conversation

ido777
Copy link
Contributor

@ido777 ido777 commented May 4, 2023

Background

In version 0.3 some changes to the config of the commands were done and disabled commands were added to the .env file. This creates a situation the configuration is spread around many locations with no consistency.
Moreover, the implementation of disabled commands in the env s is a bit problematic since it is a list that is separated by a comma. Regardless of the edge cases (empty list or list with one item that does not include a comma)

This PR sets the foundation for more consistent configuration.
The idea is you have the hierarchy

  1. default values in the code
  2. yaml configuration file
  3. .env file
  4. env variables
  5. command line arguments

so I added commands and disabled commands to a configuration yaml and overwritten by the .env and env variables + tests.

Changes

  1. added a comment to the env file for the yaml configuration file
  2. added to CommandRegistry method to deal with a list (instead of doing a list to call one insert command)
  3. add code to read config from the yaml and to overwrite with the env variables (yaml keys are lowercase while env var are uppercase)
  4. added handling in edge cases
  5. added load_dotenv for loading the env file
  6. added tests

Documentation

Test Plan

Since it is refactoring part of the work is to make regression work and I added test

PR Quality Checklist

  • [] My pull request is atomic and focuses on a single charge.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

@vercel
Copy link

vercel bot commented May 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) May 4, 2023 3:44pm

@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2023

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

@p-i-
Copy link
Contributor

p-i- commented May 5, 2023

This is a mass message from the AutoGPT core team.
Our apologies for the ongoing delay in processing PRs.
This is because we are re-architecting the AutoGPT core!

For more details (and for infor on joining our Discord), please refer to:
https://github.com/Significant-Gravitas/Auto-GPT/wiki/Architecting

@Boostrix
Copy link
Contributor

Boostrix commented May 5, 2023

As mentioned elsewhere, I would also suggest to introduce version fields for these config files, so that these can be easily migrated if/when the need arises, including changes breaking backward compatibility (#3678 ).

@ido777
Copy link
Contributor Author

ido777 commented May 5, 2023 via email

@Boostrix
Copy link
Contributor

Boostrix commented May 5, 2023

it also seems there are currently some other env/yaml related PRs in process - maybe you could reach out to those folks so that these could integrate their changes with your branch - to hopefully reduce the amount of work for the devs to get this reviewed/integrated, given the ongoing re-arch effort mentioned above.

given the manpower constraints mentioned above, it might be best if the people working on related/overlapping functionality could team up together and mutually review their changes and then get those integrated into common branch (using 3 distinct commits), but rebase onto the master branch - so that the devs have less work to do ?

What do you think ?

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label May 19, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@Swiftyos Swiftyos closed this Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Automatically applied to PRs with merge conflicts size/xl
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants