Skip to content

CI Have the name of the failing build in the tracking issue - #33203

Merged
lesteve merged 17 commits into
scikit-learn:mainfrom
FrancoisPgm:CI_name_tracking_issue
Feb 5, 2026
Merged

lesteve merged 17 commits into
scikit-learn:mainfrom
FrancoisPgm:CI_name_tracking_issue

Conversation

@FrancoisPgm

Copy link
Copy Markdown
Member

Reference Issues/PRs

Fix issue raised in #33152 (comment)

What does this implement/fix? Explain your changes.

Get the name of the failing build in the tracking issue name, even if the build is not in the job matrix.

AI usage disclosure

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Any other comments?

Apparently there is no way to access the job name from the job steps, so I used an env variable containing the job name as a workaround.

Comment thread .github/workflows/unit-tests.yml Outdated
shell: bash
run: |
set -ex
if [[ -z "$JOB_NAME" ]]; then JOB_NAME="${{ matrix.name }}"; fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think we have a similar problem in other places like the ccache step, we use ${{ matrix.name }} but actually this is empty for non-standard jobs (e.g. free-threaded).

I am wondering if one work-around would be to have a step early on that defines the env variable JOB_NAME by putting it in GITHUB_ENV and then using env.JOB_NAME everywhere?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes good point, I noticed ${{ matrix.LOCK_FILE }} is also used, I'll try to add a strep to put both variables in env.

@lesteve lesteve left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments

Comment thread .github/workflows/unit-tests.yml Resolved
Comment thread .github/workflows/unit-tests.yml Resolved
Comment thread .github/workflows/unit-tests.yml Outdated
COVERAGE: false
# Disable pytest-xdist to use multiple cores for stress-testing with pytest-run-parallel
PYTEST_XDIST_VERSION: none
JOB_NAME: "Linux x86-64 pylatest_free_threaded"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering whether using YAML anchor would be a good idea or not, something like (untested)

name: Linux x86-64 pylatest_free_threaded &free-threaded-job-name

env:
    JOB_NAME: *free-threaded-job-name

This may be overkill to be honest not 100% sure ...

Maybe adding a comment would be useful (not sure where exactly) that setting the JOB_VARIABLE variable is needed to overcome a limitation of GitHub this is a limitation of GitHub with a link to a somewhat useful source?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not find a nice and clean source, my conclusion came from experiments on my fork and discussions with chatbots, but looking for a ref I stumbled upon a 3rd party action which provides the job name as an env variable. Not sure it's worth adding it though.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not worth depending on a 3rd party action for such a small functionality.

Comment thread .github/workflows/unit-tests.yml Outdated
- name: Checkout
uses: actions/checkout@v6

- name: Set env variables

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain somewhere that this is needed to treat matrix jobs and separate jobs (like free-threaded or debian-32) in a uniform manner.

Comment thread .github/workflows/unit-tests.yml Resolved
@lesteve

lesteve commented Feb 5, 2026 •

Copy link
Copy Markdown
Member

Nice, I can tell from your tests on your fork this seems to work fine, see e.g. FrancoisPgm#46.


free-threaded:
name: Linux x86-64 pylatest_free_threaded
name: &free-threaded-job-name Linux x86-64 pylatest_free_threaded

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried doing it the other way around. I would find it a tiny bit less ugly (first real content, then quirky thing for the anchor ...)

Suggested change
name: &free-threaded-job-name Linux x86-64 pylatest_free_threaded
name: Linux x86-64 pylatest_free_threaded &free-threaded-job-name

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried but then ruff got angry at me :

check yaml...............................................................Failed
- hook id: check-yaml
- exit code: 1

found undefined alias 'free-threaded-job-name'
  in ".github/workflows/unit-tests.yml", line 316, column 17

@lesteve lesteve Feb 5, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, fair enough, it's more pre-commit and its check-yaml check than ruff but let's keep it like this anyway 🤷


scipy-dev:
name: Linux x86-64 pylatest_pip_scipy_dev
name: &scipy-dev-job-name Linux x86-64 pylatest_pip_scipy_dev

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case that works with YAML anchor and GitHub restricted implementation of them

Suggested change
name: &scipy-dev-job-name Linux x86-64 pylatest_pip_scipy_dev
name: Linux x86-64 pylatest_pip_scipy_dev &scipy-dev-job-name

@lesteve lesteve left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the two comments, looks good to me, thanks!

@lesteve
lesteve merged commit 55974cb into scikit-learn:main Feb 5, 2026
35 checks passed
@FrancoisPgm
FrancoisPgm deleted the CI_name_tracking_issue branch February 5, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants