Skip to content

Commit

Permalink
Fix url encoding issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixoid committed Jan 24, 2024
1 parent 276ccd3 commit 5f85653
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/ci/pr_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
import logging
import os
from typing import Dict, List, Set, Union
from urllib.parse import quote

# isort: off
# for some reason this line moves to the end
from unidiff import PatchSet # type: ignore

# isort: on

from build_download_helper import get_gh_api
from env_helper import (
GITHUB_EVENT_PATH,
GITHUB_REPOSITORY,
GITHUB_SERVER_URL,
GITHUB_RUN_URL,
GITHUB_EVENT_PATH,
GITHUB_SERVER_URL,
)

FORCE_TESTS_LABEL = "force tests"
Expand Down Expand Up @@ -271,9 +276,10 @@ def compare_pr_url(self, pr_object: dict) -> str:

@staticmethod
def compare_url(first: str, second: str) -> str:
"""the first and second are URL encoded to not fail on '#' and other symbols"""
return (
"https://api.github.com/repos/"
f"{GITHUB_REPOSITORY}/compare/{first}...{second}"
f"{GITHUB_REPOSITORY}/compare/{quote(first)}...{quote(second)}"
)

def fetch_changed_files(self):
Expand Down

0 comments on commit 5f85653

Please sign in to comment.