From 2d443d6d8eb9dbe323065346c70f3eb707cbaccb Mon Sep 17 00:00:00 2001 From: "M. Chornyi" <99709299+mc-nv@users.noreply.github.com> Date: Fri, 17 Jul 2026 17:11:40 -0700 Subject: [PATCH 01/16] ci: align pre-commit hooks and GitHub templates Adopt the shared pre-commit baseline: two-line SPDX header, conventional commit message validation (commit-msg stage), and the centralized add-license / add-spdx-license hooks from developer_tools v0.2.0. The local add-spdx-license hook and its script move to developer_tools. Run pre-commit CI only on files modified by the PR, and roll out the simplified single PR template. TRI-1100 --- .../pull_request_template_external_contrib.md | 50 ------ .../pull_request_template_internal_contrib.md | 50 ------ .github/pull_request_template.md | 26 ++- .github/workflows/pre-commit.yml | 27 +-- .pre-commit-config.yaml | 33 ++-- tools/add_spdx_header.py | 157 ------------------ 6 files changed, 36 insertions(+), 307 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md delete mode 100644 tools/add_spdx_header.py diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md deleted file mode 100644 index 4f7afde5fa..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md +++ /dev/null @@ -1,50 +0,0 @@ -#### What does the PR do? - - -#### Checklist -- [ ] I have read the [Contribution guidelines](#../../CONTRIBUTING.md) and signed the [Contributor License -Agreement](https://github.com/NVIDIA/triton-inference-server/blob/master/Triton-CCLA-v1.pdf) -- [ ] PR title reflects the change and is of format `: ` -- [ ] Changes are described in the pull request. -- [ ] Related issues are referenced. -- [ ] Populated [github labels](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels) field -- [ ] Added [test plan](#test-plan) and verified test passes. -- [ ] Verified that the PR passes existing CI. -- [ ] I ran pre-commit locally (`pre-commit install, pre-commit run --all`) -- [ ] Verified copyright is correct on all changed files. -- [ ] Added _succinct_ git squash message before merging [ref](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). -- [ ] All template sections are filled out. -- [ ] Optional: Additional screenshots for behavior/output changes with before/after. - -#### Commit Type: -Check the [conventional commit type](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type) -box here and add the label to the github PR. -- [ ] build -- [ ] ci -- [ ] docs -- [ ] feat -- [ ] fix -- [ ] perf -- [ ] refactor -- [ ] revert -- [ ] style -- [ ] test - -#### Related PRs: -<!-- Related PRs from other Repositories --> - -#### Where should the reviewer start? -<!-- call out specific files that should be looked at closely --> - -#### Test plan: -<!-- list steps to verify feature works --> -<!-- were e2e tests added?--> - -#### Caveats: -<!-- any limitations or possible things missing from this PR --> - -#### Background -<!-- e.g. what led to this change being made. this is optional extra information to help the reviewer --> - -#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) -- closes GitHub issue: #xxx diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md deleted file mode 100644 index b1e520b4aa..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md +++ /dev/null @@ -1,50 +0,0 @@ -#### What does the PR do? -<!-- Describe your pull request here. Please read the text below the line, and make sure you follow the checklist.--> - -#### Checklist -- [ ] PR title reflects the change and is of format `<commit_type>: <Title>` -- [ ] Changes are described in the pull request. -- [ ] Related issues are referenced. -- [ ] Populated [github labels](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels) field -- [ ] Added [test plan](#test-plan) and verified test passes. -- [ ] Verified that the PR passes existing CI. -- [ ] Verified copyright is correct on all changed files. -- [ ] Added _succinct_ git squash message before merging [ref](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). -- [ ] All template sections are filled out. -- [ ] Optional: Additional screenshots for behavior/output changes with before/after. - -#### Commit Type: -Check the [conventional commit type](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type) -box here and add the label to the github PR. -- [ ] build -- [ ] ci -- [ ] docs -- [ ] feat -- [ ] fix -- [ ] perf -- [ ] refactor -- [ ] revert -- [ ] style -- [ ] test - -#### Related PRs: -<!-- Related PRs from other Repositories --> - -#### Where should the reviewer start? -<!-- call out specific files that should be looked at closely --> - -#### Test plan: -<!-- list steps to verify --> -<!-- were e2e tests added?--> - -- CI Pipeline ID: -<!-- Only Pipeline ID and no direct link here --> - -#### Caveats: -<!-- any limitations or possible things missing from this PR --> - -#### Background -<!-- e.g. what led to this change being made. this is optional extra information to help the reviewer --> - -#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) -- closes GitHub issue: #xxx diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 0787dcbc60..2671e4eb38 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,13 +1,23 @@ -Thanks for submitting a PR to Triton! -Please go the the `Preview` tab above this description box and select the appropriate sub-template: +<!-- +SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +SPDX-License-Identifier: BSD-3-Clause +--> -* [PR description template for Triton Engineers](?expand=1&template=pull_request_template_internal_contrib.md) -* [PR description template for External Contributors](?expand=1&template=pull_request_template_external_contrib.md) +#### What does the PR do? +<!-- Describe the change and the motivation behind it. --> -If you already created the PR, please replace this message with one of -* [External contribution template](https://raw.githubusercontent.com/triton-inference-server/server/main/.github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md) -* [Internal contribution template](https://raw.githubusercontent.com/triton-inference-server/server/main/.github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md) +#### Related Issues / PRs +<!-- Use "Closes #xxx" / "Fixes #xxx" / "Resolves #xxx" for issues. + Link related PRs from other triton-inference-server repositories. --> -and fill it out. +#### Test plan +<!-- How was this change verified? List steps, tests added, or CI evidence. --> +#### Caveats +<!-- Optional: known limitations or follow-ups. --> +#### Checklist +- [ ] PR title follows `<commit_type>: <Title>` (conventional commit — enforced by the `conventional-pre-commit` hook) +- [ ] I ran `pre-commit install && pre-commit run --all-files` locally and it passes +- [ ] Copyright header is correct on all changed files +- [ ] External contributors: I have read the [Contribution guidelines](../CONTRIBUTING.md) and signed the [Contributor License Agreement](https://github.com/NVIDIA/triton-inference-server/blob/master/Triton-CCLA-v1.pdf) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 15d0b68685..e52c546f97 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,28 +1,5 @@ -# Copyright 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of NVIDIA CORPORATION nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: BSD-3-Clause name: pre-commit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b59184680a..deed3ac029 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,8 @@ # SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause +default_install_hook_types: [pre-commit, commit-msg] + repos: - repo: https://github.com/PyCQA/isort rev: 5.12.0 @@ -31,6 +33,15 @@ repos: additional_dependencies: [tomli] args: ["--toml", "pyproject.toml"] exclude: (?x)^(.*stemmer.*|.*stop_words.*|^CHANGELOG.md$) +# Validates commit messages against the Conventional Commits format +# (<commit_type>: <title>). Replaces the manual commit-type checklist that +# used to live in the PR template. +- repo: https://github.com/compilerla/conventional-pre-commit + rev: v4.4.0 + hooks: + - id: conventional-pre-commit + stages: [commit-msg] + args: [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] # More details about these pre-commit hooks here: # https://pre-commit.com/hooks.html - repo: https://github.com/pre-commit/pre-commit-hooks @@ -51,23 +62,11 @@ repos: - id: trailing-whitespace - repo: https://github.com/triton-inference-server/developer_tools - rev: v0.1.0 + rev: v0.2.0 hooks: - id: add-license -- repo: local - hooks: - # Incremental SPDX-header adoption: migrate each source file to the two-line - # SPDX header the first time it is touched. pre-commit runs hooks only on the - # files staged in a commit, so scoping by file type (below) -- not by directory - # -- rolls SPDX out gradually as files change. The hook maintains an existing - # SPDX header, replaces a legacy long-form NVIDIA BSD header in place, or - # inserts one. It runs after add-license above, which only maintains the - # copyright year on the string both headers share. + # Incremental SPDX-header adoption: migrates each source file to the + # two-line SPDX header the first time it is touched. pre-commit runs hooks + # only on the files staged in a commit, so this rolls SPDX out gradually + # as files change. - id: add-spdx-license - name: Add SPDX License Header - entry: python tools/add_spdx_header.py - language: python - files: \.(py|pyi|sh|bash|yaml|yml|cc|cpp|cxx|h|hpp|cu|cuh)$ - stages: [pre-commit] - verbose: true - require_serial: true diff --git a/tools/add_spdx_header.py b/tools/add_spdx_header.py deleted file mode 100644 index f78b90b758..0000000000 --- a/tools/add_spdx_header.py +++ /dev/null @@ -1,157 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: BSD-3-Clause - -"""Insert / maintain / migrate to an SPDX license header on source files. - -Pre-commit hook that adopts the two-line SPDX header on every file it is run -against. Because pre-commit runs hooks on the files staged in a commit, scoping -this hook by file type (rather than by directory) migrates each source file to -SPDX *the first time it is touched* -- a low-risk, incremental rollout. - -The header uses a copyright *year range*, mirroring the repo convention (the -``LICENSE`` file and ``add_copyright.py`` use ``<start>-<current>``):: - - # SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. - # SPDX-License-Identifier: BSD-3-Clause - -Per file, the hook does exactly one of: - -* **Maintain** -- already SPDX: bump the copyright end year to the current year. -* **Migrate** -- carries the legacy long-form NVIDIA BSD header: replace that - whole block in place with the two SPDX lines, preserving the comment style - (``#`` or ``//``), the shebang, and the block's start year. -* **Insert** -- no NVIDIA header: add the SPDX header (after a shebang if any). - -Idempotent, and coexists with ``add_copyright.py`` (which runs first and only -maintains the copyright year on the legacy/SPDX string it recognizes). -""" - -import os -import re -import sys -from datetime import datetime - -ROOT_DIR = os.path.join(os.path.dirname(__file__), os.pardir) -LICENSE_PATH = os.path.join(ROOT_DIR, "LICENSE") -CURRENT_YEAR = str(datetime.now().year) - -_SPDX_MARKER = "SPDX-License-Identifier" -_LICENSE_ID = "BSD-3-Clause" - -# Start year of the project-wide LICENSE (used only when inserting into a file -# that has no NVIDIA copyright at all). -_LICENSE_YEAR_PAT = re.compile(r"Copyright \(c\) (\d{4})(?:-\d{4})?, NVIDIA") -# Existing SPDX copyright line (for year maintenance). -_SPDX_YEAR_PAT = re.compile( - r"(SPDX-FileCopyrightText: Copyright \(c\) )(\d{4})(?:-\d{4})?(, NVIDIA)" -) -# First line of a legacy long-form NVIDIA BSD header (captures comment prefix + -# start year). The block ends at the standard BSD "SUCH DAMAGE" line. -_LEGACY_COPY_PAT = re.compile( - r"^(#|//) ?Copyright(?: \(c\))? (\d{4})(?:-\d{4})?,? NVIDIA CORPORATION" -) -_LEGACY_END_MARK = "POSSIBILITY OF SUCH DAMAGE" - -_CPP_EXTS = (".cc", ".cpp", ".cxx", ".h", ".hpp", ".cu", ".cuh") - - -def _year_range(start): - return start if start == CURRENT_YEAR else "{}-{}".format(start, CURRENT_YEAR) - - -def _license_start_year(): - try: - with open(LICENSE_PATH, "r", encoding="utf-8") as f: - match = _LICENSE_YEAR_PAT.search(f.read()) - if match: - return match.group(1) - except OSError: - # LICENSE not readable here; fall through to the current-year default. - pass - return CURRENT_YEAR - - -def _spdx_lines(prefix, years): - return ( - "{p} SPDX-FileCopyrightText: Copyright (c) {y}, NVIDIA CORPORATION " - "& AFFILIATES. All rights reserved.\n" - "{p} SPDX-License-Identifier: {lic}\n".format( - p=prefix, y=years, lic=_LICENSE_ID - ) - ) - - -def _maintain(content): - def _bump(match): - return match.group(1) + _year_range(match.group(2)) + match.group(3) - - return _SPDX_YEAR_PAT.sub(_bump, content) - - -def _migrate_legacy(content): - """Replace a legacy long-form NVIDIA BSD header with the SPDX lines. Returns - the new content, or None if no legacy header is found.""" - lines = content.splitlines(keepends=True) - start = prefix = start_year = None - for i, line in enumerate(lines): - match = _LEGACY_COPY_PAT.match(line) - if match: - start, prefix, start_year = i, match.group(1), match.group(2) - break - if start is None: - return None - end = None - for j in range(start, len(lines)): - if _LEGACY_END_MARK in lines[j]: - end = j - break - if end is None: - return None - header = _spdx_lines(prefix, _year_range(start_year)) - return "".join(lines[:start]) + header + "".join(lines[end + 1 :]) - - -def _insert(path, content): - prefix = "//" if path.endswith(_CPP_EXTS) else "#" - header = _spdx_lines(prefix, _year_range(_license_start_year())) + "\n" - lines = content.splitlines(keepends=True) - if lines and lines[0].startswith("#!"): - return lines[0] + header + "".join(lines[1:]) - return header + content - - -def process(path): - """Bring ``path`` to an SPDX header (maintain/migrate/insert). Returns True if - the file was modified.""" - try: - with open(path, "r", encoding="utf-8") as f: - content = f.read() - except (OSError, UnicodeDecodeError): - return False - - if _SPDX_MARKER in content: - updated = _maintain(content) - else: - updated = _migrate_legacy(content) - if updated is None: - updated = _insert(path, content) - - if updated == content: - return False - with open(path, "w", encoding="utf-8") as f: - f.write(updated) - return True - - -def main(argv): - changed = False - for path in argv[1:]: - if process(path): - print("Updated SPDX header: {}".format(path)) - changed = True - # Non-zero exit tells pre-commit the file was modified so it re-stages. - return 1 if changed else 0 - - -if __name__ == "__main__": - sys.exit(main(sys.argv)) From 66a5c6438e7dddcb78424f60d2d29c2b8014a68d Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Fri, 17 Jul 2026 18:36:40 -0700 Subject: [PATCH 02/16] chore: align SPDX copyright text with NVIDIA Legal boilerplate Legal's Copyright / License Header Guidance specifies the SPDX form without a comma after the year. TRI-1100 --- .github/pull_request_template.md | 2 +- .github/workflows/pre-commit.yml | 2 +- .pre-commit-config.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2671e4eb38..3de2b786d1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,5 +1,5 @@ <!-- -SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-3-Clause --> diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index e52c546f97..2210ecbed3 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause name: pre-commit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index deed3ac029..1a68158153 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause default_install_hook_types: [pre-commit, commit-msg] From 327e26fe1021a5ba2741474e6443602a3c6ba0d2 Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Fri, 17 Jul 2026 23:00:58 -0700 Subject: [PATCH 03/16] ci: drop SPDX adoption and keep long-form license headers Remove the add-spdx-license hook reference and restore the standard long-form NVIDIA BSD header on the files introduced by this branch. The centralized add-license hook (developer_tools v0.2.0) is kept: it excludes .github/ templates and never rewrites LICENSE files. TRI-1100 --- .github/pull_request_template.md | 5 ----- .github/workflows/pre-commit.yml | 27 +++++++++++++++++++++++++-- .pre-commit-config.yaml | 32 +++++++++++++++++++++++++------- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3de2b786d1..a79d3bddc0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,8 +1,3 @@ -<!-- -SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -SPDX-License-Identifier: BSD-3-Clause ---> - #### What does the PR do? <!-- Describe the change and the motivation behind it. --> diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 2210ecbed3..15d0b68685 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,5 +1,28 @@ -# SPDX-FileCopyrightText: Copyright (c) 2023-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of NVIDIA CORPORATION nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. name: pre-commit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1a68158153..ac149c613c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,28 @@ -# SPDX-FileCopyrightText: Copyright (c) 2023-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of NVIDIA CORPORATION nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. default_install_hook_types: [pre-commit, commit-msg] @@ -65,8 +88,3 @@ repos: rev: v0.2.0 hooks: - id: add-license - # Incremental SPDX-header adoption: migrates each source file to the - # two-line SPDX header the first time it is touched. pre-commit runs hooks - # only on the files staged in a commit, so this rolls SPDX out gradually - # as files change. - - id: add-spdx-license From b1a8285e607a98683ea9aebff5fe11e50eb6bf8d Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Fri, 17 Jul 2026 23:15:37 -0700 Subject: [PATCH 04/16] ci: bump developer_tools hooks to v0.2.1 TRI-1100 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ac149c613c..52d542104e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -85,6 +85,6 @@ repos: - id: trailing-whitespace - repo: https://github.com/triton-inference-server/developer_tools - rev: v0.2.0 + rev: v0.2.1 hooks: - id: add-license From bfc127fc1bec45779ad522acce27b544e2e264e5 Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Fri, 17 Jul 2026 23:32:57 -0700 Subject: [PATCH 05/16] ci: drop the Commit Type checklist from the PR templates The commit type is now enforced automatically by the conventional-pre-commit hook (commit-msg stage); the manual checkbox section is redundant. These templates are the canonical set shared with all other triton-inference-server repositories. TRI-1100 --- .../pull_request_template_external_contrib.md | 36 +++++++++++++++++++ .../pull_request_template_internal_contrib.md | 36 +++++++++++++++++++ .github/pull_request_template.md | 23 +++++------- 3 files changed, 81 insertions(+), 14 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md new file mode 100644 index 0000000000..4a9e6b653b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md @@ -0,0 +1,36 @@ +#### What does the PR do? +<!-- Describe your pull request here. Please read the text below the line, and make sure you follow the checklist.--> + +#### Checklist +- [ ] I have read the [Contribution guidelines](#../../CONTRIBUTING.md) and signed the [Contributor License +Agreement](https://github.com/NVIDIA/triton-inference-server/blob/master/Triton-CCLA-v1.pdf) +- [ ] PR title reflects the change and is of format `<commit_type>: <Title>` +- [ ] Changes are described in the pull request. +- [ ] Related issues are referenced. +- [ ] Populated [github labels](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels) field +- [ ] Added [test plan](#test-plan) and verified test passes. +- [ ] Verified that the PR passes existing CI. +- [ ] I ran pre-commit locally (`pre-commit install, pre-commit run --all`) +- [ ] Verified copyright is correct on all changed files. +- [ ] Added _succinct_ git squash message before merging [ref](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). +- [ ] All template sections are filled out. +- [ ] Optional: Additional screenshots for behavior/output changes with before/after. + +#### Related PRs: +<!-- Related PRs from other Repositories --> + +#### Where should the reviewer start? +<!-- call out specific files that should be looked at closely --> + +#### Test plan: +<!-- list steps to verify feature works --> +<!-- were e2e tests added?--> + +#### Caveats: +<!-- any limitations or possible things missing from this PR --> + +#### Background +<!-- e.g. what led to this change being made. this is optional extra information to help the reviewer --> + +#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) +- closes GitHub issue: #xxx diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md new file mode 100644 index 0000000000..42b1bb96da --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md @@ -0,0 +1,36 @@ +#### What does the PR do? +<!-- Describe your pull request here. Please read the text below the line, and make sure you follow the checklist.--> + +#### Checklist +- [ ] PR title reflects the change and is of format `<commit_type>: <Title>` +- [ ] Changes are described in the pull request. +- [ ] Related issues are referenced. +- [ ] Populated [github labels](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels) field +- [ ] Added [test plan](#test-plan) and verified test passes. +- [ ] Verified that the PR passes existing CI. +- [ ] Verified copyright is correct on all changed files. +- [ ] Added _succinct_ git squash message before merging [ref](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). +- [ ] All template sections are filled out. +- [ ] Optional: Additional screenshots for behavior/output changes with before/after. + +#### Related PRs: +<!-- Related PRs from other Repositories --> + +#### Where should the reviewer start? +<!-- call out specific files that should be looked at closely --> + +#### Test plan: +<!-- list steps to verify --> +<!-- were e2e tests added?--> + +- CI Pipeline ID: +<!-- Only Pipeline ID and no direct link here --> + +#### Caveats: +<!-- any limitations or possible things missing from this PR --> + +#### Background +<!-- e.g. what led to this change being made. this is optional extra information to help the reviewer --> + +#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) +- closes GitHub issue: #xxx diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a79d3bddc0..0787dcbc60 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,18 +1,13 @@ -#### What does the PR do? -<!-- Describe the change and the motivation behind it. --> +Thanks for submitting a PR to Triton! +Please go the the `Preview` tab above this description box and select the appropriate sub-template: -#### Related Issues / PRs -<!-- Use "Closes #xxx" / "Fixes #xxx" / "Resolves #xxx" for issues. - Link related PRs from other triton-inference-server repositories. --> +* [PR description template for Triton Engineers](?expand=1&template=pull_request_template_internal_contrib.md) +* [PR description template for External Contributors](?expand=1&template=pull_request_template_external_contrib.md) -#### Test plan -<!-- How was this change verified? List steps, tests added, or CI evidence. --> +If you already created the PR, please replace this message with one of +* [External contribution template](https://raw.githubusercontent.com/triton-inference-server/server/main/.github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md) +* [Internal contribution template](https://raw.githubusercontent.com/triton-inference-server/server/main/.github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md) + +and fill it out. -#### Caveats -<!-- Optional: known limitations or follow-ups. --> -#### Checklist -- [ ] PR title follows `<commit_type>: <Title>` (conventional commit — enforced by the `conventional-pre-commit` hook) -- [ ] I ran `pre-commit install && pre-commit run --all-files` locally and it passes -- [ ] Copyright header is correct on all changed files -- [ ] External contributors: I have read the [Contribution guidelines](../CONTRIBUTING.md) and signed the [Contributor License Agreement](https://github.com/NVIDIA/triton-inference-server/blob/master/Triton-CCLA-v1.pdf) From 6c2e1ecc3583f19c78cbea43857131d85777327b Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Mon, 20 Jul 2026 14:47:08 -0700 Subject: [PATCH 06/16] ci: align pre-commit hooks and adopt org-wide GitHub defaults Adopt the shared pre-commit baseline: conventional-commit message validation (commit-msg stage) and the centralized add-license hook from the org .github repository (v1.0.0). Run pre-commit CI only on files modified by the PR, and add the caller stub for the org-wide conventional-pr reusable workflow. Local PR templates are removed - GitHub inherits the canonical set from triton-inference-server/.github. ISSUE_TEMPLATE/ stays local: this repository is the org-wide issue intake point. The unused local SPDX script is removed. TRI-1100 --- .../pull_request_template_external_contrib.md | 36 ---------------- .../pull_request_template_internal_contrib.md | 36 ---------------- .github/pull_request_template.md | 13 ------ .github/workflows/conventional-pr.yml | 41 +++++++++++++++++++ .pre-commit-config.yaml | 8 ++-- 5 files changed, 45 insertions(+), 89 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md delete mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/conventional-pr.yml diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md deleted file mode 100644 index 4a9e6b653b..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md +++ /dev/null @@ -1,36 +0,0 @@ -#### What does the PR do? -<!-- Describe your pull request here. Please read the text below the line, and make sure you follow the checklist.--> - -#### Checklist -- [ ] I have read the [Contribution guidelines](#../../CONTRIBUTING.md) and signed the [Contributor License -Agreement](https://github.com/NVIDIA/triton-inference-server/blob/master/Triton-CCLA-v1.pdf) -- [ ] PR title reflects the change and is of format `<commit_type>: <Title>` -- [ ] Changes are described in the pull request. -- [ ] Related issues are referenced. -- [ ] Populated [github labels](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels) field -- [ ] Added [test plan](#test-plan) and verified test passes. -- [ ] Verified that the PR passes existing CI. -- [ ] I ran pre-commit locally (`pre-commit install, pre-commit run --all`) -- [ ] Verified copyright is correct on all changed files. -- [ ] Added _succinct_ git squash message before merging [ref](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). -- [ ] All template sections are filled out. -- [ ] Optional: Additional screenshots for behavior/output changes with before/after. - -#### Related PRs: -<!-- Related PRs from other Repositories --> - -#### Where should the reviewer start? -<!-- call out specific files that should be looked at closely --> - -#### Test plan: -<!-- list steps to verify feature works --> -<!-- were e2e tests added?--> - -#### Caveats: -<!-- any limitations or possible things missing from this PR --> - -#### Background -<!-- e.g. what led to this change being made. this is optional extra information to help the reviewer --> - -#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) -- closes GitHub issue: #xxx diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md deleted file mode 100644 index 42b1bb96da..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md +++ /dev/null @@ -1,36 +0,0 @@ -#### What does the PR do? -<!-- Describe your pull request here. Please read the text below the line, and make sure you follow the checklist.--> - -#### Checklist -- [ ] PR title reflects the change and is of format `<commit_type>: <Title>` -- [ ] Changes are described in the pull request. -- [ ] Related issues are referenced. -- [ ] Populated [github labels](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels) field -- [ ] Added [test plan](#test-plan) and verified test passes. -- [ ] Verified that the PR passes existing CI. -- [ ] Verified copyright is correct on all changed files. -- [ ] Added _succinct_ git squash message before merging [ref](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). -- [ ] All template sections are filled out. -- [ ] Optional: Additional screenshots for behavior/output changes with before/after. - -#### Related PRs: -<!-- Related PRs from other Repositories --> - -#### Where should the reviewer start? -<!-- call out specific files that should be looked at closely --> - -#### Test plan: -<!-- list steps to verify --> -<!-- were e2e tests added?--> - -- CI Pipeline ID: -<!-- Only Pipeline ID and no direct link here --> - -#### Caveats: -<!-- any limitations or possible things missing from this PR --> - -#### Background -<!-- e.g. what led to this change being made. this is optional extra information to help the reviewer --> - -#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) -- closes GitHub issue: #xxx diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 0787dcbc60..0000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,13 +0,0 @@ -Thanks for submitting a PR to Triton! -Please go the the `Preview` tab above this description box and select the appropriate sub-template: - -* [PR description template for Triton Engineers](?expand=1&template=pull_request_template_internal_contrib.md) -* [PR description template for External Contributors](?expand=1&template=pull_request_template_external_contrib.md) - -If you already created the PR, please replace this message with one of -* [External contribution template](https://raw.githubusercontent.com/triton-inference-server/server/main/.github/PULL_REQUEST_TEMPLATE/pull_request_template_external_contrib.md) -* [Internal contribution template](https://raw.githubusercontent.com/triton-inference-server/server/main/.github/PULL_REQUEST_TEMPLATE/pull_request_template_internal_contrib.md) - -and fill it out. - - diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml new file mode 100644 index 0000000000..d96bb13617 --- /dev/null +++ b/.github/workflows/conventional-pr.yml @@ -0,0 +1,41 @@ +# Copyright 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of NVIDIA CORPORATION nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Thin caller: the logic lives in the org-wide reusable workflow, pinned by +# tag. Workflow changes ship as a new tag in the .github repository plus a +# one-line rev bump here (tags are write-once, never moved). + +name: conventional-pr + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + conventional-pr: + permissions: + pull-requests: write + uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 52d542104e..1560cfae81 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -57,8 +57,8 @@ repos: args: ["--toml", "pyproject.toml"] exclude: (?x)^(.*stemmer.*|.*stop_words.*|^CHANGELOG.md$) # Validates commit messages against the Conventional Commits format -# (<commit_type>: <title>). Replaces the manual commit-type checklist that -# used to live in the PR template. +# (<commit_type>: <title>); PR titles are validated org-wide by the +# conventional-pr reusable workflow. - repo: https://github.com/compilerla/conventional-pre-commit rev: v4.4.0 hooks: @@ -84,7 +84,7 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace -- repo: https://github.com/triton-inference-server/developer_tools - rev: v0.2.1 +- repo: https://github.com/triton-inference-server/.github + rev: v1.0.0 hooks: - id: add-license From 34f8a5a99d5946bef5bb2f98693912f1688ecee6 Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Mon, 20 Jul 2026 14:57:32 -0700 Subject: [PATCH 07/16] ci: bump conventional-pr workflow to v1.1.0 Org-wide label color scheme and cherry-pick detection. TRI-1100 --- .github/workflows/conventional-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index d96bb13617..0871567f0e 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -38,4 +38,4 @@ jobs: conventional-pr: permissions: pull-requests: write - uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.0.0 + uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.1.0 From 4e58567305fdce8bf724545cbabce5030447908f Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Mon, 20 Jul 2026 15:30:17 -0700 Subject: [PATCH 08/16] ci: bump conventional-pr workflow to v1.2.1 Human-readable type labels with enforced descriptions and colors. TRI-1100 --- .github/workflows/conventional-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index 0871567f0e..dab9232afe 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -38,4 +38,4 @@ jobs: conventional-pr: permissions: pull-requests: write - uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.1.0 + uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.2.1 From 91aee28709bee81f04e6b9865a9159d3082e4eec Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Mon, 20 Jul 2026 15:36:41 -0700 Subject: [PATCH 09/16] ci: bump conventional-pr workflow to v1.2.2 TRI-1100 --- .github/workflows/conventional-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index dab9232afe..594e1ec12d 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -38,4 +38,4 @@ jobs: conventional-pr: permissions: pull-requests: write - uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.2.1 + uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.2.2 From caa46a5f078154734a907330393219edf1b8bd7d Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Mon, 20 Jul 2026 15:42:47 -0700 Subject: [PATCH 10/16] ci: bump conventional-pr workflow to v1.3.0 TRI-1100 --- .github/workflows/conventional-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index 594e1ec12d..503ddca226 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -38,4 +38,4 @@ jobs: conventional-pr: permissions: pull-requests: write - uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.2.2 + uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.3.0 From 4f7998beaac8cdb5f2cf86db492e001775424536 Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Mon, 20 Jul 2026 15:56:55 -0700 Subject: [PATCH 11/16] ci: bump conventional-pr workflow to v1.3.1 TRI-1100 --- .github/workflows/conventional-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index 503ddca226..1866f85145 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -38,4 +38,4 @@ jobs: conventional-pr: permissions: pull-requests: write - uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.3.0 + uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.3.1 From b9ad75bd87601aef1a2ce19414b35c0ca6f4d041 Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Mon, 20 Jul 2026 16:15:37 -0700 Subject: [PATCH 12/16] ci: pin org .github hooks and workflow to the same tag (v1.3.1) TRI-1100 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1560cfae81..a169b0b6a6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -85,6 +85,6 @@ repos: - id: trailing-whitespace - repo: https://github.com/triton-inference-server/.github - rev: v1.0.0 + rev: v1.3.1 hooks: - id: add-license From 1d3f880c4d34d97d601e60faa3baa5ada23be76d Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Tue, 21 Jul 2026 08:16:52 -0700 Subject: [PATCH 13/16] ci: bump org .github hooks and workflow to v1.4.0 The add-license hook now fails when the LICENSE copyright year is stale. TRI-1100 --- .github/workflows/conventional-pr.yml | 2 +- .pre-commit-config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index 1866f85145..922aaa5ef9 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -38,4 +38,4 @@ jobs: conventional-pr: permissions: pull-requests: write - uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.3.1 + uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.4.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a169b0b6a6..3f937a0194 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -85,6 +85,6 @@ repos: - id: trailing-whitespace - repo: https://github.com/triton-inference-server/.github - rev: v1.3.1 + rev: v1.4.0 hooks: - id: add-license From 3426b4fb41677a8b98446ba89179ae1143a0debb Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Tue, 21 Jul 2026 08:30:28 -0700 Subject: [PATCH 14/16] ci: bump org .github hooks and workflow to v1.4.1 Workflow files are license-processed again (only templates excluded); refresh the stale copyright year this repo's pre-commit workflow carried. TRI-1100 --- .github/workflows/conventional-pr.yml | 2 +- .github/workflows/pre-commit.yml | 2 +- .pre-commit-config.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index 922aaa5ef9..7f6b096d24 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -38,4 +38,4 @@ jobs: conventional-pr: permissions: pull-requests: write - uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.4.0 + uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.4.1 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 15d0b68685..4dbce6b109 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,4 +1,4 @@ -# Copyright 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f937a0194..031d6aac1b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -85,6 +85,6 @@ repos: - id: trailing-whitespace - repo: https://github.com/triton-inference-server/.github - rev: v1.4.0 + rev: v1.4.1 hooks: - id: add-license From 4e6761aef89a40a86d5574874c33b4475812276c Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Tue, 21 Jul 2026 17:20:36 -0700 Subject: [PATCH 15/16] ci: bump org .github hooks and workflow to v1.4.2 Grant issues:write to the labeling job (review feedback). TRI-1100 --- .github/workflows/conventional-pr.yml | 3 ++- .pre-commit-config.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index 7f6b096d24..72472a77f6 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -38,4 +38,5 @@ jobs: conventional-pr: permissions: pull-requests: write - uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.4.1 + issues: write + uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.4.2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 031d6aac1b..54b1db0b97 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -85,6 +85,6 @@ repos: - id: trailing-whitespace - repo: https://github.com/triton-inference-server/.github - rev: v1.4.1 + rev: v1.4.2 hooks: - id: add-license From 1f7ca4117f8aa4aed5260329c2039a24f3669940 Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Wed, 22 Jul 2026 11:30:38 -0700 Subject: [PATCH 16/16] ci: harden CI workflows and configs per fleet-wide review feedback - conventional-pr stub: dual pull_request/pull_request_target triggers so fork PRs from external contributors get labeled too (the reusable workflow never checks out PR code); explicit contents:read; pinned v1.4.3. - pre-commit workflow: robust modified-files runner (null-delimited paths, deletion-only PRs handled, deleted paths filtered, no undocumented -r flag, cache keyed on config hash). - flake8 args quoted correctly (the flow-scalar form split at commas and silently reduced the select list). - hooks pinned to .github v1.4.3. TRI-1100 --- .github/workflows/conventional-pr.yml | 14 +++++++++++++- .github/workflows/pre-commit.yml | 19 ++++++++++++++----- .pre-commit-config.yaml | 4 ++-- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index 72472a77f6..d3348b778b 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -33,10 +33,22 @@ name: conventional-pr on: pull_request: types: [opened, edited, synchronize, reopened] + pull_request_target: + types: [opened, edited, synchronize, reopened] jobs: conventional-pr: + # Same-repo PRs run on the safe pull_request event; fork PRs run on + # pull_request_target so the labeling job gets a writable token (safe + # here: the reusable workflow never checks out PR code - it only reads + # PR metadata via the API and manages labels). + if: >- + (github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name == github.repository) || + (github.event_name == 'pull_request_target' && + github.event.pull_request.head.repo.full_name != github.repository) permissions: pull-requests: write issues: write - uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.4.2 + contents: read + uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.4.3 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 4dbce6b109..cd8680b364 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -32,14 +32,23 @@ on: jobs: pre-commit: runs-on: ubuntu-latest + permissions: + contents: read steps: - uses: actions/checkout@v5.0.0 with: fetch-depth: 2 - - name: Get modified files - id: modified-files - run: echo "modified_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT - uses: actions/setup-python@v6.0.0 - - uses: pre-commit/action@v3.0.1 + - uses: actions/cache@v4 with: - extra_args: --files ${{ steps.modified-files.outputs.modified_files }} + path: ~/.cache/pre-commit + key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} + - name: Run pre-commit on the files modified by the PR + # Null-delimited so paths with spaces survive; --no-run-if-empty + # handles deletion-only PRs; deleted paths are filtered out before + # being handed to pre-commit. + run: | + python -m pip install --quiet pre-commit + git diff --name-only -z --diff-filter=d HEAD^1 HEAD \ + | xargs -0 --no-run-if-empty \ + pre-commit run --show-diff-on-failure --color=always --files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 54b1db0b97..1aff30b4d8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: rev: 7.3.0 hooks: - id: flake8 - args: [--max-line-length=88, --select=C,E,F,W,B,B950, --extend-ignore = E203,E501] + args: ["--max-line-length=88", "--select=C,E,F,W,B,B950", "--extend-ignore=E203,E501"] types_or: [python, cython] - repo: https://github.com/pre-commit/mirrors-clang-format rev: v16.0.5 @@ -85,6 +85,6 @@ repos: - id: trailing-whitespace - repo: https://github.com/triton-inference-server/.github - rev: v1.4.2 + rev: v1.4.3 hooks: - id: add-license