Skip to content

ci: repair the integration workflow - #329

Open
somethingwithproof wants to merge 1 commit into
Cacti:developfrom
somethingwithproof:ci/fix-integration-workflow
Open

ci: repair the integration workflow#329
somethingwithproof wants to merge 1 commit into
Cacti:developfrom
somethingwithproof:ci/fix-integration-workflow

Conversation

@somethingwithproof

Copy link
Copy Markdown
Member

Four defects in the integration workflow, found while making the same repair across plugins.

MySQL never authenticated. MYSQL_AUTH_USR: '--defaults-file=~/.my.cnf' set
in env: keeps the tilde literal, because tilde expansion happens before variable
expansion and a tilde arriving from a variable is not expanded again. Verified in a
Linux container:

from env:  [--defaults-file=~/.my.cnf]
arg seen:  [--defaults-file=~/.my.cnf]
inline:    [--defaults-file=/home/cacti/.my.cnf]

Every mysql call in the step was looking for a directory named ~. Assigning the
variable inside run: with $HOME expands it.

shellcheck SC2227. find . -exec php -l {} 2>&1 \; binds the redirect to
find rather than to php, which actionlint rejects. It is not a correctness bug:
php -l writes parse errors to stdout, so the check does catch a broken file either
way. Moving the redirect to the end clears the lint.

The Cacti checkout floated. repository: Cacti/cacti with no ref: takes
the default branch, so the plugin was tested against whatever core happened to be
that day. Pinned to release/1.2.31.

The Apache PHP module was version-suffixed. libapache2-mod-php${{ matrix.php }}
names a package the Ubuntu archive does not carry for every matrix entry. The
unversioned libapache2-mod-php pulls whichever module matches the runner. Note
#327 removes the package outright instead; either resolves the install step, and
the workflow configures Apache but never issues an HTTP request, so both work.

Variables are quoted at the point of use and actionlint passes.

No plugin code is touched.

Three defects, all failing open or failing at setup:

- the plugin syntax check redirected find's own output rather than php's, so
  PHP errors never reached the grep testing for them; the step could not fail
- MYSQL_AUTH_USR carried a literal tilde, because parameter expansion happens
  after tilde expansion, so MySQL was handed a path it could not resolve
- the Cacti checkout took the default branch, which is 1.3 in development and
  whose CLI installer currently fatals with an undefined __()

plugin_syslog additionally installed libapache2-mod-php${{ matrix.php }},
which Ubuntu does not package, so apt exited 100 before Cacti was reached.

Verified with actionlint, which is clean on the result.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Copilot AI lite review requested due to automatic review settings August 17, 2026 07:23

Copilot AI 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.

Pull request overview

This PR repairs the plugin’s GitHub Actions integration workflow to make it deterministic and fix several workflow/runtime issues encountered across plugins, without changing any plugin PHP code.

Changes:

  • Pin the Cacti core checkout to release/1.2.31 to avoid testing against a moving default branch.
  • Fix find -exec php -l redirection placement so actionlint/shellcheck no longer flags SC2227.
  • Fix MySQL authentication by constructing --defaults-file using $HOME inside the run: block (avoids literal ~), and remove the PHP-version-suffixed Apache module install in favor of libapache2-mod-php.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

somethingwithproof added a commit that referenced this pull request Aug 17, 2026
# Conflicts:
#	.github/workflows/plugin-ci-workflow.yml
somethingwithproof added a commit to somethingwithproof/plugin_syslog that referenced this pull request Aug 17, 2026
# Conflicts:
#	.github/workflows/plugin-ci-workflow.yml
somethingwithproof added a commit to somethingwithproof/plugin_syslog that referenced this pull request Aug 17, 2026
# Conflicts:
#	.github/workflows/plugin-ci-workflow.yml
somethingwithproof added a commit to somethingwithproof/plugin_syslog that referenced this pull request Aug 17, 2026
# Conflicts:
#	.github/workflows/plugin-ci-workflow.yml
somethingwithproof added a commit to somethingwithproof/plugin_syslog that referenced this pull request Aug 17, 2026
# Conflicts:
#	.github/workflows/plugin-ci-workflow.yml
somethingwithproof added a commit to somethingwithproof/plugin_syslog that referenced this pull request Aug 17, 2026
# Conflicts:
#	.github/workflows/plugin-ci-workflow.yml
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.

2 participants