Skip to content

Commit

Permalink
feat(general): remove env var for running contributor metrics report …
Browse files Browse the repository at this point in the history
…and add logs (#3873)

remove env var for running contributor metrics report and add logs

Co-authored-by: Max Amelchenko <[email protected]>
  • Loading branch information
maxamel and Max Amelchenko authored Nov 14, 2022
1 parent 1129243 commit ccd70db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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

0 comments on commit ccd70db

Please sign in to comment.