Skip to content

Add option to bot:status to print the status only for the last build#334

Merged
trz42 merged 8 commits into
EESSI:developfrom
casparvl:print_last_status_only
Aug 21, 2025
Merged

Add option to bot:status to print the status only for the last build#334
trz42 merged 8 commits into
EESSI:developfrom
casparvl:print_last_status_only

Conversation

@casparvl

@casparvl casparvl commented Aug 19, 2025

Copy link
Copy Markdown
Contributor

This PR implements functionality so that one can do:

bot:status last_build

Which will create a status table only contain the last build for each for architecture. This makes it much easier to check if all architectures have been (successfully) build for in a given PR. That's almost essential for GPU builds, where the number of target architectures is currently 13 (CPU) * 3 (GPU) = 39 architectures.

This example was created with a bot running from this commit

Fixes #332

Caspar van Leeuwen and others added 8 commits August 18, 2025 18:07
…n support bot:status last_build. Then, implement functionality in the status command that makes sure only the last build result for each architecture is printed
…ned. Also, log the general args to the log
…composing the table with only the last builds. Finally, add resorting for an output that is sorted alphabetically by 'for' architecture

@trz42 trz42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two comments before having looked into this in detail:

  • Since we now use multiple bot instances it might be good to include the instance name in the overview table.
  • If a build succeeded for an architecture, then a follow-up failed, the table would show the last build as failed while setting the bot:deploy label would lead to the last successful one being uploaded. Not sure if that would happen often and how to approach that issue.

@casparvl

Copy link
Copy Markdown
Contributor Author

Hm, initially I wanted to mimic as closely as possible what the bot does for the 'deploy last' policy. I concluded that was not possible, because the status command solely relies on issue comments, and not on any variables that are in memory (which the deployment policy does, it checks state in the job dir etc). But I now realize I don't need that: the status is one of the items in the table, so I have that information. Should not be too hard to modify the behavior to pick the last success, rather than the last build. That mimics the deployment behavior more closely, which I agree is preferable.

Regarding the instance name: should be doable: it's in the same issue comment as the rest of the build info, so should be trivial to capture.

@trz42

trz42 commented Aug 21, 2025

Copy link
Copy Markdown
Contributor

As discussed online, we should get the PR merged as is and postpone potential improvements to a subsequent release.

@trz42 trz42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me and already improves the current situation / ability to obtain a concise status overview.

If we find that some of the comments need to be addressed, those can be taken up later through a follow up PR.

@trz42 trz42 merged commit 2c5569b into EESSI:develop Aug 21, 2025
5 checks passed
@boegel boegel mentioned this pull request Aug 21, 2025
@boegel

boegel commented Aug 21, 2025

Copy link
Copy Markdown
Contributor

@casparvl I tried this on our local bot after checking out develop, and hit a crash:

[20250821-T10:32:33] WARNING: A crash occurred!
Traceback (most recent call last):
  File "/kyukon/scratch/gent/400/vsc40003/apps_bot/venv_apps_bot_p39/lib64/python3.9/site-packages/pyghee/lib.py", line 194, in process_event
    self.handle_event(event_info, log_file=log_file)
  File "/kyukon/scratch/gent/400/vsc40003/apps_bot/venv_apps_bot_p39/lib64/python3.9/site-packages/pyghee/lib.py", line 124, in handle_event
    handler(event_info, log_file=log_file)
  File "/kyukon/scratch/gent/vo/001/gvo00100/vsc40003/apps_bot/eessi-bot-software-layer/eessi_bot_event_handler.py", line 310, in handle_issue_comment_event
    update = self.handle_bot_command(event_info, cmd)
  File "/kyukon/scratch/gent/vo/001/gvo00100/vsc40003/apps_bot/eessi-bot-software-layer/eessi_bot_event_handler.py", line 489, in handle_bot_command
    return handler(event_info, bot_command)
  File "/kyukon/scratch/gent/vo/001/gvo00100/vsc40003/apps_bot/eessi-bot-software-layer/eessi_bot_event_handler.py", line 593, in handle_bot_command_status
    status_table = request_bot_build_issue_comments(repo_name, pr_number)
  File "/kyukon/scratch/gent/vo/001/gvo00100/vsc40003/apps_bot/eessi-bot-software-layer/tasks/build.py", line 1222, in request_bot_build_issue_comments
    comment_body = comment['body'].split('\n')
TypeError: string indices must be integers

edit: let's follow-up on that via #338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the 'status' feature to reflect e.g. last build only

3 participants