Skip to content

Commit cff761e

Browse files
committed
improve logging when determining task state
1 parent 814cd50 commit cff761e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

scripts/automated_ingestion/eessi_task.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,20 +541,22 @@ def determine_state(self, branch: str = None) -> TaskState:
541541
branch_to_use = self.git_repo.default_branch if branch is None else branch
542542

543543
if self._path_exists_in_branch(task_pointer_file, branch_name=branch_to_use):
544-
log_message(LoggingScope.TASK_OPS, 'INFO', "path %s exists in branch %s",
544+
log_message(LoggingScope.TASK_OPS, 'INFO', "path '%s' exists in branch '%s'",
545545
task_pointer_file, branch_to_use)
546546

547547
# get state from task file in branch to use
548548
# - read the TaskState file in pull request directory
549549
pull_request_dir = self._determine_pull_request_dir(branch_name=branch_to_use)
550+
log_message(LoggingScope.TASK_OPS, 'INFO', "pull request directory: '%s'", pull_request_dir)
550551
task_state_file_path = f"{pull_request_dir}/TaskState"
552+
log_message(LoggingScope.TASK_OPS, 'INFO', "task state file path: '%s'", task_state_file_path)
551553
task_state = self._read_task_state_from_file(task_state_file_path, branch_to_use)
552554

553-
log_message(LoggingScope.TASK_OPS, 'INFO', "task state in branch %s: %s",
555+
log_message(LoggingScope.TASK_OPS, 'INFO', "task state in branch '%s': %s",
554556
branch_to_use, task_state)
555557
return task_state
556558
else:
557-
log_message(LoggingScope.TASK_OPS, 'INFO', "path %s does not exist in branch %s",
559+
log_message(LoggingScope.TASK_OPS, 'INFO', "path '%s' does not exist in branch '%s'",
558560
task_pointer_file, branch_to_use)
559561
return TaskState.UNDETERMINED
560562

0 commit comments

Comments
 (0)