diff --git a/jf_agent/config_file_reader.py b/jf_agent/config_file_reader.py index 014e0eaa..2e91a4b0 100644 --- a/jf_agent/config_file_reader.py +++ b/jf_agent/config_file_reader.py @@ -376,7 +376,7 @@ def get_ingest_config( Handles converting our agent config to the jf_ingest IngestionConfig shared dataclass. """ - from jf_agent.git.utils import JF_INGEST_SUPPORTED_PROVIDERS + from jf_agent.git.utils import GH_PROVIDER, JF_INGEST_SUPPORTED_PROVIDERS company_info = get_company_info(config, creds) @@ -480,6 +480,12 @@ def get_ingest_config( instance_creds = list(creds.git_instance_to_creds.values())[0] instance_slug = endpoint_git_instance_info['slug'] + if agent_git_config.git_provider == GH_PROVIDER and not endpoint_git_instance_info.get( + 'supports_graphql_endpoints', False + ): + # For legacy reasons, to use the JF Ingest adapter for Github you need to have this feature flag enabled + continue + jf_ingest_git_auth_config = _get_jf_ingest_git_auth_config( company_slug=company_slug, config=agent_git_config, diff --git a/jf_agent/git/utils.py b/jf_agent/git/utils.py index bfa84b16..7573956b 100644 --- a/jf_agent/git/utils.py +++ b/jf_agent/git/utils.py @@ -2,6 +2,8 @@ import logging from typing import Any, List +from jf_ingest.config import GitProviderInJellyfishRepo + logger = logging.getLogger(__name__) ''' @@ -27,6 +29,10 @@ JF_INGEST_SUPPORTED_PROVIDERS = ( GH_PROVIDER, ADO_PROVIDER, + # Agent and Jellyfish (Direct Connect) enums don't match 100%, + # so this list must account for both + GitProviderInJellyfishRepo.GITHUB.value, + GitProviderInJellyfishRepo.ADO.value, ) diff --git a/jf_agent/main.py b/jf_agent/main.py index 93557ae0..bbe025a9 100644 --- a/jf_agent/main.py +++ b/jf_agent/main.py @@ -279,12 +279,16 @@ def main(): # JF Ingest from jf_agent.git.utils import JF_INGEST_SUPPORTED_PROVIDERS + # Extreme paranoia, normalize everything to lowercase + lower_case_supported_providers = [ + provider.lower() for provider in JF_INGEST_SUPPORTED_PROVIDERS + ] directories_to_skip_uploading_for.update( [ f'git_{git_config.instance_file_key}' for git_config in ingest_config.git_configs if git_config.git_provider.value.lower() - in JF_INGEST_SUPPORTED_PROVIDERS + in lower_case_supported_providers ] ) # Jira is supported by all customers, always skip it