diff --git a/.coderabbit.yaml b/.coderabbit.yaml index b0d2d9a..dbc402c 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -39,12 +39,14 @@ reviews: mode: "warning" requirements: | PR title MUST follow Conventional Commits format: - - Format: : or !: for breaking changes - - Valid types: Refer to the 'type-enum' rule in .commitlintrc.js file for the complete list of allowed types + - Format: : + - Valid types: Refer to https://github.com/linux-system-roles/auto-maintenance/blob/main/pr_title_lint.py#L23 - Examples: - "feat: Add backup functionality" - "fix: Correct OSTree package installation" - "fix!: Remove deprecated variable (breaking change)" + - "chore(formatting): Fix indentation in my_module.py" + - "refactor(python)!: Use new python library thispy which has breaking api changes" custom_checks: - mode: "warning" @@ -55,6 +57,8 @@ reviews: - Must contain "Reason:" section explaining why the change was needed - Must contain "Result:" section describing the outcome or impact - Can contain optional "Issue Tracker Tickets (Jira or BZ if any):" section + - Must contain "Signed-off-by:" section with your name and email address - use git commit -s + - Can contain optional "Assisted-by:" section with name of the AI coding assistant and models used Example: ``` @@ -65,6 +69,34 @@ reviews: Result: Users can now set network_secure_logging: false for debugging while maintaining secure defaults. Issue Tracker Tickets (Jira or BZ if any): RHEL-12345 + + Signed-off-by: John Doe john.doe@example.com + + Assisted-by: Fish 4.3 using model Swim 6.2 + ``` + + For PRs that are bug fixes, you can use the following template: + - Must contain "Cause:" section explaining the root cause of the bug + - Must contain "Consequences:" section explaining the impact of the bug and how it appears to users + - Must contain "Fix:" section explaining the fix for the bug and how it fixes the bug + - Must contain "Result:" section describing the outcome or impact of the fix + - Can contain optional "Issue Tracker Tickets (Jira or BZ if any):" section + - Must contain "Signed-off-by:" section with your name and email address - use git commit -s + - Can contain optional "Assisted-by:" section with name of the AI coding assistant and models used + + Example: + ``` + Cause: The variable rolename_user_name was being checked for a `none` value but was not being checked for string length greater than 0 if a string. + + Consequences: The role allowed empty user names to be configured which caused the daemon to report "User not found". + + Fix: The variable rolename_user_name is now checked for string length if not `none`, and will report an error in that case if the length is 0. + + Result: The role will not allow the user to provide an empty user name and will report an error if the rolename_user_name length is 0. + + Signed-off-by: John Doe john.doe@example.com + + Assisted-by: Fish 4.3 using model Swim 6.2 ``` path_instructions: @@ -180,6 +212,8 @@ reviews: - Tests should verify both success and failure scenarios - Use assert module to verify expected state after role execution - Include cleanup tasks to ensure tests are rerunnable + - Tests should be run in a block with an always section that runs the test cleanup to ensure that the cleanup is always run. + - The cleanup tasks should be tagged with `tests::cleanup` so that the cleanup can be skipped for debug purposes. - Tests should be idempotent - running twice should not cause failures - Example verification: ```yaml diff --git a/.commitlintrc.js b/.commitlintrc.js deleted file mode 100644 index f8a39ba..0000000 --- a/.commitlintrc.js +++ /dev/null @@ -1,141 +0,0 @@ -module.exports = { - parserPreset: 'conventional-changelog-conventionalcommits', - rules: { - 'body-leading-blank': [1, 'always'], - 'body-max-line-length': [2, 'always', 100], - 'footer-leading-blank': [1, 'always'], - 'footer-max-line-length': [2, 'always', 100], - 'header-max-length': [2, 'always', 100], - 'subject-case': [ - 2, - 'never', - ['start-case', 'pascal-case', 'upper-case'], - ], - 'subject-empty': [2, 'never'], - 'subject-full-stop': [2, 'never', '.'], - 'type-case': [2, 'always', 'lower-case'], - 'type-empty': [2, 'never'], - 'type-enum': [ - 2, - 'always', - [ - 'build', - 'chore', - 'ci', - 'docs', - 'feat', - 'fix', - 'perf', - 'refactor', - 'revert', - 'style', - 'test', - 'tests', - ], - ], - }, - prompt: { - questions: { - type: { - description: "Select the type of change that you're committing", - enum: { - feat: { - description: 'A new feature', - title: 'Features', - emoji: '✨', - }, - fix: { - description: 'A bug fix', - title: 'Bug Fixes', - emoji: '🐛', - }, - docs: { - description: 'Documentation only changes', - title: 'Documentation', - emoji: '📚', - }, - style: { - description: - 'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)', - title: 'Styles', - emoji: '💎', - }, - refactor: { - description: - 'A code change that neither fixes a bug nor adds a feature', - title: 'Code Refactoring', - emoji: '📦', - }, - perf: { - description: 'A code change that improves performance', - title: 'Performance Improvements', - emoji: '🚀', - }, - test: { - description: 'Adding missing tests or correcting existing tests', - title: 'Tests', - emoji: '🚨', - }, - tests: { - description: 'Adding missing tests or correcting existing tests', - title: 'Tests', - emoji: '🚨', - }, - build: { - description: - 'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)', - title: 'Builds', - emoji: '🛠', - }, - ci: { - description: - 'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)', - title: 'Continuous Integrations', - emoji: '⚙️', - }, - chore: { - description: "Other changes that don't modify src or test files", - title: 'Chores', - emoji: '♻️', - }, - revert: { - description: 'Reverts a previous commit', - title: 'Reverts', - emoji: '🗑', - }, - }, - }, - scope: { - description: - 'What is the scope of this change (e.g. component or file name)', - }, - subject: { - description: - 'Write a short, imperative tense description of the change', - }, - body: { - description: 'Provide a longer description of the change', - }, - isBreaking: { - description: 'Are there any breaking changes?', - }, - breakingBody: { - description: - 'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself', - }, - breaking: { - description: 'Describe the breaking changes', - }, - isIssueAffected: { - description: 'Does this change affect any open issues?', - }, - issuesBody: { - description: - 'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself', - }, - issues: { - description: 'Add issue references (e.g. "fix #123", "re #123".)', - }, - }, - }, -}; diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index 11b40a0..2ac0ffe 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -39,12 +39,12 @@ jobs: sudo apt install -y git - name: Checkout repo - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Install tox, tox-lsr run: | set -euxo pipefail - pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.18.1" + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.20.1" - name: Set up Python uses: actions/setup-python@v6 diff --git a/.github/workflows/ansible-managed-var-comment.yml b/.github/workflows/ansible-managed-var-comment.yml index 026e582..a2127cd 100644 --- a/.github/workflows/ansible-managed-var-comment.yml +++ b/.github/workflows/ansible-managed-var-comment.yml @@ -28,12 +28,12 @@ jobs: sudo apt install -y git - name: Checkout repo - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Install tox, tox-lsr run: | set -euxo pipefail - pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.18.1" + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.20.1" - name: Run ansible-plugin-scan run: | diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index 37ad46e..03b3b03 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -42,12 +42,12 @@ jobs: sudo apt install -y git - name: Checkout repo - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Install tox, tox-lsr run: | set -euxo pipefail - pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.18.1" + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.20.1" - name: Set up Python uses: actions/setup-python@v6 diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index c373e94..eac3504 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -25,7 +25,7 @@ jobs: sudo apt install -y git - name: Check out code - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: fetch-depth: 0 - name: Ensure the docs branch @@ -48,12 +48,12 @@ jobs: fi - name: Checkout the docs branch - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: ref: docs - name: Fetch README.md and .pandoc_template.html5 template from the workflow branch - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: sparse-checkout: | README.md diff --git a/.github/workflows/changelog_to_tag.yml b/.github/workflows/changelog_to_tag.yml index 633e495..7918402 100644 --- a/.github/workflows/changelog_to_tag.yml +++ b/.github/workflows/changelog_to_tag.yml @@ -22,7 +22,7 @@ jobs: sudo apt install -y git - name: checkout PR - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Get tag and message from the latest CHANGELOG.md commit id: tag diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ee1d64b..f047ea6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -34,7 +34,7 @@ jobs: sudo apt update sudo apt install -y git - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Initialize CodeQL uses: github/codeql-action/init@v4 diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 764bd71..45c1913 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Codespell uses: codespell-project/actions-codespell@v2 diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 9f0266b..8956014 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -28,7 +28,7 @@ jobs: sudo apt install -y git - name: Check out code - uses: actions/checkout@v6 + uses: actions/checkout@v7 # CHANGELOG.md is generated automatically from PR titles and descriptions # It might have issues but they are not critical diff --git a/.github/workflows/pr-title-lint.yml b/.github/workflows/pr-title-lint.yml index 079bfb6..a1eeabc 100644 --- a/.github/workflows/pr-title-lint.yml +++ b/.github/workflows/pr-title-lint.yml @@ -18,15 +18,15 @@ jobs: commit-checks: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: fetch-depth: 0 - - name: Install conventional-commit linter - run: npm install @commitlint/config-conventional @commitlint/cli + - name: Install pr_title_lint.py + run: curl -o pr_title_lint.py https://raw.githubusercontent.com/linux-system-roles/auto-maintenance/main/pr_title_lint.py - - name: Run commitlint on PR title + - name: Run pr_title_lint.py on PR title env: PR_TITLE: ${{ github.event.pull_request.title }} # Echo from env variable to avoid bash errors with extra characters - run: echo "$PR_TITLE" | npx commitlint --verbose + run: python3 pr_title_lint.py "${PR_TITLE}" diff --git a/.github/workflows/python-unit-test.yml b/.github/workflows/python-unit-test.yml index 798066c..90abbb6 100644 --- a/.github/workflows/python-unit-test.yml +++ b/.github/workflows/python-unit-test.yml @@ -43,7 +43,7 @@ jobs: sudo apt install -y git - name: checkout PR - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Set up Python 2.7 if: ${{ matrix.pyver_os.ver == '2.7' }} @@ -70,7 +70,7 @@ jobs: tox=tox virtualenv=virtualenv fi - pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/tox-lsr@3.18.1" + pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/tox-lsr@3.20.1" # If you have additional OS dependency packages e.g. libcairo2-dev # then put them in .github/config/ubuntu-requirements.txt, one # package per line. @@ -92,4 +92,4 @@ jobs: TOXENV="$toxenvs" lsr_ci_runtox - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v6 + uses: codecov/codecov-action@v7 diff --git a/.github/workflows/qemu-kvm-integration-tests.yml b/.github/workflows/qemu-kvm-integration-tests.yml index d25baef..318b7e4 100644 --- a/.github/workflows/qemu-kvm-integration-tests.yml +++ b/.github/workflows/qemu-kvm-integration-tests.yml @@ -30,8 +30,8 @@ jobs: # QEMU - { image: "centos-9", env: "qemu-ansible-core-2-16" } - { image: "centos-10", env: "qemu-ansible-core-2-17" } - - { image: "fedora-42", env: "qemu-ansible-core-2-19" } - { image: "fedora-43", env: "qemu-ansible-core-2-20" } + - { image: "fedora-44", env: "qemu-ansible-core-2-21" } - { image: "leap-15.6", env: "qemu-ansible-core-2-18" } # container @@ -40,10 +40,11 @@ jobs: # broken on non-running dbus # - { image: "centos-10", env: "container-ansible-core-2-17" } - { image: "centos-10-bootc", env: "container-ansible-core-2-17" } - - { image: "fedora-42", env: "container-ansible-core-2-17" } - { image: "fedora-43", env: "container-ansible-core-2-20" } - - { image: "fedora-42-bootc", env: "container-ansible-core-2-17" } + - { image: "fedora-44", env: "container-ansible-core-2-21" } - { image: "fedora-43-bootc", env: "container-ansible-core-2-20" } + # ansible-core 2.21 cannot enable services using service module in bootc images + - { image: "fedora-44-bootc", env: "container-ansible-core-2-20" } env: TOX_ARGS: "--skip-tags tests::infiniband,tests::nvme,tests::scsi" @@ -51,7 +52,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Check if platform is supported id: check_platform @@ -110,29 +111,24 @@ jobs: python3 -m pip install --upgrade pip sudo apt update sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86 - pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.18.1" + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.20.1" - # HACK: Drop this when moving this workflow to 26.04 LTS - - name: Update podman to 5.x for compatibility with bootc-image-builder's podman 5 - if: steps.check_platform.outputs.supported && endsWith(matrix.scenario.image, '-bootc') + - name: Check for podman version 5 or higher + id: check_podman_version + if: steps.check_platform.outputs.supported run: | - sed 's/noble/plucky/g' /etc/apt/sources.list.d/ubuntu.sources | sudo tee /etc/apt/sources.list.d/plucky.sources >/dev/null - cat </dev/null - Package: podman buildah golang-github-containers-common crun libgpgme11t64 libgpg-error0 golang-github-containers-image catatonit conmon containers-storage - Pin: release n=plucky - Pin-Priority: 991 + podman_version=$(podman version -f '{{.Client.Version}}') + podman_major_version="${podman_version%%.*}" + echo "Podman version: $podman_version" + if [ "$podman_major_version" -lt 5 ]; then + echo "need_podman_update=1" >> "$GITHUB_OUTPUT" + else + echo "need_podman_update=0" >> "$GITHUB_OUTPUT" + fi - Package: libsubid4 netavark passt aardvark-dns containernetworking-plugins libslirp0 slirp4netns - Pin: release n=plucky - Pin-Priority: 991 - - Package: * - Pin: release n=plucky - Pin-Priority: 400 - EOF - - sudo apt update - sudo apt install -y podman crun conmon containers-storage + - name: Ensure use of podman 5 + if: steps.check_platform.outputs.supported && steps.check_podman_version.outputs.need_podman_update == 1 + uses: redhat-actions/podman-install@main - name: Configure tox-lsr if: steps.check_platform.outputs.supported diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index baea60c..fee85d9 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -30,7 +30,7 @@ jobs: sudo apt install -y git - name: Checkout repo - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Run ShellCheck id: shellcheck_id diff --git a/.github/workflows/test_converting_readme.yml b/.github/workflows/test_converting_readme.yml index 679e955..696275f 100644 --- a/.github/workflows/test_converting_readme.yml +++ b/.github/workflows/test_converting_readme.yml @@ -29,7 +29,7 @@ jobs: sudo apt install -y git - name: Check out code - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Remove badges from README.md prior to converting to HTML run: sed -i '1,8 {/^\[\!.*actions\/workflows/d}' README.md diff --git a/.github/workflows/tft.yml b/.github/workflows/tft.yml index 563674e..1a7fc68 100644 --- a/.github/workflows/tft.yml +++ b/.github/workflows/tft.yml @@ -36,7 +36,7 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} - name: Checkout repo - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Get head sha of the PR id: head_sha @@ -49,7 +49,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Checkout PR - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: ref: ${{ steps.head_sha.outputs.head_sha }} @@ -72,8 +72,8 @@ jobs: meta_main=meta/main.yml # All Fedora are supported, add latest Fedora versions to supported_platforms if yq '.galaxy_info.galaxy_tags[]' "$meta_main" | grep -qi fedora$; then - supported_platforms+=" Fedora-42" supported_platforms+=" Fedora-43" + supported_platforms+=" Fedora-44" fi # Specific Fedora versions supported if yq '.galaxy_info.galaxy_tags[]' "$meta_main" | grep -qiP 'fedora\d+$'; then @@ -99,10 +99,10 @@ jobs: matrix: include: # Ensure ansible version is a string! - - platform: Fedora-42 - ansible_version: "2.19" - platform: Fedora-43 ansible_version: "2.20" + - platform: Fedora-44 + ansible_version: "2.21" - platform: CentOS-7-latest ansible_version: "2.9" - platform: CentOS-Stream-8 diff --git a/.github/workflows/weekly_ci.yml b/.github/workflows/weekly_ci.yml index 8be7b8e..758ad93 100644 --- a/.github/workflows/weekly_ci.yml +++ b/.github/workflows/weekly_ci.yml @@ -30,7 +30,7 @@ jobs: sudo apt install -y git - name: Checkout latest code - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: fetch-depth: 0 - name: Create or rebase commit, add dump_packages callback diff --git a/.github/workflows/woke.yml b/.github/workflows/woke.yml index 471e7b4..7f34776 100644 --- a/.github/workflows/woke.yml +++ b/.github/workflows/woke.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Run lsr-woke-action # Originally, uses: get-woke/woke-action@v0