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

feat(general): remove env var for running contributor metrics report and add logs #3873

Merged
merged 1 commit into from
Nov 14, 2022
Merged
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
1 change: 1 addition & 0 deletions checkov/contributor_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


def report_contributor_metrics(repository: str, bc_integration: BcPlatformIntegration) -> None: # ignore: type
logging.debug(f"Attempting to get log history for repository {repository}")
request_body = parse_gitlog(repository)
if request_body:
response = request_wrapper(
Expand Down
6 changes: 3 additions & 3 deletions checkov/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ def run(banner: str = checkov_banner, argv: List[str] = sys.argv[1:]) -> Optiona
repo_branch=config.branch,
prisma_api_url=config.prisma_api_url)

should_run_contributor_reporting = os.getenv('RUN_CONTRIBUTOR_REPORTING', False)
# TODO : Replace the following condition with: if source.report_contributor_metrics and config.repo_id and config.prisma_api_url:
if should_run_contributor_reporting:
should_run_contributor_metrics = source.report_contributor_metrics and config.repo_id and config.prisma_api_url
logger.debug(f"Should run contributor metrics report: {should_run_contributor_metrics}")
if should_run_contributor_metrics:
try: # collect contributor info and upload
report_contributor_metrics(config.repo_id, bc_integration)
except Exception as e:
Expand Down