Skip to content

Commit 2f67278

Browse files
OJ-45053: bump version and change config (#405)
* OJ-45053: bump version and change config * OJ-45053: variable rename * Update example.yml Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update example.yml Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 426b356 commit 2f67278

4 files changed

Lines changed: 33 additions & 8 deletions

File tree

example.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,16 @@ jira:
5151

5252
# Whether the agent should download sprints. If omitted, defaults to True.
5353
download_sprints: True
54-
55-
# When provided, we will recurively download all parents until we run out of parents
54+
# If False, the agent will attempt to download all boards it can see via
55+
# the Jira Boards API. If set to True then we will only filter for boards
56+
# that are associated with the projects you have specified in the
57+
# `include_projects` or `exclude_projects` fields. This is useful if you
58+
# have a large number of boards in your Jira instance and you only want
59+
# to pull data from boards that are associated with the projects you are pulling.
60+
# Generally, however, we recommend leaving this as False.
61+
filter_boards_by_projects: False
62+
63+
# When provided, we will recursively download all parents until we run out of parents
5664
# to download. WARNING: This may greatly increase Agent run time!
5765
recursively_download_parents: False
5866

@@ -233,3 +241,12 @@ git:
233241
url: https://bitbucket-org2.yourcompany.com
234242
instance_slug: git_instance_slug_2
235243
creds_envvar_prefix: ORG2
244+
- provider: gitlab
245+
url: https://gitlab.yourcompany.com
246+
instance_slug: git_instance_slug_3
247+
creds_envvar_prefix: ORG3
248+
# Gitlab only: whether to keep the base URL while paging or to use the URL returned by the response headers.
249+
# This is useful when the Gitlab instance is behind a proxy and the base URL is not accessible.
250+
# Leverages the keep_base_url arg provided by the gitlab API client: https://python-gitlab.readthedocs.io/en/stable/api/gitlab.html
251+
# It is recommended that you DO NOT use this flag
252+
keep_base_url: False

jf_agent/config_file_reader.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from jf_ingest.config import AzureDevopsAuthConfig as JFIngestAzureDevopsAuthConfig
1313
from jf_ingest.config import GitAuthConfig as JFIngestGitAuthConfig
1414
from jf_ingest.config import GitConfig as JFIngestGitConfig
15+
from jf_ingest.config import GitLabAuthConfig as JFIngestGitLabAuthConfig
1516
from jf_ingest.config import IngestionConfig, IngestionType, IssueMetadata, JiraDownloadConfig
1617

1718
from jf_agent import JELLYFISH_API_BASE, VALID_RUN_MODES
@@ -37,6 +38,7 @@ class GitConfig:
3738
git_redact_names_and_urls: bool
3839
gitlab_per_page_override: bool
3940
git_verbose: bool
41+
gitlab_keep_base_url: bool
4042
# For multi-git
4143
creds_envvar_prefix: str
4244
# legacy fields ==================
@@ -70,6 +72,7 @@ class GitConfig:
7072
'jira_issue_jql',
7173
'jira_download_worklogs',
7274
'jira_download_sprints',
75+
'jira_filter_boards_by_projects',
7376
'jira_recursively_download_parents',
7477
'jira_skip_saving_data_locally',
7578
'git_configs',
@@ -167,6 +170,7 @@ def obtain_config(args) -> ValidatedConfig:
167170
jira_issue_jql = jira_config.get('issue_jql')
168171
jira_download_worklogs = jira_config.get('download_worklogs', True)
169172
jira_download_sprints = jira_config.get('download_sprints', True)
173+
jira_filter_boards_by_projects = jira_config.get('filter_boards_by_projects', False)
170174
jira_recursively_download_parents = jira_config.get('recursively_download_parents', False)
171175
jira_skip_saving_data_locally = jira_config.get('skip_saving_data_locally', False)
172176

@@ -278,6 +282,7 @@ def obtain_config(args) -> ValidatedConfig:
278282
jira_issue_jql,
279283
jira_download_worklogs,
280284
jira_download_sprints,
285+
jira_filter_boards_by_projects,
281286
jira_recursively_download_parents,
282287
jira_skip_saving_data_locally,
283288
git_configs, # array of GitConfig
@@ -341,11 +346,12 @@ def _get_jf_ingest_git_auth_config(
341346
verify=not skip_ssl_verification,
342347
)
343348
if config.git_provider == GL_PROVIDER:
344-
return JFIngestGitAuthConfig(
349+
return JFIngestGitLabAuthConfig(
345350
company_slug=company_slug,
346351
token=git_creds['gitlab_token'],
347352
base_url=config.git_url,
348353
verify=not skip_ssl_verification,
354+
keep_base_url=config.gitlab_keep_base_url,
349355
)
350356
if config.git_provider == ADO_PROVIDER:
351357
return JFIngestAzureDevopsAuthConfig(
@@ -444,6 +450,7 @@ def get_ingest_config(
444450
#
445451
# Sprints/Boards Info
446452
download_sprints=config.jira_download_sprints,
453+
filter_boards_by_projects=config.jira_filter_boards_by_projects,
447454
#
448455
# Issues
449456
full_redownload=False,
@@ -662,6 +669,7 @@ def _get_git_config(git_config, git_provider_override=None, multiple=False) -> G
662669
gitlab_per_page_override=git_config.get('gitlab_per_page_override', None),
663670
git_verbose=git_config.get('verbose', False),
664671
creds_envvar_prefix=creds_envvar_prefix,
672+
gitlab_keep_base_url=git_config.get('keep_base_url', False),
665673
# legacy fields ===========
666674
git_include_bbcloud_projects=list(git_include_bbcloud_projects),
667675
git_exclude_bbcloud_projects=list(git_exclude_bbcloud_projects),

pdm.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies = [
2020
"python-dotenv>=1.0.0",
2121
"structlog>=24.4.0",
2222
"colorama>=0.4.6",
23-
"jf-ingest==0.0.209",
23+
"jf-ingest==0.0.214",
2424
]
2525
requires-python = "~=3.10.15"
2626
readme = "README.md"

0 commit comments

Comments
 (0)