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

Add settings #11446

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dojo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3197,7 +3197,7 @@ def get_scm_type(self):
st = dojo_meta.value.strip()
if st:
return st.lower()
return ""
return settings.DEFAULT_SCM_TYPE

def scm_public_prepare_base_link(self, uri):
# scm public (https://scm-domain.org) url template for browse is:
Expand Down
15 changes: 15 additions & 0 deletions dojo/settings/settings.dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@
# For HTTP requests, how long connection is open before timeout
# This settings apply only on requests performed by "requests" lib used in Dojo code (if some included lib is using "requests" as well, this does not apply there)
DD_REQUESTS_TIMEOUT=(int, 30),
# When scm-type is not found for a product returns the specified value
DD_DEFAULT_SCM_TYPE=(str, ""),
# When set, use this method for connect to jira
DD_JIRA_CONNECT_METHOD=(str, ""),
)


Expand Down Expand Up @@ -1807,6 +1811,17 @@ def saml2_attrib_map_format(dict):
# ------------------------------------------------------------------------------
REQUESTS_TIMEOUT = env("DD_REQUESTS_TIMEOUT")

if env("DD_DEFAULT_SCM_TYPE") in ["github", "gitlab", "gitea", "codeberg", "bitbucket", "bitbucket-standalone"]:
DEFAULT_SCM_TYPE = env("DD_DEFAULT_SCM_TYPE")
else:
DEFAULT_SCM_TYPE = ""

# Example:
# For file /app/dojo/jira_link/helper_jira.py with method connect_to_jira_by_token(jira_server, _, jira_token)
# DD_JIRA_CONNECT_METHOD = dojo.jira_link.helper_jira.connect_to_jira_by_token
if env("DD_JIRA_CONNECT_METHOD"):
JIRA_CONNECT_METHOD = env("DD_JIRA_CONNECT_METHOD")

# ------------------------------------------------------------------------------
# Ignored Warnings
# ------------------------------------------------------------------------------
Expand Down
Loading