Moving Towards Unified Collection Testing with amazon.aws

Hi everyone!

I’m excited to share plans from the cloud content team at Red Hat about some upcoming changes to the amazon.aws collection.

Here’s a top-level summary of what’s coming:

  • Adding pre-commit hooks with prek

  • Adopting uv and uv.lock files

  • Adopting ruff

  • Improving dependency management

  • Overhauling unit and sanity tests

Motivation behind the changes

Let’s start by outlining the reasons for making these changes. The primary reason is to enhance the quality of the amazon.aws content to the benefit of both Red Hat customers who install the collection from Automation Hub and our community who can get the collection from Ansible Galaxy.

Along with that we hope to reduce some maintenance burden by streamlining our tooling. For contributors, these changes will ultimately lead to a more consistent development experience with other Ansible collections. Hopefully this will, in turn, lead to more contributions which will drive improvements and new features to the content.

These changes will lower the burden for collection maintainers, resulting in enhanced long-term support. Streamlining the collection development tools and improving CI will lead to shorter feedback cycles and quicker release times.

Additionally we want to start aligning amazon.aws with the initiative to reduce sprawl, duplication, and inconsistency with collection testing tooling. You might have seen the Unified Collection Testing Strategy posts from Daniel and the community team at Red Hat. The changes we’re announcing in this post were all inspired by that discussion. We’re hoping to validate some of those patterns in a way that ultimately contributes back to the Ansible ecosystem.

Deeper dive into what’s coming

Here’s a closer look at the changes we plan to make to amazon.aws. We’re breaking the work into two main phases. The first phase is focused on enhancing the developer toolchain. The second phase is dedicated to unit and sanity testing improvements.

Phase one: Enhancing the developer toolchain

  • Introducing pre-commit hooks to catch formatting and lint issues before they reach CI. This means faster feedback for contributors. You’ll see style or syntax problems at commit time rather than waiting for CI to fail. We’ll be using prek to manage these hooks, and we’ll update the CONTRIBUTING documentation with setup instructions.

  • Moving to uv for dependency management and introducing a committed uv.lock file. This gives contributors a single documented setup command that works from a clean checkout, replacing the current scattered pip usage. The goal is to make local development more consistent and eliminate “works on my machine” dependency issues.

  • Streamlining dependency files. Currently, the collection has overlapping requirements and constraints files. We’re looking to consolidate these into a cleaner structure with a single source of truth for project dependencies and constraints. We also plan to do things like add a CI gate for input changes and achieve better runtime vs development separation.

Phase two: Improving formatting, linting, and testing

  • Replacing multiple formatting and linting tools (black, isort, flynt, flake8) with ruff as a single entrypoint. We’ve had a ruff transition plan for a while now and have been considering this change to provide the same coverage with better performance and a simpler developer experience. To minimize disruption we plan to carry out a single mechanical reformat commit ahead of the change.

  • Moving from hand-written tox environments to tox-ansible-generated ones for unit and sanity tests. This gives us automatic test matrix generation based on supported Python and ansible-core versions along with consistent test environments between local development and CI as well as easier maintenance when new versions of ansible-core are released.

  • Introducing a streamlined three-job CI workflow for unit, sanity, and lint checks. This workflow will be driven by tox-ansible GitHub matrix generation, which reduces the manual configuration needed in CI and keeps local tox runs and CI behavior aligned.

Timeline for these changes

You can expect to see these changes being implemented over the next few weeks. We don’t have a specific deadline but we’re hoping to have everything wrapped up by the end of the year.

We have already got the ball rolling with a pull request to add pre-commit hooks. You can check that out here: ci: add prek pre-commit hooks and dedicated ansible-lint check by mandar242 · Pull Request #3107 · ansible-collections/amazon.aws · GitHub

We’ve also added a unified-testing label that we’ll add to all changes related to this effort.

Contributor impact

Some of the changes we’re working towards will require rebasing any open pull requests to pick up changes. There might be some friction when it comes to developer tooling such as adopting ruff, which might find new style issues that contributors need to address before merging.

That said, we are hopeful that the bulk of the changes will be transparent enough and don’t anticipate a lot of disruption. Although we’ll make sure to sequence the changes and communicate any significant contributor impact in advance.

Call to action: Give us feedback and get involved

As we start rolling out these changes, we’d love to hear from you, especially if you have questions or concerns. Please feel free to reply to this post or leave a comment directly in one of the related pull requests.

Likewise, if you’re a contributor to amazon.aws we’d love to know what you think about these changes. It would be greatly appreciated to hear how well (or how badly) these changes affect your workflows and overall experience contributing to the collection. As well as that, we’d welcome any suggestions for additional improvements or tweaks to make things even better.

We look forward to hearing from you!

3 Likes