Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: version stream #1062

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

Dentrax
Copy link
Member

@Dentrax Dentrax commented Jul 13, 2024

This PR adds a new linter to check if version-stream correctly set for the given package:

  • With a ReGeX, it checks whether package name contains version stream suffix
  • If update.github is used, it checks if the tag filter matches with version stream
  • Enforce if subpackage naming is correct and follows ${{package.name}}-xyz format

I ran the code against wolfi/os on 5ba26e2e864735d67b8e09f8896b607baad61987 and found the following issues:

wolfictl lint
2024/11/02 15:14:17 INFO Package: calico-3.29: [valid-version-stream]: subpackage calico-node-3.29 should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)
2024/11/02 15:14:17 INFO Package: cloud-provider-aws-1.31: [valid-version-stream]: package is version streamed but cloud-provider-aws=${{package.full-version}} is missing on dependencies.provides (WARNING)
2024/11/02 15:14:17 INFO Package: couchdb-3.3: [valid-version-stream]: subpackage couchdb-compat should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)
2024/11/02 15:14:17 INFO Package: gcp-compute-persistent-disk-csi-driver-1.15: [valid-version-stream]: package is version streamed but gcp-compute-persistent-disk-csi-driver=${{package.full-version}} is missing on dependencies.provides (WARNING)
2024/11/02 15:14:17 INFO Package: gitaly-17.5: [valid-version-stream]: subpackage gitaly-compat-17.5 should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)
2024/11/02 15:14:17 INFO Package: gitlab-pages-17.5: [valid-version-stream]: subpackage gitlab-pages-compat-17.5 should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)
2024/11/02 15:14:17 INFO Package: gitlab-runner-17.5: [valid-version-stream]: subpackage gitlab-runner-helper-17.5 should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)
2024/11/02 15:14:17 INFO Package: grpc-1.66: [valid-version-stream]: subpackage py3-grpcio-1.66 should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)
2024/11/02 15:14:17 INFO Package: grpc-1.67: [valid-version-stream]: subpackage py3.10-grpcio-1.67 should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)
2024/11/02 15:14:17 INFO Package: gtk-2.0: [valid-version-stream]: package is version streamed but package.version 2.24.33 starts with different than given version stream 2.0 (WARNING)
2024/11/02 15:14:17 INFO Package: ingress-nginx-controller-1.11: [valid-version-stream]: subpackage ingress-nginx-controller-compat-1.11 should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)
2024/11/02 15:14:17 INFO Package: istio-1.23: [valid-version-stream]: package is version streamed but istio=${{package.full-version}} is missing on dependencies.provides (WARNING)
2024/11/02 15:14:17 INFO Package: kafka-3.8: [valid-version-stream]: subpackage kafka-bitnami-compat-3.8 should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)
2024/11/02 15:14:17 INFO Package: kubernetes-1.31: [valid-version-stream]: subpackage kubernetes-pause-1.31 should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)
2024/11/02 15:14:17 INFO Package: kuma-2.9: [valid-version-stream]: subpackage kumactl-2.9 should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)
2024/11/02 15:14:17 INFO Package: kyverno-1.12: [valid-version-stream]: subpackage kyverno-init-container-1.12 should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)
2024/11/02 15:14:17 INFO Package: management-api-for-apache-cassandra-5.0: [valid-version-stream]: package is version streamed but package.version 0.1.87 starts with different than given version stream 5.0 (WARNING)
2024/11/02 15:14:17 INFO Package: metric-collector-for-apache-cassandra-4.1: [valid-version-stream]: package is version streamed but package.version 0.3.5 starts with different than given version stream 4.1 (WARNING)
2024/11/02 15:14:17 INFO Package: python-3.13: [valid-version-stream]: package is version streamed but python=${{package.full-version}} is missing on dependencies.provides (WARNING)
2024/11/02 15:14:17 INFO Package: rancher-charts-2.9: [valid-version-stream]: package is version streamed but package.version 0_git20241031 starts with different than given version stream 2.9 (WARNING)
2024/11/02 15:14:17 INFO Package: rancher-kontainer-driver-metadata-2.9: [valid-version-stream]: package is version streamed but package.version 0_git20241031 starts with different than given version stream 2.9 (WARNING)
2024/11/02 15:14:17 INFO Package: rancher-system-charts-2.9: [valid-version-stream]: package is version streamed but package.version 0_git20241031 starts with different than given version stream 2.9 (WARNING)
2024/11/02 15:14:17 INFO Package: spark-3.5: [valid-version-stream]: package is version streamed but spark=${{package.full-version}} is missing on dependencies.provides (WARNING)
2024/11/02 15:14:17 INFO Package: vitess-20.0: [valid-version-stream]: package is version streamed but tag filter 20.0 is mismatch on update.github (WARNING)
2024/11/02 15:14:17 INFO Package: zookeeper-3.9: [valid-version-stream]: subpackage zookeeper-bitnami-3.9-compat should be in format ${{package.name}}-XYZ-SUBPACKAGENAME for a valid version stream (WARNING)

pkg/lint/rules.go Outdated Show resolved Hide resolved
@Dentrax Dentrax force-pushed the lint-version-stream branch 3 times, most recently from 0c086a1 to 0a9d26c Compare July 22, 2024 15:33
@Dentrax Dentrax marked this pull request as ready for review July 28, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants