Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

lint accepts modelith-ref-type on a GitHub-origin provenance header

Đang mở Phù hợp với người mới
#54 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
86/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu trong internal/provenance/provenance.go tại Header.validate, sau đó đọc test bên cạnh TestADR_0019_RefTypeIsRecordedOnlyWhereItIsNeeded. Tái hiện bằng modelith lint trên header có nguồn gốc từ GitHub, và thêm một test cho thấy modelith-ref-type tạo ra một provenance finding cho các nguồn gốc GitHub, đồng thời vẫn hợp lệ đối với trường hợp Azure DevOps đã được tài liệu hóa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Follow-up from the review of #52.

ADR-0019 and docs/10-vendoring.md both say the modelith-ref-type provenance key applies only to Azure DevOps and is omitted for GitHub. Lint doesn't enforce that. Header.validate (internal/provenance/provenance.go) checks only that the value is one of branch/tag/commit, not which origin it appears on.

Repro (at 52a5544)

Take a GitHub-origin vendored copy and add the key. Here the recorded type disagrees with the ref:

# modelith-vendored: DO NOT EDIT — this file is a copy. Change it at its origin.
# modelith-fetch: git
# modelith-origin: https://github.com/acme/billing
# modelith-path: docs/payments.modelith.yaml
# modelith-ref: main
# modelith-ref-type: tag
# modelith-commit: 4f2c1e9c8b3ad0e5f71b2c9a6d4e8f30ab5c7d21
# modelith-imported: 2026-09-23
# modelith-digest: sha256:…
modelith lint gh-reftype.modelith.yaml
# 0 error(s), 0 warning(s)

deps update then drops the key without saying so (recordedRefType returns "" for GitHub).

Expected

Pre-release, the header uses closed sets (compare unknown fetch: methods), so this should be a provenance finding along the lines of ref-type is only recorded for dev.azure.com origins. Pin it with a test next to TestADR_0019_RefTypeIsRecordedOnlyWhereItIsNeeded.

Ngôn ngữ chính
Go
Star
34
Fork
5
Merge trung bình
5 giờ 7 phút
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của stacklok/modelith

Tất cả issue của stacklok/modelith

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.