From c1036aabc8826cf5a82f795ff68190edbf3a8a48 Mon Sep 17 00:00:00 2001 From: Isaac Milarsky Date: Tue, 15 Oct 2024 18:19:23 -0500 Subject: [PATCH] fix scorecard flag from repo to local as well as syntax in metadata exception Signed-off-by: Isaac Milarsky --- augur/tasks/git/dependency_tasks/core.py | 4 ++-- augur/tasks/git/dependency_tasks/tasks.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/augur/tasks/git/dependency_tasks/core.py b/augur/tasks/git/dependency_tasks/core.py index 8d60901ede..39a18ca820 100644 --- a/augur/tasks/git/dependency_tasks/core.py +++ b/augur/tasks/git/dependency_tasks/core.py @@ -76,7 +76,7 @@ def generate_scorecard(logger, repo_git): path = repo_git[8:] if path[-4:] == '.git': path = path.replace(".git", "") - command = '--repo=' + path + command = '--local=' + path #this is path where our scorecard project is located path_to_scorecard = os.environ['HOME'] + '/scorecard' @@ -99,7 +99,7 @@ def generate_scorecard(logger, repo_git): logger.info('adding to database...') logger.debug(f"output: {required_output}") - if not required_output['checks']: + if not required_output.get('checks'): logger.info('No scorecard checks found!') return diff --git a/augur/tasks/git/dependency_tasks/tasks.py b/augur/tasks/git/dependency_tasks/tasks.py index b104080bb3..731c71d003 100644 --- a/augur/tasks/git/dependency_tasks/tasks.py +++ b/augur/tasks/git/dependency_tasks/tasks.py @@ -27,7 +27,7 @@ def process_ossf_dependency_metrics(self, repo_git): logger.warning(f'Exception generating scorecard: {e}') tracer = ''.join(traceback.format_exception(type(e), e, e.__traceback__)) logger.warning(f'Full stack trace of OpenSSF scorecard error: {tracer}') - raise MetadataException(f"An error occurred while generating the scorecard: {str(e)}") + raise MetadataException(e,f"An error occurred while generating the scorecard: {str(e)}") """ This try/except block is an attempt to get more information about this occasional error: