Skip to content

Commit 53ee62f

Browse files
committed
Clean up the bin/ directory some and remove things that aren't needed
1 parent e48bd35 commit 53ee62f

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

bin/bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/bash
1+
#!/usr/bin/env bash
22

33
set -euo pipefail
44

bin/combine-buildkite

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import requests
88

99
_API_TOKEN = os.environ["BUILDKITE_API_TOKEN"]
1010
_BASE_URL = "https://api.buildkite.com/v2/organizations/"
11-
_BUILDKITE_AUTH_HEADERS = {"Authorization": f"Bearer {_API_TOKEN}"}
11+
_BUILDKITE_AUTH_HEADERS = {"Authorization": f"Bearer {_API_TOKEN}", "Content-Type": "application/json"}
1212

1313
ansi_escape_8bit = re.compile(
1414
r"(?:\x1B[@-Z\\-_]|[\x80-\x9A\x9C-\x9F]|(?:\x1B\[|\x9B)[0-?]*[ -/]*[@-~])"
@@ -27,12 +27,9 @@ def _build_parser() -> argparse.ArgumentParser:
2727

2828

2929
def _get_job_log(
30-
org: str, pipeline: str, build_number: str, job_id: str
30+
job_url: str
3131
) -> str:
32-
response = requests.get(
33-
f"{_BASE_URL}/{org}/pipelines/{pipeline}/builds/{build_number}/jobs/{job_id}/log",
34-
headers=_BUILDKITE_AUTH_HEADERS,
35-
)
32+
response = requests.get(job_url, headers=_BUILDKITE_AUTH_HEADERS)
3633
response.raise_for_status()
3734
return ansi_escape_8bit.sub("", response.json()["content"]).replace(
3835
"\r", ""
@@ -52,12 +49,8 @@ async def _main(org: str, pipeline: str, build_number: str) -> None:
5249
futures = []
5350

5451
for job in build["jobs"]:
55-
job_id = str(job["id"])
56-
futures.append(
57-
loop.run_in_executor(
58-
None, _get_job_log, org, pipeline, build_number, job_id
59-
)
60-
)
52+
log_url = str(job["log_url"])
53+
futures.append(loop.run_in_executor(None, _get_job_log, log_url))
6154

6255
for future in futures:
6356
combined_log += await future

0 commit comments

Comments
 (0)