ci: align pre-commit hooks and GitHub templates - #909
Conversation
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. Run pre-commit CI only on files modified by the PR, and roll out the standard issue templates and the simplified single PR template. TRI-1100
Legal's Copyright / License Header Guidance specifies the SPDX form without a comma after the year. TRI-1100
Human-readable type labels with enforced descriptions and colors. TRI-1100
Vinya567
left a comment
There was a problem hiding this comment.
Identical to python_backend#449. Quick LGTM.
The add-license hook now fails when the LICENSE copyright year is stale. TRI-1100
Workflow files are license-processed again (only templates excluded); refresh the stale copyright year this repo's pre-commit workflow carried. TRI-1100
Grant issues:write to the labeling job (review feedback). TRI-1100
Greptile SummaryThis PR aligns the repository's CI infrastructure with the org-wide standards consolidated in
Confidence Score: 5/5Safe to merge — all three files contain CI/tooling configuration only; no production code is touched. The fork-PR routing conditional in conventional-pr.yml is logically correct, the pull_request_target path is protected by an explicit if guard, and the pre-commit workflow HEAD^1 HEAD diff works correctly with GitHub Actions merge-commit checkout. The contents: read permission is present in both workflows. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant GH as GitHub Event
participant WF as conventional-pr.yml
participant RW as org .github reusable workflow@v1.4.3
Note over GH,WF: Same-repo PR
GH->>WF: pull_request event fires
Note over WF: head.repo == repo TRUE
WF->>RW: "uses conventional-pr.yml@v1.4.3"
RW-->>GH: Validate title, apply label
Note over GH,WF: Fork PR
GH->>WF: pull_request event fires
Note over WF: head.repo == repo FALSE skip
GH->>WF: pull_request_target event fires
Note over WF: head.repo != repo TRUE
WF->>RW: "uses conventional-pr.yml@v1.4.3"
RW-->>GH: Validate title, apply label
Reviews (2): Last reviewed commit: "ci: harden CI workflows and configs per ..." | Re-trigger Greptile |
| permissions: | ||
| pull-requests: write | ||
| issues: write | ||
| uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.4.2 |
There was a problem hiding this comment.
Version tag mismatch with PR description and test plan
The workflow (and .pre-commit-config.yaml) pin to v1.4.2, but the PR description and test plan consistently say v1.4.1 ("pinned tags current: v1.4.1 — already exist, CI is green" / "After .github#5 merges and v1.4.1 exists"). If v1.4.2 is the intended tag and it exists, this is a stale description — update the prose. If v1.4.2 has not yet been published to the org .github repo, both the workflow and the pre-commit hook will fail at runtime when the tag cannot be resolved.
There was a problem hiding this comment.
Fixed - documentation drift: the descriptions have been refreshed to the current pinned tag v1.4.3 (they lagged behind the tag revisions; the tag exists and CI is green fleet-wide).
- 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
|
Closing: the team is moving away from centralized org-level configuration in favor of per-repository self-contained setups (see triton-inference-server/server#8897 for the first decentralized implementation). Branch retained for reference. TRI-1100 |
What does the PR do?
Aligns this repository with the org-wide setup consolidated in triton-inference-server/.github:
.pre-commit-config.yaml: shared baseline hooks, conventional-commit message validation (commit-msg stage), and the centralizedadd-licensehook from the org.githubrepository (rev: v1.4.3— excludes.github/templates, never rewrites LICENSE files).conventional-prworkflow (@v1.4.3): validates the PR title against Conventional Commits (hard gate — it becomes the squash-merge commit), derives one human-readable label per distinct type found in the title and all conforming commit subjects (e.g.ci:→CI/CD,feat:→feature,fix:→fix), enforces org-wide label colors/descriptions, detects cherry-picks, and fails if no type is derivable and no type label is assigned.Repo-specific: keeps the
^src/grpc_generatedexclude and the mypy hook.Depends on triton-inference-server/.github#5 (pinned tags current:
v1.4.3— already exist, CI is green).Pros / Cons
Pros
.githubrepo) for hooks, templates, issue routing, and the PR-title workflow — one change propagates everywhere.Cons / risks
.githubrepository (tags are write-once; changes ship as a new tag + rev bump)..githubrepository to remain public.Related Issues / PRs
Related PRs:
Test plan
pre-commit validate-configpasses;pre-commit run --files <PR diff>passes locally with the centralized hooks pinned to the .github branch SHA.v1.4.3exists: the conventional-pr check validates this PR's own title and applies thecilabel.Caveats
Checklist
<commit_type>: <Title>(conventional commit)