-
Notifications
You must be signed in to change notification settings - Fork 5
Development
DenAV edited this page Feb 22, 2026
·
1 revision
feature/fix-xxx → develop → main → release (tag vX.Y.Z)
↑ ↑
lint + unit lint + unit + molecule
| Branch | Purpose |
|---|---|
feature/* or fix/*
|
New features or bug fixes |
develop |
Integration branch — collects all changes |
main |
Stable release branch |
- Create a branch from
develop:git checkout -b fix/issue-42 - Make changes, write tests
- Push and create PR to
develop - CI runs: ansible-lint + flake8 + syntax-check + pytest
- After review — squash merge to
develop - When
developis stable — PR tomain - CI runs: lint + unit tests + Molecule integration tests
- After merge to
main— create tag and GitHub Release
Triggers on push/PR to develop:
| Job | What it does |
|---|---|
| Lint |
ansible-lint . + flake8 library/
|
| Syntax Check | ansible-playbook --syntax-check |
| Unit Tests | pytest tests/ -v |
Triggers on PR to main:
| Job | What it does |
|---|---|
| Molecule | Starts NPM in Docker, runs full role convergence, verifies via API |
pip install -r requirements-dev.txtpytest tests/ -v --tb=shortTests mock the requests library — no running NPM instance needed. Works on both Linux and Windows.
# Ansible lint
ansible-lint .
# Python lint
flake8 library/molecule testThis will:
- Start NPM container (ports 3080/3081/3443)
- Wait for API readiness
- Run the role (create a test proxy host)
- Verify the proxy host exists via API
- Destroy the container
tests/
└── test_npm_proxy.py # 22 unit tests
├── TestBuildUrl — URL construction for each action
├── TestHttpRequest — HTTP method dispatch, timeout, error handling
├── TestSearchProxyHost — Search logic (found / not found)
├── TestCreateProxyHost — Create logic (new / exists / ssl / error)
└── TestDeleteProxyHost — Delete logic (with cert / without / not found)
molecule/default/
├── molecule.yml # Docker driver config
├── converge.yml # Role execution
└── verify.yml # API assertions
-
Python: flake8 with
max-line-length = 120, E402 ignored for Ansible modules (see.flake8) - Ansible: ansible-lint default rules
-
Commits: Conventional Commits —
feat(),fix(),docs(),test()
-
Never commit
api_secret.yml— it's in.gitignore - Use
ansible-vaultfor encryption - Module parameter
tokenhasno_log: Trueinargument_spec
Use labels for priority:
-
priority: P0(red) — Critical, fix immediately -
priority: P1(orange) — Important, next sprint -
priority: P2(yellow) — Long-term improvements