Skip to content

Commit

Permalink
Actions are 'closed', not 'merged'
Browse files Browse the repository at this point in the history
  • Loading branch information
Neves-P committed Jun 10, 2024
1 parent 6b38f37 commit 769daec
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions eessi_bot_event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
request_bot_build_issue_comments, submit_build_jobs
from tasks.deploy import deploy_built_artefacts, determine_job_dirs
from tasks.clean_up import move_to_trash_bin
from tools import config, cvmfs_repository
from tools import config
from tools.args import event_handler_parse
from tools.commands import EESSIBotCommand, EESSIBotCommandError, \
contains_any_bot_command, get_bot_command
Expand Down Expand Up @@ -601,10 +601,11 @@ def start(self, app, port=3000):
self.log(log_file_info)
waitress.serve(app, listen='*:%s' % port)

def handle_pull_request_merged_event(self, event_info, pr):
def handle_pull_request_closed_event(self, event_info, pr):
"""
Handle events of type pull_request with the action merged. Main action
is to scan directories used and move them to the trash_bin.
Handle events of type pull_request with the action 'closed'. Main action
is to scan directories used and move them to the trash_bin when the PR
is merged.
Args:
event_info (dict): event received by event_handler
Expand Down Expand Up @@ -636,8 +637,8 @@ def handle_pull_request_merged_event(self, event_info, pr):

# 2) Get trash_bin_dir from configs
trash_bin_root_dir = self.cfg[config.SECTION_MERGED_PR][config.MERGED_PR_SETTING_TRASH_BIN_ROOT_DIR]
repo_cfg = get_repo_cfg(self.cfg)
repo_name = repo_cfg[cvmfs_repository.REPOS_CFG_REPO_NAME]

repo_name = event_info['full_name']
dt = datetime.now(timezone.utc)
trash_bin_dir = "/".join([trash_bin_root_dir, repo_name, dt.strftime('%Y%m%d')])

Expand Down

0 comments on commit 769daec

Please sign in to comment.