AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Simplify terms like "allowlisted". Implement plugin denial env.

Open bobisme opened this issue 2 years ago • 1 comments
trafficstars

Background

I noticed an inclusive-language change where terms like "white" and "black" were replaced with "allow" and "deny" which resulted in awkward non-words like "allowlisted." Simpler terms would make the code cleaner and clearer.

Changes

  • Changed "allowlist" and "denylist" to thinks like "allowed" and "denied" for more natural language.
  • Note: This affects the ALLOWLISTED_PLUGINS env variable.
  • Also noticed the config for denied plugins was unimplemented, so I added that.

Documentation

Functions were already documented.

Test Plan

Unit tests already covered this functionality.

PR Quality Checklist

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

bobisme avatar Apr 25 '23 21:04 bobisme

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

github-actions[bot] avatar Apr 26 '23 20:04 github-actions[bot]

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

p-i- avatar May 05 '23 00:05 p-i-

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview May 20, 2023 9:27pm

vercel[bot] avatar May 20 '23 20:05 vercel[bot]

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

github-actions[bot] avatar May 20 '23 20:05 github-actions[bot]

Codecov Report

Patch coverage: 66.66% and no project coverage change.

Comparison is base (023a50d) 63.26% compared to head (e82ad5e) 63.26%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3254   +/-   ##
=======================================
  Coverage   63.26%   63.26%           
=======================================
  Files          74       74           
  Lines        3427     3427           
  Branches      504      504           
=======================================
  Hits         2168     2168           
  Misses       1103     1103           
  Partials      156      156           
Impacted Files Coverage Δ
autogpt/config/config.py 73.86% <50.00%> (ø)
autogpt/plugins.py 75.36% <85.71%> (ø)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar May 20 '23 21:05 codecov[bot]

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

github-actions[bot] avatar May 25 '23 18:05 github-actions[bot]

@CodiumAI-Agent

Torantulino avatar Jul 07 '23 13:07 Torantulino

PR Analysis

  • 🎯 Main theme: Renaming of variables and functions for better clarity and inclusivity
  • 🔍 Description and title: Yes
  • 📌 Type of PR: Refactoring
  • 🧪 Relevant tests added: Yes
  • Minimal and focused: Yes, the PR is focused on renaming variables and functions related to plugin loading for better clarity and inclusivity.
  • 🔒 Security concerns: No, the PR does not introduce any security concerns as it mainly involves renaming of variables and functions.

PR Feedback

  • 💡 General PR suggestions: The PR is well-structured and follows good practices. The renaming of variables and functions improves the clarity and inclusivity of the code. However, it's important to note that this PR introduces a breaking change by renaming environment variables. This should be clearly communicated to users and documented.

  • 🤖 Code suggestions:

    • relevant file: autogpt/config/config.py suggestion content: Consider adding a fallback mechanism to support the old environment variables (ALLOWLISTED_PLUGINS and DENYLISTED_PLUGINS) for backward compatibility. This can be done by checking if the new environment variables are not set, then fallback to the old ones. [important]

    • relevant file: autogpt/plugins.py suggestion content: The function name 'check_allowed' could be more descriptive. Consider renaming it to 'is_plugin_allowed' to make it clear that it returns a boolean indicating whether a plugin is allowed or not. [medium]

    • relevant file: tests/unit/test_plugins.py suggestion content: Update the test function names to reflect the new function name 'check_allowed'. For example, 'test_denylist_allowlist_check_denylist' could be renamed to 'test_check_allowed_when_denied'. [medium]

    • relevant file: .env.template suggestion content: Add comments in the .env.template file to inform users about the change in environment variables and the potential need to update their environment configurations. [important]

How to use

Tag me in a comment '@CodiumAI-Agent' to ask for a new review after you update the PR. You can also tag me and ask any question, for example '@CodiumAI-Agent is the PR ready for merge?'

CodiumAI-Agent avatar Jul 07 '23 13:07 CodiumAI-Agent