You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.7 KiB

Automatically derive defaults versions from checksums (#11906) * Automatically derive defaults versions from checksums Currently, when updating checksums, we manually update the default versions. However, AFAICT, for all components where we have checksums, we're using the newest version out of those checksums. Codify this in the `_version` defaults variables definition to make the process automatic and reduce manual steps (as well as the diff size during reviews). We assume the versions are sorted, with newest first. This should be guaranteed by the pre-commit hooks. * Validate checksums are ordered by versions, newest first * Generalize render-readme-versions hook for other static files The pre-commit hook introduced a142f40e2 (Update versions in README.md with pre-commit, 2025-01-21) allow to update our README with new versions. It turns out other "static" files (== which don't interpret Ansible variables) also use the default version (in that case, our Dockefiles, but there might be others) The Dockerfile breaks if the variable they use (`kube_version`) is a Jinja template. For helping with automatic version upgrade, generalize the hook to deal with other static files, and make a template out of the Dockerfile. * Dockerfile: template kube_version with pre-commit instead of runtime * Validate all versions/checksums are strings in pre-commit All the ansible/python tooling for version is for version strings. YAML unhelpfully consider some stuff as number, so enforce this. * Stringify checksums versions
2 weeks ago
Automatically derive defaults versions from checksums (#11906) * Automatically derive defaults versions from checksums Currently, when updating checksums, we manually update the default versions. However, AFAICT, for all components where we have checksums, we're using the newest version out of those checksums. Codify this in the `_version` defaults variables definition to make the process automatic and reduce manual steps (as well as the diff size during reviews). We assume the versions are sorted, with newest first. This should be guaranteed by the pre-commit hooks. * Validate checksums are ordered by versions, newest first * Generalize render-readme-versions hook for other static files The pre-commit hook introduced a142f40e2 (Update versions in README.md with pre-commit, 2025-01-21) allow to update our README with new versions. It turns out other "static" files (== which don't interpret Ansible variables) also use the default version (in that case, our Dockefiles, but there might be others) The Dockerfile breaks if the variable they use (`kube_version`) is a Jinja template. For helping with automatic version upgrade, generalize the hook to deal with other static files, and make a template out of the Dockerfile. * Dockerfile: template kube_version with pre-commit instead of runtime * Validate all versions/checksums are strings in pre-commit All the ansible/python tooling for version is for version strings. YAML unhelpfully consider some stuff as number, so enforce this. * Stringify checksums versions
2 weeks ago
Automatically derive defaults versions from checksums (#11906) * Automatically derive defaults versions from checksums Currently, when updating checksums, we manually update the default versions. However, AFAICT, for all components where we have checksums, we're using the newest version out of those checksums. Codify this in the `_version` defaults variables definition to make the process automatic and reduce manual steps (as well as the diff size during reviews). We assume the versions are sorted, with newest first. This should be guaranteed by the pre-commit hooks. * Validate checksums are ordered by versions, newest first * Generalize render-readme-versions hook for other static files The pre-commit hook introduced a142f40e2 (Update versions in README.md with pre-commit, 2025-01-21) allow to update our README with new versions. It turns out other "static" files (== which don't interpret Ansible variables) also use the default version (in that case, our Dockefiles, but there might be others) The Dockerfile breaks if the variable they use (`kube_version`) is a Jinja template. For helping with automatic version upgrade, generalize the hook to deal with other static files, and make a template out of the Dockerfile. * Dockerfile: template kube_version with pre-commit instead of runtime * Validate all versions/checksums are strings in pre-commit All the ansible/python tooling for version is for version strings. YAML unhelpfully consider some stuff as number, so enforce this. * Stringify checksums versions
2 weeks ago
  1. ---
  2. repos:
  3. - repo: https://github.com/pre-commit/pre-commit-hooks
  4. rev: v5.0.0
  5. hooks:
  6. - id: check-added-large-files
  7. - id: check-case-conflict
  8. - id: check-executables-have-shebangs
  9. - id: check-xml
  10. - id: check-merge-conflict
  11. - id: detect-private-key
  12. - id: end-of-file-fixer
  13. - id: forbid-new-submodules
  14. - id: requirements-txt-fixer
  15. - id: trailing-whitespace
  16. - repo: https://github.com/adrienverge/yamllint.git
  17. rev: v1.35.1
  18. hooks:
  19. - id: yamllint
  20. args: [--strict]
  21. - repo: https://github.com/shellcheck-py/shellcheck-py
  22. rev: v0.10.0.1
  23. hooks:
  24. - id: shellcheck
  25. args: ["--severity=error"]
  26. exclude: "^.git"
  27. files: "\\.sh$"
  28. - repo: https://github.com/ansible/ansible-lint
  29. rev: v25.1.0
  30. hooks:
  31. - id: ansible-lint
  32. additional_dependencies:
  33. - jmespath==1.0.1
  34. - netaddr==1.3.0
  35. - distlib
  36. - repo: https://github.com/golangci/misspell
  37. rev: v0.6.0
  38. hooks:
  39. - id: misspell
  40. exclude: "OWNERS_ALIASES$"
  41. - repo: local
  42. hooks:
  43. - id: collection-build-install
  44. name: Build and install kubernetes-sigs.kubespray Ansible collection
  45. language: python
  46. additional_dependencies:
  47. - ansible-core>=2.16.4
  48. - distlib
  49. entry: tests/scripts/collection-build-install.sh
  50. pass_filenames: false
  51. - id: generate-docs-sidebar
  52. name: generate-docs-sidebar
  53. entry: scripts/gen_docs_sidebar.sh
  54. language: script
  55. pass_filenames: false
  56. - id: ci-matrix
  57. name: ci-matrix
  58. entry: tests/scripts/md-table/main.py
  59. language: python
  60. pass_filenames: false
  61. additional_dependencies:
  62. - jinja2
  63. - pathlib
  64. - pyaml
  65. - id: jinja-syntax-check
  66. name: jinja-syntax-check
  67. entry: tests/scripts/check-templates.py
  68. language: python
  69. types:
  70. - jinja
  71. additional_dependencies:
  72. - jinja2
  73. - id: propagate-ansible-variables
  74. name: Update static files referencing default kubespray values
  75. language: python
  76. additional_dependencies:
  77. - ansible-core>=2.16.4
  78. entry: scripts/propagate_ansible_variables.yml
  79. pass_filenames: false
  80. - id: check-checksums-sorted
  81. name: Check that our checksums are correctly sorted by version
  82. entry: scripts/assert-sorted-checksums.yml
  83. language: python
  84. pass_filenames: false
  85. additional_dependencies:
  86. - ansible
  87. - repo: https://github.com/markdownlint/markdownlint
  88. rev: v0.12.0
  89. hooks:
  90. - id: markdownlint
  91. exclude: "^.github|(^docs/_sidebar\\.md$)"