Skip to content

Commit d2ba55c

Browse files
authored
refactor: remove notice usage from GHA (#677)
Fixes MRGFY-5162
1 parent 0756434 commit d2ba55c

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

mergify_cli/ci/upload.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from opentelemetry.sdk.trace import export
1111

1212
from mergify_cli import console
13-
from mergify_cli.ci import detector
1413
from mergify_cli.ci import junit
1514

1615

@@ -55,14 +54,6 @@ def upload_spans(
5554
raise UploadError(logstr.getvalue())
5655

5756

58-
def connect_traces(run_id: str) -> None:
59-
if detector.get_ci_provider() == "github_actions":
60-
console.print(
61-
f"::notice title=Mergify CI::MERGIFY_TEST_RUN_ID={run_id}",
62-
soft_wrap=True,
63-
)
64-
65-
6657
async def upload( # noqa: PLR0913, PLR0917
6758
api_url: str,
6859
token: str,
@@ -97,7 +88,9 @@ async def upload( # noqa: PLR0913, PLR0917
9788
except UploadError as e:
9889
console.log(f"Error uploading spans: {e}", style="red")
9990
else:
100-
connect_traces(run_id)
91+
console.print(
92+
f"MERGIFY_TEST_RUN_ID={run_id}",
93+
)
10194
console.log("[green]:tada: File(s) uploaded[/]")
10295
else:
10396
console.log("[orange]No tests were detected in the JUnit file(s)[/]")

mergify_cli/tests/ci/test_upload.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,13 @@ async def test_junit_upload(
6262
)
6363

6464
captured = capsys.readouterr()
65-
if env["GITHUB_ACTIONS"] == "true":
66-
matched = re.search(
67-
r"^::notice title=Mergify CI::MERGIFY_TEST_RUN_ID=(.+)",
68-
captured.out,
69-
re.MULTILINE,
70-
)
71-
assert matched is not None
72-
assert len(bytes.fromhex(matched.group(1))) == 8
65+
matched = re.search(
66+
r"^MERGIFY_TEST_RUN_ID=(.+)",
67+
captured.out,
68+
re.MULTILINE,
69+
)
70+
assert matched is not None
71+
assert len(bytes.fromhex(matched.group(1))) == 8
7372

7473
assert "🎉 File(s) uploaded" in captured.out
7574

0 commit comments

Comments
 (0)