Skip to content

fix(amdsmi): repair the SPDX header check, which fails on develop - #10845

Merged
amd-justchen merged 1 commit into
developfrom
users/dgalants/amdsmi-spdx-catchup
Aug 27, 2026
Merged

amd-justchen merged 1 commit into
developfrom
users/dgalants/amdsmi-spdx-catchup

Conversation

@dmitrii-galantsev

@dmitrii-galantsev dmitrii-galantsev commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

#10402 converted every amd-smi source to the two-line SPDX MIT header and added the amdsmi-license-headers pre-commit hook to hold the line. The hook currently fails on develop itself, so every open amd-smi PR is red — including ones that touch none of the offending files.

$ git checkout origin/develop
$ python3 projects/amdsmi/tests/check_license_headers.py
Missing or malformed AMD SPDX license header:
  src/ualoe_lib/ualoe_nl.c
  src/ualoe_lib/ualoe_telem.c
  tests/amd_smi_test/unit/system/status_string_test.cc
  tests/python/unit/gpu/test_cli_vram_type_lpddr5.py
  tests/python/unit/system/test_expect_status.py

The blast radius is wide because the hook is pass_filenames: false and rescans the whole tracked tree. It fires for any PR touching a single amd-smi .py/.cc/.txt and then reports files that PR never went near. #10083 trips it by editing one line of src/CMakeLists.txt.

What

The five files fall into two groups with different causes.

Three are amd-smi's own, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. Converted here:

File Landed via
tests/amd_smi_test/unit/system/status_string_test.cc #10177
tests/python/unit/gpu/test_cli_vram_type_lpddr5.py #10775
tests/python/unit/system/test_expect_status.py 88dbbe3b93c

The other two are not ours to edit. src/ualoe_lib/ is the vendored UALoE library, replaced wholesale by the periodic "sync UALoE lib" drops — which is exactly why #9688 added ualoe_lib/ to the pre-commit exclude: block, keeping clang-format and the rest off that code. #10402 carried only the include/ualoe_lib/ half of that exclusion into the checker and left src/ behind, so the checker now polices code the next sync will overwrite. Rewriting those headers would be reverted by the next drop and the hook would break again, so the missing prefix is added to EXCLUDE_PREFIX instead.

The three files #10402 did rewrite under src/ualoe_lib/ are left alone; they now fall outside the check and will drift back on their own at the next sync.

Header text and check scope only — no functional change.

Verification

$ python3 projects/amdsmi/tests/check_license_headers.py           # exit 0
$ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py  # 6/6 cases
$ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed>
  codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts /
  large-files / mixed-line-ending / clang-format / ruff format /
  amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed

Confirmed the two vendored files are byte-identical to develop (git diff origin/develop -- projects/amdsmi/src/ualoe_lib/ is empty), and that the checker skips them when named explicitly.

Fixes the amdsmi-license-headers hook regression introduced by #10402.

#10402 converted every amd-smi source to the two-line SPDX MIT header and
added the `amdsmi-license-headers` pre-commit hook to hold the line. The
hook currently fails on develop itself, so every open amd-smi PR is red.

The hook is `pass_filenames: false` and rescans the whole tracked tree, so
it fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then
reports files that PR never went near. Five files were flagged, in two
groups with different causes.

Three are amd-smi's own, and simply landed while #10402 was in review, so
its branch never saw them and they arrived with the old twenty-line MIT
block. They are converted here:

  tests/amd_smi_test/unit/system/status_string_test.cc   (#10177)
  tests/python/unit/gpu/test_cli_vram_type_lpddr5.py     (#10775)
  tests/python/unit/system/test_expect_status.py

The other two, src/ualoe_lib/ualoe_nl.c and ualoe_telem.c, are not ours to
edit. src/ualoe_lib is the vendored UALoE library, replaced wholesale by
the periodic "sync UALoE lib" drops (#9688), which is why that PR excluded
`ualoe_lib/` from the rest of the pre-commit suite. #10402 carried only
the `include/ualoe_lib/` half of that exclusion into the checker and left
`src/`, so the checker polices code the next sync will overwrite - a
header rewritten here reverts, and the hook breaks again. The missing
prefix is added instead.

The three files #10402 did rewrite under src/ualoe_lib are left alone;
they now fall outside the check and will drift back on their own.

Header text and check scope only - no functional change.
@therock-pr-bot

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the amdsmi-license-headers pre-commit hook regression on develop by (1) converting a few newly-landed AMD-owned test sources to the two-line SPDX MIT header and (2) restoring the intended exclusion of vendored UALoE sources from the header scanner.

Changes:

  • Convert three AMD-owned test files to the standard two-line SPDX MIT header format.
  • Update the license-header checker’s exclusion list to skip both include/ualoe_lib/ and src/ualoe_lib/ (vendored UALoE drop content).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
projects/amdsmi/tests/python/unit/system/test_expect_status.py Replaces legacy MIT block with two-line SPDX header (Python shebang-compatible).
projects/amdsmi/tests/python/unit/gpu/test_cli_vram_type_lpddr5.py Replaces legacy MIT block with two-line SPDX header.
projects/amdsmi/tests/check_license_headers.py Adds src/ualoe_lib/ to EXCLUDE_PREFIX alongside include/ualoe_lib/ to avoid policing vendored drops.
projects/amdsmi/tests/amd_smi_test/unit/system/status_string_test.cc Replaces legacy MIT block with two-line SPDX header (C++ // form).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@amd-justchen

Copy link
Copy Markdown
Contributor

Given code owner approval and notes from @dmitrii-galantsev that

... license header check cleanup
Another fetch sources failure

Failures on mi455 and other tests are unrelated to header comment changes.

@amd-justchen
amd-justchen merged commit e92445f into develop Aug 27, 2026
90 of 98 checks passed
@amd-justchen
amd-justchen deleted the users/dgalants/amdsmi-spdx-catchup branch August 27, 2026 23:39
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

marifamd added a commit that referenced this pull request Sep 24, 2026
## Motivation

`amdsmi-license-headers` is `pass_filenames: false`, so it rescans the
whole tree. Once a violation lands on `develop`, every later PR goes 
red instead of the merge that caused it. #10010 merged on a
stale-green formatting run and reddened #10973 and #10998 until #8561
fixed the headers. Third time against this hook (#10402, #10845,
#8561), each fixed reactively.

## Technical Details

`.github/workflows/lstt-formatting.yml`:

- `push` trigger on `develop`, same path filter as `pull_request`, so a
whole-tree hook runs on the merge commit.
- `--from-ref` is event-aware via `FROM_REF`: `github.event.before` on
push, base branch on PR. PR behavior unchanged.
- `cancel-in-progress` limited to `pull_request`, so consecutive merges
each keep their verdict.

Detection at merge, not prevention. Prevention is "Require branches to
be up to date before merging". `develop`'s ruleset has
`required_status_checks` with 
`strict_required_status_checks_policy: false`, so a PR can merge on a
check that last ran against an older base — which is how the stale-green merge
happened.


Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
anujshuk-amd pushed a commit that referenced this pull request Sep 25, 2026
## Motivation

`amdsmi-license-headers` is `pass_filenames: false`, so it rescans the
whole tree. Once a violation lands on `develop`, every later PR goes 
red instead of the merge that caused it. #10010 merged on a
stale-green formatting run and reddened #10973 and #10998 until #8561
fixed the headers. Third time against this hook (#10402, #10845,
#8561), each fixed reactively.

## Technical Details

`.github/workflows/lstt-formatting.yml`:

- `push` trigger on `develop`, same path filter as `pull_request`, so a
whole-tree hook runs on the merge commit.
- `--from-ref` is event-aware via `FROM_REF`: `github.event.before` on
push, base branch on PR. PR behavior unchanged.
- `cancel-in-progress` limited to `pull_request`, so consecutive merges
each keep their verdict.

Detection at merge, not prevention. Prevention is "Require branches to
be up to date before merging". `develop`'s ruleset has
`required_status_checks` with 
`strict_required_status_checks_policy: false`, so a PR can merge on a
check that last ran against an older base — which is how the stale-green merge
happened.


Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
dgaliffiAMD pushed a commit that referenced this pull request Sep 25, 2026
## Motivation

`amdsmi-license-headers` is `pass_filenames: false`, so it rescans the
whole tree. Once a violation lands on `develop`, every later PR goes 
red instead of the merge that caused it. #10010 merged on a
stale-green formatting run and reddened #10973 and #10998 until #8561
fixed the headers. Third time against this hook (#10402, #10845,
#8561), each fixed reactively.

## Technical Details

`.github/workflows/lstt-formatting.yml`:

- `push` trigger on `develop`, same path filter as `pull_request`, so a
whole-tree hook runs on the merge commit.
- `--from-ref` is event-aware via `FROM_REF`: `github.event.before` on
push, base branch on PR. PR behavior unchanged.
- `cancel-in-progress` limited to `pull_request`, so consecutive merges
each keep their verdict.

Detection at merge, not prevention. Prevention is "Require branches to
be up to date before merging". `develop`'s ruleset has
`required_status_checks` with 
`strict_required_status_checks_policy: false`, so a PR can merge on a
check that last ran against an older base — which is how the stale-green merge
happened.


Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
corey-derochie-amd pushed a commit that referenced this pull request Oct 8, 2026
…0845)

## Why

#10402 converted every amd-smi source to the two-line SPDX MIT header
and added the `amdsmi-license-headers` pre-commit hook to hold the line.
**The hook currently fails on `develop` itself**, so every open amd-smi
PR is red — including ones that touch none of the offending files.

```
$ git checkout origin/develop
$ python3 projects/amdsmi/tests/check_license_headers.py
Missing or malformed AMD SPDX license header:
  src/ualoe_lib/ualoe_nl.c
  src/ualoe_lib/ualoe_telem.c
  tests/amd_smi_test/unit/system/status_string_test.cc
  tests/python/unit/gpu/test_cli_vram_type_lpddr5.py
  tests/python/unit/system/test_expect_status.py
```

The blast radius is wide because the hook is `pass_filenames: false` and
rescans the whole tracked tree. It fires for any PR touching a single
amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went
near. #10083 trips it by editing one line of `src/CMakeLists.txt`.

## What

The five files fall into two groups with different causes.

**Three are amd-smi's own**, and simply landed while #10402 was in
review, so its branch never saw them and they arrived with the old
twenty-line MIT block. Converted here:

| File | Landed via |
|---|---|
| `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 |
| `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 |
| `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` |

**The other two are not ours to edit.** `src/ualoe_lib/` is the vendored
UALoE library, replaced wholesale by the periodic *"sync UALoE lib"*
drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit
`exclude:` block, keeping clang-format and the rest off that code.
#10402 carried only the `include/ualoe_lib/` half of that exclusion into
the checker and left `src/` behind, so the checker now polices code the
next sync will overwrite. Rewriting those headers would be reverted by
the next drop and the hook would break again, so the missing prefix is
added to `EXCLUDE_PREFIX` instead.

The three files #10402 did rewrite under `src/ualoe_lib/` are left
alone; they now fall outside the check and will drift back on their own
at the next sync.

Header text and check scope only — no functional change.

## Verification

```
$ python3 projects/amdsmi/tests/check_license_headers.py           # exit 0
$ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py  # 6/6 cases
$ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed>
  codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts /
  large-files / mixed-line-ending / clang-format / ruff format /
  amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed
```

Confirmed the two vendored files are byte-identical to `develop` (`git
diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and
that the checker skips them when named explicitly.

Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
corey-derochie-amd pushed a commit that referenced this pull request Oct 9, 2026
…0845)

## Why

#10402 converted every amd-smi source to the two-line SPDX MIT header
and added the `amdsmi-license-headers` pre-commit hook to hold the line.
**The hook currently fails on `develop` itself**, so every open amd-smi
PR is red — including ones that touch none of the offending files.

```
$ git checkout origin/develop
$ python3 projects/amdsmi/tests/check_license_headers.py
Missing or malformed AMD SPDX license header:
  src/ualoe_lib/ualoe_nl.c
  src/ualoe_lib/ualoe_telem.c
  tests/amd_smi_test/unit/system/status_string_test.cc
  tests/python/unit/gpu/test_cli_vram_type_lpddr5.py
  tests/python/unit/system/test_expect_status.py
```

The blast radius is wide because the hook is `pass_filenames: false` and
rescans the whole tracked tree. It fires for any PR touching a single
amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went
near. #10083 trips it by editing one line of `src/CMakeLists.txt`.

## What

The five files fall into two groups with different causes.

**Three are amd-smi's own**, and simply landed while #10402 was in
review, so its branch never saw them and they arrived with the old
twenty-line MIT block. Converted here:

| File | Landed via |
|---|---|
| `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 |
| `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 |
| `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` |

**The other two are not ours to edit.** `src/ualoe_lib/` is the vendored
UALoE library, replaced wholesale by the periodic *"sync UALoE lib"*
drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit
`exclude:` block, keeping clang-format and the rest off that code.
#10402 carried only the `include/ualoe_lib/` half of that exclusion into
the checker and left `src/` behind, so the checker now polices code the
next sync will overwrite. Rewriting those headers would be reverted by
the next drop and the hook would break again, so the missing prefix is
added to `EXCLUDE_PREFIX` instead.

The three files #10402 did rewrite under `src/ualoe_lib/` are left
alone; they now fall outside the check and will drift back on their own
at the next sync.

Header text and check scope only — no functional change.

## Verification

```
$ python3 projects/amdsmi/tests/check_license_headers.py           # exit 0
$ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py  # 6/6 cases
$ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed>
  codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts /
  large-files / mixed-line-ending / clang-format / ruff format /
  amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed
```

Confirmed the two vendored files are byte-identical to `develop` (`git
diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and
that the checker skips them when named explicitly.

Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
corey-derochie-amd pushed a commit that referenced this pull request Oct 14, 2026
…0845)

## Why

#10402 converted every amd-smi source to the two-line SPDX MIT header
and added the `amdsmi-license-headers` pre-commit hook to hold the line.
**The hook currently fails on `develop` itself**, so every open amd-smi
PR is red — including ones that touch none of the offending files.

```
$ git checkout origin/develop
$ python3 projects/amdsmi/tests/check_license_headers.py
Missing or malformed AMD SPDX license header:
  src/ualoe_lib/ualoe_nl.c
  src/ualoe_lib/ualoe_telem.c
  tests/amd_smi_test/unit/system/status_string_test.cc
  tests/python/unit/gpu/test_cli_vram_type_lpddr5.py
  tests/python/unit/system/test_expect_status.py
```

The blast radius is wide because the hook is `pass_filenames: false` and
rescans the whole tracked tree. It fires for any PR touching a single
amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went
near. #10083 trips it by editing one line of `src/CMakeLists.txt`.

## What

The five files fall into two groups with different causes.

**Three are amd-smi's own**, and simply landed while #10402 was in
review, so its branch never saw them and they arrived with the old
twenty-line MIT block. Converted here:

| File | Landed via |
|---|---|
| `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 |
| `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 |
| `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` |

**The other two are not ours to edit.** `src/ualoe_lib/` is the vendored
UALoE library, replaced wholesale by the periodic *"sync UALoE lib"*
drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit
`exclude:` block, keeping clang-format and the rest off that code.
#10402 carried only the `include/ualoe_lib/` half of that exclusion into
the checker and left `src/` behind, so the checker now polices code the
next sync will overwrite. Rewriting those headers would be reverted by
the next drop and the hook would break again, so the missing prefix is
added to `EXCLUDE_PREFIX` instead.

The three files #10402 did rewrite under `src/ualoe_lib/` are left
alone; they now fall outside the check and will drift back on their own
at the next sync.

Header text and check scope only — no functional change.

## Verification

```
$ python3 projects/amdsmi/tests/check_license_headers.py           # exit 0
$ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py  # 6/6 cases
$ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed>
  codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts /
  large-files / mixed-line-ending / clang-format / ruff format /
  amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed
```

Confirmed the two vendored files are byte-identical to `develop` (`git
diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and
that the checker skips them when named explicitly.

Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
corey-derochie-amd pushed a commit that referenced this pull request Oct 14, 2026
…0845)

## Why

#10402 converted every amd-smi source to the two-line SPDX MIT header
and added the `amdsmi-license-headers` pre-commit hook to hold the line.
**The hook currently fails on `develop` itself**, so every open amd-smi
PR is red — including ones that touch none of the offending files.

```
$ git checkout origin/develop
$ python3 projects/amdsmi/tests/check_license_headers.py
Missing or malformed AMD SPDX license header:
  src/ualoe_lib/ualoe_nl.c
  src/ualoe_lib/ualoe_telem.c
  tests/amd_smi_test/unit/system/status_string_test.cc
  tests/python/unit/gpu/test_cli_vram_type_lpddr5.py
  tests/python/unit/system/test_expect_status.py
```

The blast radius is wide because the hook is `pass_filenames: false` and
rescans the whole tracked tree. It fires for any PR touching a single
amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went
near. #10083 trips it by editing one line of `src/CMakeLists.txt`.

## What

The five files fall into two groups with different causes.

**Three are amd-smi's own**, and simply landed while #10402 was in
review, so its branch never saw them and they arrived with the old
twenty-line MIT block. Converted here:

| File | Landed via |
|---|---|
| `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 |
| `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 |
| `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` |

**The other two are not ours to edit.** `src/ualoe_lib/` is the vendored
UALoE library, replaced wholesale by the periodic *"sync UALoE lib"*
drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit
`exclude:` block, keeping clang-format and the rest off that code.
#10402 carried only the `include/ualoe_lib/` half of that exclusion into
the checker and left `src/` behind, so the checker now polices code the
next sync will overwrite. Rewriting those headers would be reverted by
the next drop and the hook would break again, so the missing prefix is
added to `EXCLUDE_PREFIX` instead.

The three files #10402 did rewrite under `src/ualoe_lib/` are left
alone; they now fall outside the check and will drift back on their own
at the next sync.

Header text and check scope only — no functional change.

## Verification

```
$ python3 projects/amdsmi/tests/check_license_headers.py           # exit 0
$ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py  # 6/6 cases
$ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed>
  codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts /
  large-files / mixed-line-ending / clang-format / ruff format /
  amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed
```

Confirmed the two vendored files are byte-identical to `develop` (`git
diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and
that the checker skips them when named explicitly.

Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
corey-derochie-amd pushed a commit that referenced this pull request Oct 15, 2026
…0845)

## Why

#10402 converted every amd-smi source to the two-line SPDX MIT header
and added the `amdsmi-license-headers` pre-commit hook to hold the line.
**The hook currently fails on `develop` itself**, so every open amd-smi
PR is red — including ones that touch none of the offending files.

```
$ git checkout origin/develop
$ python3 projects/amdsmi/tests/check_license_headers.py
Missing or malformed AMD SPDX license header:
  src/ualoe_lib/ualoe_nl.c
  src/ualoe_lib/ualoe_telem.c
  tests/amd_smi_test/unit/system/status_string_test.cc
  tests/python/unit/gpu/test_cli_vram_type_lpddr5.py
  tests/python/unit/system/test_expect_status.py
```

The blast radius is wide because the hook is `pass_filenames: false` and
rescans the whole tracked tree. It fires for any PR touching a single
amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went
near. #10083 trips it by editing one line of `src/CMakeLists.txt`.

## What

The five files fall into two groups with different causes.

**Three are amd-smi's own**, and simply landed while #10402 was in
review, so its branch never saw them and they arrived with the old
twenty-line MIT block. Converted here:

| File | Landed via |
|---|---|
| `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 |
| `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 |
| `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` |

**The other two are not ours to edit.** `src/ualoe_lib/` is the vendored
UALoE library, replaced wholesale by the periodic *"sync UALoE lib"*
drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit
`exclude:` block, keeping clang-format and the rest off that code.
#10402 carried only the `include/ualoe_lib/` half of that exclusion into
the checker and left `src/` behind, so the checker now polices code the
next sync will overwrite. Rewriting those headers would be reverted by
the next drop and the hook would break again, so the missing prefix is
added to `EXCLUDE_PREFIX` instead.

The three files #10402 did rewrite under `src/ualoe_lib/` are left
alone; they now fall outside the check and will drift back on their own
at the next sync.

Header text and check scope only — no functional change.

## Verification

```
$ python3 projects/amdsmi/tests/check_license_headers.py           # exit 0
$ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py  # 6/6 cases
$ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed>
  codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts /
  large-files / mixed-line-ending / clang-format / ruff format /
  amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed
```

Confirmed the two vendored files are byte-identical to `develop` (`git
diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and
that the checker skips them when named explicitly.

Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
corey-derochie-amd pushed a commit that referenced this pull request Oct 15, 2026
…0845)

## Why

#10402 converted every amd-smi source to the two-line SPDX MIT header
and added the `amdsmi-license-headers` pre-commit hook to hold the line.
**The hook currently fails on `develop` itself**, so every open amd-smi
PR is red — including ones that touch none of the offending files.

```
$ git checkout origin/develop
$ python3 projects/amdsmi/tests/check_license_headers.py
Missing or malformed AMD SPDX license header:
  src/ualoe_lib/ualoe_nl.c
  src/ualoe_lib/ualoe_telem.c
  tests/amd_smi_test/unit/system/status_string_test.cc
  tests/python/unit/gpu/test_cli_vram_type_lpddr5.py
  tests/python/unit/system/test_expect_status.py
```

The blast radius is wide because the hook is `pass_filenames: false` and
rescans the whole tracked tree. It fires for any PR touching a single
amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went
near. #10083 trips it by editing one line of `src/CMakeLists.txt`.

## What

The five files fall into two groups with different causes.

**Three are amd-smi's own**, and simply landed while #10402 was in
review, so its branch never saw them and they arrived with the old
twenty-line MIT block. Converted here:

| File | Landed via |
|---|---|
| `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 |
| `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 |
| `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` |

**The other two are not ours to edit.** `src/ualoe_lib/` is the vendored
UALoE library, replaced wholesale by the periodic *"sync UALoE lib"*
drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit
`exclude:` block, keeping clang-format and the rest off that code.
#10402 carried only the `include/ualoe_lib/` half of that exclusion into
the checker and left `src/` behind, so the checker now polices code the
next sync will overwrite. Rewriting those headers would be reverted by
the next drop and the hook would break again, so the missing prefix is
added to `EXCLUDE_PREFIX` instead.

The three files #10402 did rewrite under `src/ualoe_lib/` are left
alone; they now fall outside the check and will drift back on their own
at the next sync.

Header text and check scope only — no functional change.

## Verification

```
$ python3 projects/amdsmi/tests/check_license_headers.py           # exit 0
$ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py  # 6/6 cases
$ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed>
  codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts /
  large-files / mixed-line-ending / clang-format / ruff format /
  amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed
```

Confirmed the two vendored files are byte-identical to `develop` (`git
diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and
that the checker skips them when named explicitly.

Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
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.

5 participants