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

fix: url encode branch name in test results comment link to dash #692

Merged
merged 3 commits into from
Sep 9, 2024
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
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
Loading