Skip to content

Commit

Permalink
fix: url encode branch name in test results comment link to dash (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-sentry authored Sep 9, 2024
1 parent 37f512c commit a4ee062
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions services/tests/test_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_build_message():
"https://example.com/build_url",
)
payload = TestResultsNotificationPayload(1, 2, 3, [fail], dict())
commit = CommitFactory()
commit = CommitFactory(branch="thing/thing")
tn = TestResultsNotifier(commit, None, None, None, payload)
res = tn.build_message()

Expand Down Expand Up @@ -136,7 +136,7 @@ def test_build_message():
</details>
To view individual test run time comparison to the main branch, go to the [Test Analytics Dashboard](https://app.codecov.io/{services_short_dict.get(commit.repository.service)}/{commit.repository.owner.username}/{commit.repository.name}/tests/{commit.branch})"""
To view individual test run time comparison to the main branch, go to the [Test Analytics Dashboard](https://app.codecov.io/{services_short_dict.get(commit.repository.service)}/{commit.repository.owner.username}/{commit.repository.name}/tests/thing%2Fthing)"""
)


Expand Down
4 changes: 2 additions & 2 deletions services/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from dataclasses import dataclass
from enum import Enum
from typing import List
from urllib.parse import parse_qs, urlencode, urlparse, urlunparse
from urllib.parse import parse_qs, quote_plus, urlencode, urlparse, urlunparse

from shared.config import get_config

Expand Down Expand Up @@ -191,7 +191,7 @@ def get_test_analytics_url(repo: Repository, commit: Commit) -> str:
service_short=services_short_dict.get(repo.service),
username=repo.owner.username,
project_name=repo.name,
branch_name=commit.branch,
branch_name=quote_plus(commit.branch),
)


Expand Down

0 comments on commit a4ee062

Please sign in to comment.