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

"try-job" parsing logic seems to be space-sensitive #137013

Closed
RalfJung opened this issue Feb 14, 2025 · 2 comments · Fixed by #136864
Closed

"try-job" parsing logic seems to be space-sensitive #137013

RalfJung opened this issue Feb 14, 2025 · 2 comments · Fixed by #136864
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@RalfJung
Copy link
Member

RalfJung commented Feb 14, 2025

I don't know exactly what I did, but I got this error when trying to trigger a try build:

INFO:root:Job type: TryRunType(custom_jobs=[' aarch64-apple'])
Traceback (most recent call last):
  File "/home/runner/work/rust/rust/src/ci/github-actions/ci.py", line 314, in <module>
    calculate_job_matrix(data)
  File "/home/runner/work/rust/rust/src/ci/github-actions/ci.py", line 266, in calculate_job_matrix
    jobs = calculate_jobs(run_type, job_data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/rust/rust/src/ci/github-actions/ci.py", line 153, in calculate_jobs
    raise Exception(
Exception: Custom job(s) `[' aarch64-apple']` not found in auto jobs

Might be worth stripping leading and trailing spaces?

Cc @rust-lang/infra

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 14, 2025
@kennytm
Copy link
Member

kennytm commented Feb 14, 2025

regex = re.compile(r"^try-job: (.*)", re.MULTILINE)
jobs = []
for match in regex.finditer(ctx.commit_message):
jobs.append(match.group(1))
return jobs

perhaps change the regex to ^try-job:[ \t]*(.*) (or just search for \ntry-job, don't use a regex)

@Kobzol
Copy link
Contributor

Kobzol commented Feb 14, 2025

Heh, I was just thinking about this when implementing #136864, but it seems I still missed one trim there. I will fix it once that PR gets merged.

@jieyouxu jieyouxu added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 14, 2025
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 17, 2025
Rewrite the `ci.py` script in Rust

It would seem that I would learn by now that any script written in Python will become unmaintainable sooner or later, but alas..

r? `@marcoieni`

try-job: aarch64-gnu
try-job: dist-x86_64-linux-alt
try-job: x86_64-msvc-ext2

Fixes: rust-lang#137013
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 17, 2025
Rewrite the `ci.py` script in Rust

It would seem that I would learn by now that any script written in Python will become unmaintainable sooner or later, but alas..

r? `@marcoieni`

try-job: aarch64-gnu
try-job: dist-x86_64-linux-alt
try-job: x86_64-msvc-ext2

Fixes: rust-lang#137013
@bors bors closed this as completed in 4b696e6 Mar 2, 2025
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this issue Mar 3, 2025
Rewrite the `ci.py` script in Rust

It would seem that I would learn by now that any script written in Python will become unmaintainable sooner or later, but alas..

r? `@marcoieni`

try-job: aarch64-gnu
try-job: dist-x86_64-linux-alt
try-job: x86_64-msvc-ext2

Fixes: rust-lang/rust#137013
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Mar 3, 2025
Rewrite the `ci.py` script in Rust

It would seem that I would learn by now that any script written in Python will become unmaintainable sooner or later, but alas..

r? `@marcoieni`

try-job: aarch64-gnu
try-job: dist-x86_64-linux-alt
try-job: x86_64-msvc-ext2

Fixes: rust-lang/rust#137013
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Mar 6, 2025
Rewrite the `ci.py` script in Rust

It would seem that I would learn by now that any script written in Python will become unmaintainable sooner or later, but alas..

r? `@marcoieni`

try-job: aarch64-gnu
try-job: dist-x86_64-linux-alt
try-job: x86_64-msvc-ext2

Fixes: rust-lang/rust#137013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants