Skip to content

Add ansible-lint to CI#6927

Merged
millerdev merged 6 commits into
masterfrom
dm/ansible-lint
Jun 30, 2026
Merged

Add ansible-lint to CI#6927
millerdev merged 6 commits into
masterfrom
dm/ansible-lint

Conversation

@millerdev

@millerdev millerdev commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Introduces ansible-lint to commcare-cloud so playbook and role regressions are caught automatically in CI, without forcing a cleanup of the large existing backlog of lint findings. Follow-up PR(s) will fix pre-existing lint errors to pare down .ansible-lint-ignore.

Also folds the test dependency group into dev so a single sync gives developers everything.

I'm considering making this check a required pass on Github Actions before a PR can be merged. Any objections?

🐡 Review by commit.

https://dimagi.atlassian.net/browse/SAAS-19958

Environments Affected

None

Pin to 5.4.0, the last 5.x release, which supports ansible-core 2.11
(required by ansible~=4.10).
Found with simple `ansible-lint` run with no special configuration.

Syntax error in 65cf535
@millerdev millerdev requested review from AmitPhulera and gherceg June 29, 2026 20:21

@AmitPhulera AmitPhulera left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm considering making this check a required pass on Github Actions before a PR can be merged. Any objections?

No objections from my end.

Comment thread pyproject.toml

[dependency-groups]
test = [
"ansible-lint==5.4.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is pinning required because we are on a outdated ansible version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: v7 is the latest version.

Suggested change
- uses: actions/checkout@v5
- uses: actions/checkout@v7

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'll fix that as well as the one in tests.yml in a follow-up PR.

@gherceg gherceg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also no objections to blocking merges. I was going to leave comments about f-strings but given it seems src/commcare_cloud/ansible_lint.py will be short-lived anyway, it's fine. I also don't know how strongly people feel about f-strings. Other comments are also non-blocking.

Comment thread src/commcare_cloud/ansible_lint.py
Comment thread src/commcare_cloud/ansible_lint.py
@millerdev millerdev merged commit b898f70 into master Jun 30, 2026
10 checks passed
@millerdev millerdev deleted the dm/ansible-lint branch June 30, 2026 17:23
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.

3 participants