Skip to content

ci: migrate the centralized add-license hook to the org .github repository#61

Open
mc-nv wants to merge 14 commits into
mainfrom
mchornyi/TRI-1100/github-align-hooks-and-templates
Open

ci: migrate the centralized add-license hook to the org .github repository#61
mc-nv wants to merge 14 commits into
mainfrom
mchornyi/TRI-1100/github-align-hooks-and-templates

Conversation

@mc-nv

@mc-nv mc-nv commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

What does the PR do?

Migrates the centralized add-license pre-commit hook (definition + tools/add_copyright.py) out of this repository into the org-wide defaults repo triton-inference-server/.github (see triton-inference-server/.github#5), so hooks, templates, issue routing, and reusable workflows live under one roof with a single tag line.

Existing consumers pinned to this repository's v0.x tags keep working — tags are immutable; new consumers reference .github@v1.0.0. This repository itself becomes a plain consumer, aligned with the shared baseline (conventional-commit validation, modified-files CI, org-wide templates, conventional-pr caller stub).

Depends on triton-inference-server/.github#5 being merged and tagged (current: v1.3.0).

Related Issues / PRs

  • Resolves: TRI-1100

Related PRs:

Test plan

  • pre-commit validate-config passes; hooks pass on the PR diff with the centralized hooks pinned to the .github branch SHA.
  • Consumers of the old v0.x tags verified unaffected (tags still resolve).

Caveats

  • The v0.2.x tags remain in place for any external consumer; they can be retired once nothing references them.

Checklist

  • PR title follows <commit_type>: <Title> (conventional commit)
  • I ran pre-commit locally on all files changed by this PR and it passes
  • Copyright header is correct on all changed files
  • External contributors: I have read the Contribution guidelines and signed the Contributor License Agreement

Add tools/add_spdx_header.py as a centralized pre-commit hook that
migrates each source file to the two-line SPDX header the first time it
is touched (maintain / migrate legacy NVIDIA BSD header / insert).
Exclude .github/ from add-license so GitHub issue/PR templates keep
their YAML frontmatter first. Make add-license read the LICENSE file
without rewriting its copyright year — consumer repos' LICENSE files
must never be modified by hooks. Requires tagging v0.2.0 after merge.

Also align this repository with the shared pre-commit baseline and
GitHub templates.

TRI-1100
@mc-nv mc-nv self-assigned this Jul 18, 2026
This was referenced Jul 18, 2026
CI here must validate the hook code being merged rather than an
already-published tag; consumer repositories keep referencing
rev: v0.2.0.

TRI-1100
@mc-nv
mc-nv marked this pull request as ready for review July 18, 2026 01:00
Legal's Copyright / License Header Guidance specifies the SPDX form
without a comma after the year:
  SPDX-FileCopyrightText: Copyright (c) <year> NVIDIA CORPORATION & AFFILIATES. All rights reserved.

Emit that form from add_spdx_header.py, keep both hooks tolerant of the
legacy comma variant, and normalize the headers introduced by this
change.

TRI-1100
Adopt the canonical PR template set from triton-inference-server/server
(default chooser plus internal/external contribution templates) so every
repository presents the same PR experience. The manual "Commit Type"
checkbox section is dropped — the conventional-pre-commit hook
(commit-msg stage) enforces it automatically.

TRI-1100
Comment thread .pre-commit-config.yaml
additional_dependencies: [tomli]
args: ["--toml", "pyproject.toml"]
exclude: (?x)^(.*stemmer.*|.*stop_words.*|^CHANGELOG.md$)
# Validates commit messages against the Conventional Commits format

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.

Question: This hook only validates commit messages. It does not check pull request titles. And we don't need to add rules to the commits because everything will be squashed at the end.

Comment thread tools/add_copyright.py Outdated
Returns the contents of the LICENSE file.

Note: LICENSE file maintains a year range if it has an older starting year.
Note: The LICENSE file itself is never modified by this hook; its

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.

Why not? When do we update the LICENSE copyrights?

The hook definition and tools/add_copyright.py move to
triton-inference-server/.github (v1.0.0) so hooks, templates, and
reusable workflows live under one roof. Existing consumers pinned to
this repository's v0.x tags keep working - tags are immutable.

Also aligns this repository with the shared baseline (conventional
commit validation, modified-files pre-commit CI, org-wide templates,
conventional-pr caller stub).

TRI-1100
@mc-nv mc-nv changed the title ci: harden the centralized add-license pre-commit hook ci: migrate the centralized add-license hook to the org .github repository Jul 20, 2026
Org-wide label color scheme and cherry-pick detection.

TRI-1100
Human-readable type labels with enforced descriptions and colors.

TRI-1100
@github-actions github-actions Bot added CI/CD Continuous integration and workflow changes (ci: PRs) and removed ci labels Jul 20, 2026
@github-actions github-actions Bot added the chore Maintenance work, no production code change (chore: PRs) label Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance work, no production code change (chore: PRs) CI/CD Continuous integration and workflow changes (ci: PRs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants