فهرست منبع

remove deprecated github-token config (#2334)

Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
Engel Nyst 1 سال پیش
والد
کامیت
fab8c9003b
4فایلهای تغییر یافته به همراه3 افزوده شده و 13 حذف شده
  1. 0 2
      opendevin/core/config.py
  2. 0 1
      opendevin/core/schema/config.py
  3. 1 6
      tests/unit/test_config.py
  4. 2 4
      tests/unit/test_logging.py

+ 0 - 2
opendevin/core/config.py

@@ -149,7 +149,6 @@ class AppConfig(metaclass=Singleton):
         disable_color: Whether to disable color. For terminals that don't support color.
         sandbox_user_id: The user ID for the sandbox.
         sandbox_timeout: The timeout for the sandbox.
-        github_token: The GitHub token.
         debug: Whether to enable debugging.
         enable_auto_lint: Whether to enable auto linting. This is False by default, for regular runs of the app. For evaluation, please set this to True.
     """
@@ -183,7 +182,6 @@ class AppConfig(metaclass=Singleton):
     persist_sandbox: bool = False
     ssh_port: int = 63710
     ssh_password: str | None = None
-    github_token: str | None = None
     jwt_secret: str = uuid.uuid4().hex
     debug: bool = False
     enable_auto_lint: bool = (

+ 0 - 1
opendevin/core/schema/config.py

@@ -41,5 +41,4 @@ class ConfigType(str, Enum):
     USE_HOST_NETWORK = 'USE_HOST_NETWORK'
     SSH_HOSTNAME = 'SSH_HOSTNAME'
     DISABLE_COLOR = 'DISABLE_COLOR'
-    GITHUB_TOKEN = 'GITHUB_TOKEN'
     DEBUG = 'DEBUG'

+ 1 - 6
tests/unit/test_config.py

@@ -160,8 +160,6 @@ def test_invalid_toml_format(monkeypatch, temp_toml_file, default_config):
     default_config.jwt_secret = None  # prevent leak
     assert default_config.llm.model == 'gpt-5-turbo-1106'
     assert default_config.llm.custom_llm_provider is None
-    if default_config.github_token is not None:  # prevent leak
-        pytest.fail('GitHub token should be empty')
     if default_config.llm.api_key is not None:  # prevent leak
         pytest.fail('LLM API key should be empty.')
 
@@ -270,16 +268,13 @@ def test_api_keys_repr_str():
         llm=llm_config,
         agent=agent_config,
         e2b_api_key='my_e2b_api_key',
-        github_token='my_github_token',
     )
     assert "e2b_api_key='******'" in repr(app_config)
-    assert "github_token='******'" in repr(app_config)
     assert "e2b_api_key='******'" in str(app_config)
-    assert "github_token='******'" in str(app_config)
 
     # Check that no other attrs in AppConfig have 'key' or 'token' in their name
     # This will fail when new attrs are added, and attract attention
-    known_key_token_attrs_app = ['e2b_api_key', 'github_token']
+    known_key_token_attrs_app = ['e2b_api_key']
     for attr_name in dir(AppConfig):
         if (
             not attr_name.startswith('__')

+ 2 - 4
tests/unit/test_logging.py

@@ -82,13 +82,11 @@ def test_llm_config_attributes_masking(test_handler):
 
 def test_app_config_attributes_masking(test_handler):
     logger, stream = test_handler
-    app_config = AppConfig(
-        e2b_api_key='e2b-xyz789', github_token='ghp_abcdefghijklmnopqrstuvwxyz'
-    )
+    app_config = AppConfig(e2b_api_key='e2b-xyz789')
     logger.info(f'App Config: {app_config}')
     log_output = stream.getvalue()
     assert "e2b_api_key='******'" in log_output
-    assert "github_token='******'" in log_output
+    assert 'github_token' not in log_output
     assert 'e2b-xyz789' not in log_output
     assert 'ghp_abcdefghijklmnopqrstuvwxyz' not in log_output