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

release v0.4.0 #259

Merged
merged 65 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
81a964c
download_pr error handling
Neves-P Nov 15, 2023
db69f09
Improve message and fix typo
Neves-P Nov 16, 2023
b688574
Yet more comment formatting
Neves-P Nov 16, 2023
1b65a3a
More comment improvements
Neves-P Nov 16, 2023
e3657a9
Tiny formatting change
Neves-P Nov 16, 2023
e7c6d65
Comment changes
Neves-P Nov 29, 2023
b661632
Merge pull request #1 from EESSI/develop
Neves-Bot Dec 18, 2023
d00df55
Merge branch 'EESSI:develop' into develop
Neves-Bot Jan 31, 2024
1ef2e2f
add function that reads PR section from job metadata and use it in jo…
truib Feb 9, 2024
4f743a2
removing trailing $
truib Feb 9, 2024
7ed3d8d
removed method read_job_pr_metadata
truib Feb 10, 2024
03891c9
remove unused import
truib Feb 10, 2024
ec2a317
still need app.cfg in some tests
truib Feb 10, 2024
f1ac9a4
Revert changes to test_task_build.py
Neves-P Feb 11, 2024
5a96c4f
Revert changes to test_task_build.py
Neves-P Feb 11, 2024
b82cc0b
Revert changes to test_task_build.py
Neves-P Feb 11, 2024
7d822c4
Merge pull request #247 from trz42/refactor_reading_job_metadata
bedroge Feb 12, 2024
33128c3
add function to determine comment id for a job and use it
truib Feb 12, 2024
c3b2d6d
replaced one letter variable name with more descriptive name
truib Feb 12, 2024
e35f462
Replace `print()` with `log()` where appropriate
Neves-P Feb 12, 2024
d92e1da
Lint code
Neves-P Feb 12, 2024
3213fbe
Handle each error stage individually
Neves-P Feb 12, 2024
68e739d
determines -> determine (to be consistent with other docstrings)
bedroge Feb 13, 2024
23dd5fe
Merge pull request #249 from trz42/refactor_determining_pr_comment_id
bedroge Feb 13, 2024
27831a8
add function that returns an IssueComment instance
truib Feb 13, 2024
e8cf219
use determine_issue_comment when updating comment
truib Feb 13, 2024
8311a5d
simpliify determine_issue_comment by reusing existing function get_co…
truib Feb 13, 2024
ed5500a
removed unused variable and import
truib Feb 13, 2024
f0157a9
fix for was calling wrong values
Feb 13, 2024
0dc3650
Update tasks/build.py
laraPPr Feb 13, 2024
eb5eb70
Merge pull request #251 from laraPPr/bot_status
trz42 Feb 13, 2024
cd571f7
Merge branch 'develop' of github.com:EESSI/eessi-bot-software-layer i…
truib Feb 13, 2024
92edf24
pass along and use pr_comment_id in two more functions
truib Feb 13, 2024
9cbdec7
Merge pull request #250 from trz42/refactor_using_pr_comment_id
laraPPr Feb 14, 2024
570217f
Use globaly defined string constants for errors
Neves-P Feb 14, 2024
fd6cda1
Move text snippets to cfg_file
Neves-P Feb 14, 2024
75893a4
Merge pull request #248 from Neves-P/develop
trz42 Feb 14, 2024
fb9e4d9
add PR comment id to uploaded metadata
truib Feb 14, 2024
0e145d6
Merge pull request #253 from trz42/refactor_uploaded_metadata
bedroge Feb 15, 2024
5759b0d
let upload script support configurable target directories
truib Feb 16, 2024
ccf5230
adds settings and description for them to example cfg file
truib Feb 16, 2024
1fd7b60
pass *_prefix settings to upload script
truib Feb 16, 2024
3a2df5a
return status of PR download in case of no ERROR
truib Feb 20, 2024
bbfb21b
add a bit log info + fixing obtaining target_arch
truib Feb 20, 2024
75c00bb
fix for job manager crash: Unable to contact slurm controller
Feb 21, 2024
d458da1
fix long line
Feb 21, 2024
307c62c
move poll_interval and skip loop if job_manager.get_current_jobs() fails
Feb 22, 2024
43ab1a6
remove other fix
Feb 22, 2024
f7b38df
fix except
Feb 22, 2024
e73bfe6
implement suggested changes
Feb 22, 2024
b03baa1
Merge pull request #255 from laraPPr/jm_slurm_connect_fix
trz42 Feb 22, 2024
f1c4001
Merge branch 'develop' of github.com:EESSI/eessi-bot-software-layer i…
truib Feb 22, 2024
7ef1e4b
add new/missing bot settings to README.md
truib Feb 23, 2024
2eb7f0a
fix flake8 test issue
truib Feb 23, 2024
8b09bec
updating README.md to implement suggestions
truib Feb 26, 2024
41c1ab1
Merge pull request #254 from trz42/configurable_upload_directory
bedroge Feb 26, 2024
2cf73ac
prevent bot from responding on comments without a bot command
truib Feb 26, 2024
6be82dd
fix import syntax error
truib Feb 26, 2024
e7e69b6
use plain string instead of f-string
truib Feb 27, 2024
7f45435
Merge pull request #257 from trz42/only_respond_to_bot_commands
trz42 Feb 27, 2024
bd3cc23
release notes for v0.4.0
truib Feb 27, 2024
2018925
Update RELEASE_NOTES
trz42 Feb 28, 2024
a17b9e1
Merge pull request #258 from trz42/release_notes_v0_4_0
laraPPr Feb 28, 2024
352c510
improve release notes for v0.4.0
truib Feb 28, 2024
618a605
Merge pull request #260 from trz42/release_notes_v0_4_0b
laraPPr Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions eessi_bot_event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
from tasks.deploy import deploy_built_artefacts
from tools import config
from tools.args import event_handler_parse
from tools.commands import EESSIBotCommand, EESSIBotCommandError, get_bot_command
from tools.commands import EESSIBotCommand, EESSIBotCommandError, \
contains_any_bot_command, get_bot_command
from tools.permissions import check_command_permission
from tools.pr_comments import create_comment

Expand Down Expand Up @@ -113,7 +114,25 @@ def handle_issue_comment_event(self, event_info, log_file=None):
# currently, only commands in new comments are supported
# - commands have the syntax 'bot: COMMAND [ARGS*]'

# first check if sender is authorized to send any command
# only scan for commands in newly created comments
if action == 'created':
comment_received = request_body['comment']['body']
self.log(f"comment action '{action}' is handled")
else:
# NOTE we do not respond to an updated PR comment with yet another
# new PR comment, because it would make the bot very noisy or
# worse could result in letting the bot enter an endless loop
self.log(f"comment action '{action}' not handled")
return
# at this point we know that we are handling a new comment

# check if comment does not contain a bot command
if not contains_any_bot_command(comment_received):
self.log("comment does not contain a bot comment; not processing it further")
return
# at this point we know that the comment contains a bot command

# check if sender is authorized to send any command
# - this serves a double purpose:
# 1. check permission
# 2. skip any comment updates that were done by the bot itself
Expand Down Expand Up @@ -150,17 +169,6 @@ def handle_issue_comment_event(self, event_info, log_file=None):
else:
self.log(f"account `{sender}` has permission to send commands to bot")

# only scan for commands in newly created comments
if action == 'created':
comment_received = request_body['comment']['body']
self.log(f"comment action '{action}' is handled")
else:
# NOTE we do not respond to an updated PR comment with yet another
# new PR comment, because it would make the bot very noisy or
# worse could result in letting the bot enter an endless loop
self.log(f"comment action '{action}' not handled")
return

# search for commands in comment
comment_response = ''
commands = []
Expand Down
13 changes: 13 additions & 0 deletions tools/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@
from tools.filter import EESSIBotActionFilter, EESSIBotActionFilterError


def contains_any_bot_command(body):
"""
Checks if argument contains any bot command.

Args:
body (string): possibly multi-line string that may contain a bot command

Returns:
(bool): True if bot command found, False otherwise
"""
return any(map(get_bot_command, body.split('\n')))


def get_bot_command(line):
"""
Retrieve bot command from a line.
Expand Down
Loading