forked from JOJ/Joint-Teapot
		
	feat: more info in joj3 commit msgs
This commit is contained in:
		
							parent
							
								
									6c047795ea
								
							
						
					
					
						commit
						f3f45f8280
					
				|  | @ -224,6 +224,14 @@ def joj3_scoreboard( | ||||||
|         "", |         "", | ||||||
|         help="name of grading repo to push scoreboard file", |         help="name of grading repo to push scoreboard file", | ||||||
|     ), |     ), | ||||||
|  |     submitter_repo_name: str = Argument( | ||||||
|  |         "", | ||||||
|  |         help="repository's name of the submitter", | ||||||
|  |     ), | ||||||
|  |     run_number: str = Argument( | ||||||
|  |         "", | ||||||
|  |         help="gitea actions run number", | ||||||
|  |     ), | ||||||
|     scoreboard_file_name: str = Argument( |     scoreboard_file_name: str = Argument( | ||||||
|         "scoreboard.csv", help="name of scoreboard file in the gitea repo" |         "scoreboard.csv", help="name of scoreboard file in the gitea repo" | ||||||
|     ), |     ), | ||||||
|  | @ -249,9 +257,16 @@ def joj3_scoreboard( | ||||||
|         submitter, |         submitter, | ||||||
|         os.path.join(repo_path, scoreboard_file_name), |         os.path.join(repo_path, scoreboard_file_name), | ||||||
|     ) |     ) | ||||||
|     tea.pot.git.add_commit_and_push( |     actions_link = ( | ||||||
|         repo_name, [scoreboard_file_name], f"joj3: update scoreboard by {submitter}" |         f"https://{settings.gitea_domain_name}{settings.gitea_suffix}/" | ||||||
|  |         + f"{settings.gitea_org_name}/{submitter_repo_name}/" | ||||||
|  |         + f"actions/runs/{run_number}" | ||||||
|     ) |     ) | ||||||
|  |     commit_message = ( | ||||||
|  |         f"joj3: update scoreboard by {submitter} in {submitter_repo_name}\n\n" | ||||||
|  |         + f"gitea actions link: {actions_link}" | ||||||
|  |     ) | ||||||
|  |     tea.pot.git.add_commit_and_push(repo_name, [scoreboard_file_name], commit_message) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @app.command( | @app.command( | ||||||
|  | @ -263,6 +278,7 @@ def joj3_failed_table( | ||||||
|     score_file_path: str = Argument( |     score_file_path: str = Argument( | ||||||
|         "", help="path to score json file generated by JOJ3" |         "", help="path to score json file generated by JOJ3" | ||||||
|     ), |     ), | ||||||
|  |     submitter: str = Argument("", help="submitter ID"), | ||||||
|     repo_name: str = Argument( |     repo_name: str = Argument( | ||||||
|         "", |         "", | ||||||
|         help="name of grading repo to push failed table file", |         help="name of grading repo to push failed table file", | ||||||
|  | @ -299,7 +315,7 @@ def joj3_failed_table( | ||||||
|         f"https://{settings.gitea_domain_name}{settings.gitea_suffix}/" |         f"https://{settings.gitea_domain_name}{settings.gitea_suffix}/" | ||||||
|         + f"{settings.gitea_org_name}/{submitter_repo_name}" |         + f"{settings.gitea_org_name}/{submitter_repo_name}" | ||||||
|     ) |     ) | ||||||
|     action_link = ( |     actions_link = ( | ||||||
|         f"https://{settings.gitea_domain_name}{settings.gitea_suffix}/" |         f"https://{settings.gitea_domain_name}{settings.gitea_suffix}/" | ||||||
|         + f"{settings.gitea_org_name}/{submitter_repo_name}/" |         + f"{settings.gitea_org_name}/{submitter_repo_name}/" | ||||||
|         + f"actions/runs/{run_number}" |         + f"actions/runs/{run_number}" | ||||||
|  | @ -309,12 +325,16 @@ def joj3_failed_table( | ||||||
|         submitter_repo_name, |         submitter_repo_name, | ||||||
|         submitter_repo_link, |         submitter_repo_link, | ||||||
|         os.path.join(repo_path, failed_table_file_name), |         os.path.join(repo_path, failed_table_file_name), | ||||||
|         action_link, |         actions_link, | ||||||
|  |     ) | ||||||
|  |     commit_message = ( | ||||||
|  |         f"joj3: update failed table by {submitter} in {submitter_repo_name}\n\n" | ||||||
|  |         + f"gitea actions link: {actions_link}" | ||||||
|     ) |     ) | ||||||
|     tea.pot.git.add_commit_and_push( |     tea.pot.git.add_commit_and_push( | ||||||
|         repo_name, |         repo_name, | ||||||
|         [failed_table_file_name], |         [failed_table_file_name], | ||||||
|         f"joj3: update failed table by {submitter_repo_name}", |         commit_message, | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -341,13 +361,13 @@ def joj3_create_result_issue( | ||||||
|     logger.info(f"debug log to file: {settings.log_file_path}") |     logger.info(f"debug log to file: {settings.log_file_path}") | ||||||
|     if joj3.check_skipped(score_file_path, "skip-result-issue"): |     if joj3.check_skipped(score_file_path, "skip-result-issue"): | ||||||
|         return |         return | ||||||
|     action_link = ( |     actions_link = ( | ||||||
|         f"https://{settings.gitea_domain_name}{settings.gitea_suffix}/" |         f"https://{settings.gitea_domain_name}{settings.gitea_suffix}/" | ||||||
|         + f"{settings.gitea_org_name}/{submitter_repo_name}/" |         + f"{settings.gitea_org_name}/{submitter_repo_name}/" | ||||||
|         + f"actions/runs/{run_number}" |         + f"actions/runs/{run_number}" | ||||||
|     ) |     ) | ||||||
|     title, comment = joj3.generate_title_and_comment( |     title, comment = joj3.generate_title_and_comment( | ||||||
|         score_file_path, action_link, run_number |         score_file_path, actions_link, run_number | ||||||
|     ) |     ) | ||||||
|     tea.pot.gitea.create_issue(submitter_repo_name, title, comment, False) |     tea.pot.gitea.create_issue(submitter_repo_name, title, comment, False) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user