Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ RUN mkdir -p $USER_BIN_DIR \
&& mkdir -p $DATA_DIR/logs \
&& mkdir -p /tmp/containers

RUN set -x \
&& curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash \
&& curl https://mirror.openshift.com/pub/openshift-v4/clients/rosa/latest/rosa-linux.tar.gz --output /tmp/rosa-linux.tar.gz \
&& tar xvf /tmp/rosa-linux.tar.gz --no-same-owner \
&& mv rosa $USER_BIN_DIR/rosa \
&& chmod +x $USER_BIN_DIR/rosa \
&& rm -rf /tmp/rosa-linux.tar.gz
# RUN set -x \
# && curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash \
# && curl https://mirror.openshift.com/pub/openshift-v4/clients/rosa/latest/rosa-linux.tar.gz --output /tmp/rosa-linux.tar.gz \
# && tar xvf /tmp/rosa-linux.tar.gz --no-same-owner \
# && mv rosa $USER_BIN_DIR/rosa \
# && chmod +x $USER_BIN_DIR/rosa \
# && rm -rf /tmp/rosa-linux.tar.gz

RUN ln -s /usr/bin/python3 /usr/bin/python

Expand Down
11 changes: 7 additions & 4 deletions webhook_server_container/libs/github_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def __init__(self, hook_data: Dict[Any, Any], headers: Headers):
self.x_github_delivery: str = self.headers.get("X-GitHub-Delivery", "")
self.github_event: str = self.headers["X-GitHub-Event"]
self.log_prefix = self.prepare_log_prefix()
self.owners_content: Dict[str, Any] = {}

self._repo_data_from_config()

self.github_app_api = get_repository_github_app_api(
Expand Down Expand Up @@ -144,7 +146,6 @@ def __init__(self, hook_data: Dict[Any, Any], headers: Headers):
self.add_api_users_to_auto_verified_and_merged_users()
self.clone_repository_path: str = os.path.join("/", self.repository.name)

self.owners_content = self.get_owners_content()
self.supported_user_labels_str: str = "".join([f" * {label}\n" for label in USER_LABELS_DICT.keys()])
self.welcome_msg: str = f"""
Report bugs in [Issues](https://github.com/myakove/github-webhook-server/issues)
Expand Down Expand Up @@ -193,10 +194,10 @@ def process(self) -> None:
self.pull_request = self._get_pull_request()
self.log_prefix = self.prepare_log_prefix(pull_request=self.pull_request)
LOGGER.info(f"{self.log_prefix} {event_log}")

self.owners_content = self.get_owners_content()
self.last_commit = self._get_last_commit()
self.parent_committer = self.pull_request.user.login
self.last_committer = self.last_commit.committer.login
self.last_committer = getattr(self.last_commit.committer, "login", self.parent_committer)
self.pull_request_branch = self.pull_request.base.ref

if self.jira_enabled_repository:
Expand Down Expand Up @@ -234,7 +235,9 @@ def process(self) -> None:
self.process_pull_request_check_run_webhook_data()

except NoPullRequestError:
LOGGER.info(f"{self.log_prefix} {event_log}")
LOGGER.info(f"{self.log_prefix} {event_log}. [No pull request found in hook data]")
self.owners_content = self.get_owners_content()

if self.github_event == "push":
self.process_push_webhook_data()

Expand Down