Skip to content

refactor(ci): [develop] restructure maintenance tools with behavior regression coverage - #8305

Open
somethingwithproof wants to merge 5 commits into
Cacti:developfrom
somethingwithproof:fix/develop-sonar-python-tools
Open

somethingwithproof wants to merge 5 commits into
Cacti:developfrom
somethingwithproof:fix/develop-sonar-python-tools

Conversation

@somethingwithproof

@somethingwithproof somethingwithproof commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

This change makes CI maintenance tools easier to follow and fixes defects in translation validation. It breaks complex workflow, changelog and contributor processing into tested helpers and corrects handling of option-like filenames and stored translation entries. This improves the reliability of checks and their error reporting while preserving the established command behavior.

Implementation details

Refactor the workflow policy, changelog validation/folding and contributor refresh tools into smaller helpers to resolve validated complexity and successful-exit findings. Preserve diagnostic ordering, changelog insertion order, contributor aliases, review pagination and command exit behavior. The contributor-path regex remains unchanged here; #8294 owns that change.

Validation: all 18 behavior contracts pass on both the original upstream scripts and the refactored versions. Diagnostics for every repository workflow are identical. Tests cover invalid policy and fragments, write/dry-run ordering, aliases, deleted users, bot exclusion, pagination and exception propagation without external API calls. Measured combined line and branch coverage is 85%, not complete coverage.

The existing policy workflow runs these regressions. PHP-CS-Fixer, PHPStan level 8, actionlint, workflow policy and changelog validation passed. CI and cross-PR merge results must be evaluated against the current head; earlier audit snapshots are not asserted for later updates.

Release notes are consolidated in #8320. Review and merge this child before that final documentation PR.

Follow-up validation: reproduced option-like .po filenames being interpreted as msgfmt options and parsed entries being reset after storage on develop; this validator is absent from 1.2.x. Add the -- option terminator, preserve each entry, and run four additional regressions in the policy job with GNU gettext installed. The new suite fails against the original validator and passes after both fixes, covering option-like, spaced and absolute paths, malformed catalogs, placeholder mismatch, and retained plural forms/flags. All 18 existing maintenance tests, PHP-CS-Fixer, PHPStan level 8, actionlint and workflow policy checks pass locally. The 85% coverage figure above applies to the original maintenance-tool suite; coverage of this expanded scope has not been measured.

Merge validation: the PO regressions run in their own CI step to preserve #8294's independent binary-only dependency install change. Git merge-tree simulations of current head 9bb7be3 against all 19 other develop child heads completed without conflicts; snapshot: 2026-10-12 UTC. These checks verify mergeability, not runtime behavior of a merged stack.

Revision and checks

Description scope: target develop, 8 changed files, head 67d6c2a5d. Checked 2026-10-23 03:06:04 UTC.

GitHub check snapshot: 2 passed. Local test figures and earlier CI runs above are recorded evidence for their stated revisions and environments; they do not assert that every check passes at this head.

@TheWitness TheWitness 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.

You are dropping something in the Cacti scripts directory. Not good that. Write this shit in PHP ;) Sean would argue with me. But yea... kidding.

@somethingwithproof somethingwithproof changed the title Refactor CI maintenance tools with behavior regression coverage refactor(ci): [develop] restructure maintenance tools with behavior regression coverage Oct 12, 2026
bmfmancini
bmfmancini previously approved these changes Oct 12, 2026
@somethingwithproof

Copy link
Copy Markdown
Member Author

This does not add a Python script to Cacti’s runtime scripts directory. The existing PO validator has two small fixes; the remaining Python changes are GitHub maintenance tools and their tests. All 22 tooling/PO tests pass. The branch is updated against develop and ready for another look.

@TheWitness TheWitness 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.

Script in incorrect directory.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@somethingwithproof
somethingwithproof force-pushed the fix/develop-sonar-python-tools branch 2 times, most recently from 18c9b26 to 4e95858 Compare October 17, 2026 08:33
@somethingwithproof
somethingwithproof requested review from TheWitness and removed request for cigamit October 17, 2026 18:05
@somethingwithproof

Copy link
Copy Markdown
Member Author

The PO validator now lives at tests/tools/validate_cacti_po.py; its test and workflow references use that path. The 18 maintenance-tool tests and four PO-validator tests pass at 4e95858. All current checks pass. Ready for another look at the directory-placement request.

@github-actions
github-actions Bot force-pushed the fix/develop-sonar-python-tools branch 3 times, most recently from db92743 to 24c7880 Compare October 20, 2026 08:53
@somethingwithproof somethingwithproof added type:bug Namespaced Cacti workflow label github_actions Pull requests that update GitHub Actions code release:1.3 Namespaced Cacti workflow label labels Oct 20, 2026
@somethingwithproof

Copy link
Copy Markdown
Member Author

The directory fix is present at 24c7880e73fc697bb2e785c2d64993dbad8602b6: the PO validator and its references use tests/tools/validate_cacti_po.py. All 40 reported checks have completed without failures. Ready for re-review of the placement request.

@github-actions
github-actions Bot force-pushed the fix/develop-sonar-python-tools branch from 24c7880 to 68620fa Compare October 20, 2026 20:49
@somethingwithproof

Copy link
Copy Markdown
Member Author

The directory request is addressed at 68620fa: the validator is in tests/tools/validate_cacti_po.py, and the workflow and tests use that path. All 18 maintenance-tool tests and 4 PO-validator tests pass locally with Python 3.12.12 and GNU gettext. Current-head CI is running. @TheWitness, please re-review the directory change.

@github-actions
github-actions Bot force-pushed the fix/develop-sonar-python-tools branch 2 times, most recently from a0e8218 to 67d6c2a Compare October 22, 2026 20:48
Comment thread tests/tools/validate_cacti_po.py Resolved
@somethingwithproof
somethingwithproof force-pushed the fix/develop-sonar-python-tools branch from 67d6c2a to e0576fe Compare October 24, 2026 06:30
@github-actions
github-actions Bot force-pushed the fix/develop-sonar-python-tools branch 2 times, most recently from 1508247 to afd6277 Compare October 28, 2026 20:47
@somethingwithproof
somethingwithproof force-pushed the fix/develop-sonar-python-tools branch 2 times, most recently from 836e266 to 1d4bd9d Compare November 9, 2026 05:23
@github-actions
github-actions Bot force-pushed the fix/develop-sonar-python-tools branch 4 times, most recently from edac1c9 to 201ff05 Compare November 11, 2026 21:11
@somethingwithproof somethingwithproof added this to the v1.3.0 milestone Nov 13, 2026
@somethingwithproof
somethingwithproof force-pushed the fix/develop-sonar-python-tools branch from 201ff05 to 64c33c6 Compare November 17, 2026 22:10
@somethingwithproof

Copy link
Copy Markdown
Member Author

Script in incorrect directory

Moved: the validator now lives at tests/tools/validate_cacti_po.py, next to audit_po.py, and nothing references the old scripts/ path. The latest commit, d1cd8e9, only restores four explanatory comments the refactor had dropped. The 18 maintenance-tool tests and the 4 PO-validator tests pass. Could you take another look?

@github-actions
github-actions Bot force-pushed the fix/develop-sonar-python-tools branch 2 times, most recently from 262dd76 to 89cdeb8 Compare November 20, 2026 08:52
@somethingwithproof
somethingwithproof force-pushed the fix/develop-sonar-python-tools branch from 89cdeb8 to aecd77d Compare November 25, 2026 07:51
@github-actions
github-actions Bot force-pushed the fix/develop-sonar-python-tools branch from aecd77d to e650d0c Compare November 25, 2026 20:51
…egression coverage

Splits the changelog, workflow-policy and contributor helpers into smaller functions with regression tests, fixes two PO validator edge cases, and moves the validator from scripts/ to tests/tools so no Python ships in the runtime scripts directory.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The workflow policy job installed gettext from apt just for this test, so
an apt mirror outage failed the policy gate. The develop gettext job
already installs msgfmt and runs on every develop pull request.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The helper extraction removed comments that explain why the alias merge
copies activity, why a failed CHANGELOG diff is reported, that reusable
workflow calls are pinned at job level, and that the privileged checkout
lint does not inspect run steps.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@github-actions
github-actions Bot force-pushed the fix/develop-sonar-python-tools branch from e650d0c to da6067d Compare November 26, 2026 08:52
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code release:1.3 Namespaced Cacti workflow label type:bug Namespaced Cacti workflow label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants