Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mark with_accelerator setting in [submitted_job_comments] section as required #282

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

boegel
Copy link
Contributor

@boegel boegel commented Sep 17, 2024

follow-up for #280

Without having with_accelerator set in app.cfg, the event handler crashes when processing a bot build command with:

[20240917-T13:47:58] WARNING: A crash occurred!
Traceback (most recent call last):
  File "/home/boegel/eessi-bot-software-layer/venv/lib64/python3.9/site-packages/pyghee/lib.py", line 170, in process_event
    self.handle_event(event_info, log_file=log_file)
  File "/home/boegel/eessi-bot-software-layer/venv/lib64/python3.9/site-packages/pyghee/lib.py", line 102, in handle_event
    handler(event_info, log_file=log_file)
  File "/home/boegel/eessi-bot-software-layer/eessi_bot_event_handler.py", line 287, in handle_issue_comment_event
    update = self.handle_bot_command(event_info, cmd)
  File "/home/boegel/eessi-bot-software-layer/eessi_bot_event_handler.py", line 469, in handle_bot_command
    return handler(event_info, bot_command)
  File "/home/boegel/eessi-bot-software-layer/eessi_bot_event_handler.py", line 515, in handle_bot_command_build
    submitted_jobs = submit_build_jobs(pr, event_info, bot_command.action_filters)
  File "/home/boegel/eessi-bot-software-layer/tasks/build.py", line 840, in submit_build_jobs
    pr_comment = create_pr_comment(job, job_id, app_name, pr, gh, symlink)
  File "/home/boegel/eessi-bot-software-layer/tasks/build.py", line 766, in create_pr_comment
    accelerator_spec = f"{submitted_job_comments_cfg[config.SUBMITTED_JOB_COMMENTS_SETTING_WITH_ACCELERATOR]}"
  File "/usr/lib64/python3.9/configparser.py", line 1257, in __getitem__
    raise KeyError(key)
KeyError: 'with_accelerator'

With this small enhancement, the event handler fails at startup if with_accelerator is not set:

Missing configuration item "with_accelerator" in section "submitted_job_comments" of configuration file app.cfg.

@boegel boegel added the bug label Sep 17, 2024
@boegel boegel requested a review from trz42 September 17, 2024 14:00
@boegel boegel changed the title mark with_accelerator setting in [submitted_job_comments]' section as required mark with_accelerator setting in [submitted_job_comments] section as required Sep 17, 2024
Copy link
Contributor

@trz42 trz42 left a comment

Choose a reason for hiding this comment

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

Good catch!

@trz42 trz42 merged commit a0c7591 into EESSI:develop Sep 17, 2024
7 checks passed
@boegel boegel deleted the with_accelerator_required branch September 17, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants