From b7389e6323fa3c14800f8fd1f4a0c191b03709c7 Mon Sep 17 00:00:00 2001 From: BoYanZh Date: Fri, 31 Jan 2025 18:46:02 -0500 Subject: [PATCH] feat: rename joj3-env to joj3-all-env --- joint_teapot/app.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/joint_teapot/app.py b/joint_teapot/app.py index 425043e..2932314 100644 --- a/joint_teapot/app.py +++ b/joint_teapot/app.py @@ -644,22 +644,18 @@ def joj3_all( @app.command( - "joj3-env", + "joj3-all-env", help="run all joj3 tasks from env var and cli args", ) -def joj3_env( +def joj3_all_env( env_path: str = Argument("", help="path to .env file"), score_file_path: str = Argument( "", help="path to score json file generated by JOJ3" ), - repo_name: str = Argument( + grading_repo_name: str = Argument( "", help="name of grading repo to push failed table file", ), - submitter_repo_name: str = Argument( - "", - help="repository's name of the submitter", - ), scoreboard_file_name: str = Argument( "scoreboard.csv", help="name of scoreboard file in the gitea repo" ), @@ -694,14 +690,24 @@ def joj3_env( commit_hash = os.getenv("GITHUB_SHA") run_id = os.getenv("RUN_ID") groups = os.getenv("GROUPS") - if None in (submitter, run_number, exercise_name, commit_hash, run_id, groups): + repository = os.getenv("GITHUB_REPOSITORY") + if None in ( + submitter, + run_number, + exercise_name, + commit_hash, + run_id, + groups, + repository, + ): logger.error("missing required env var") raise Exit(code=1) + submitter_repo_name = (repository or "").split("/")[-1] joj3_all( env_path, score_file_path, submitter, - repo_name, + grading_repo_name, submitter_repo_name, run_number, scoreboard_file_name,