Add Github instructions and update agents#75
Conversation
Add agents and Pipelines Add missing .github folder
There was a problem hiding this comment.
Pull request overview
Adds GitHub automation and contributor guidance for this Cacti servcheck plugin repository, including a new CI workflow to run integration tests against upstream Cacti, plus Copilot/agent instruction documents and issue templates.
Changes:
- Add a GitHub Actions workflow to spin up MySQL, install Cacti + the plugin, and run a poller-based integration check across multiple PHP versions.
- Add repository-wide GitHub Copilot instructions and introduce several custom “agent” definition files.
- Add GitHub issue templates (bug/feature) plus additional instruction/agent template files.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/plugin-ci-workflow.yml | New CI workflow for plugin integration testing (Cacti checkout, MySQL service, install, poller run). |
| .github/copilot-instructions.md | Adds Copilot guidance for coding conventions, security, DB patterns, and plugin architecture. |
| .github/agents/triage_agent.md.agent.md | Adds a triage agent definition and delegation/routing rules. |
| .github/agents/php-developer.agent.md | Adds a PHP developer agent definition. |
| .github/agents/mysql-mariadb.agent.md | Adds a MySQL/MariaDB agent definition. |
| .github/agents/code-quality.agent.md | Adds a code quality specialist agent definition. |
| .github/ISSUE_TEMPLATE/feature_request.md | New feature request issue template. |
| .github/ISSUE_TEMPLATE/bug_report.md | New bug report issue template. |
| .github/ISSUE_TEMPLATE/copilot-instructions.md | Adds “AI coding instructions” content (currently syslog-focused). |
| .github/ISSUE_TEMPLATE/agents/php-developer.agent.md | Adds an agent definition file under issue templates. |
| .github/ISSUE_TEMPLATE/agents/mysql-mariadb.agent.md | Adds an agent definition file under issue templates. |
| .github/ISSUE_TEMPLATE/agents/code-quality.agent.md | Adds an agent definition file under issue templates. |
Comments suppressed due to low confidence (6)
.github/workflows/plugin-ci-workflow.yml:108
- This step writes MySQL credentials to
~/.my.cnfand then prints the file to the workflow logs. Even though these are test credentials, it’s better to avoid echoing passwords in CI logs; remove thecat ~/.my.cnf(or redact the password).
run: |
echo -e "[client]\nuser = root\npassword = cactiroot\nhost = 127.0.0.1\n" > ~/.my.cnf
cat ~/.my.cnf
- name: Initialize Cacti Database
.github/workflows/plugin-ci-workflow.yml:141
- The
config.phpgeneration pipeline includes duplicate/no-op substitutions (s/'cacti'/'cacti'/gdoes nothing, and thecactiusersubstitution appears twice). This makes the workflow harder to maintain and suggests a missing intended replacement (e.g., password). Remove the redundantsedoperations and keep only the necessary substitutions.
sed -r "s/localhost/127.0.0.1/g" | \
sed -r "s/'cacti'/'cacti'/g" | \
sed -r "s/'cactiuser'/'cactiuser'/g" | \
sed -r "s/'cactiuser'/'cactiuser'/g" > ${{ github.workspace }}/cacti/include/config.php
sudo chmod 664 ${{ github.workspace }}/cacti/include/config.php
.github/workflows/plugin-ci-workflow.yml:113
MYSQL_AUTH_USRis set to--defaults-file=~/.my.cnf, but~will not be expanded when it comes from a variable expansion in bash. This can causemysqlto miss the defaults file and fail authentication. Use an explicit path like$HOME/.my.cnf(or inline the argument without relying on~inside an env var).
MYSQL_AUTH_USR: '--defaults-file=~/.my.cnf'
run: |
mysql $MYSQL_AUTH_USR -e 'CREATE DATABASE IF NOT EXISTS cacti;'
mysql $MYSQL_AUTH_USR -e "CREATE USER IF NOT EXISTS 'cactiuser'@'localhost' IDENTIFIED BY 'cactiuser';"
.github/workflows/plugin-ci-workflow.yml:116
- Database user/grants are created for
'cactiuser'@'localhost', but the workflow connects viahost = 127.0.0.1(and config.php is rewritten to 127.0.0.1). MySQL treatslocalhostand127.0.0.1as different hosts, so authentication can fail. Create/grant the user for127.0.0.1(or%) to match the connection host.
mysql $MYSQL_AUTH_USR -e "CREATE USER IF NOT EXISTS 'cactiuser'@'localhost' IDENTIFIED BY 'cactiuser';"
mysql $MYSQL_AUTH_USR -e "GRANT ALL PRIVILEGES ON cacti.* TO 'cactiuser'@'localhost';"
mysql $MYSQL_AUTH_USR -e "GRANT SELECT ON mysql.time_zone_name TO 'cactiuser'@'localhost';"
mysql $MYSQL_AUTH_USR -e "FLUSH PRIVILEGES;"
.github/workflows/plugin-ci-workflow.yml:67
- Checkout of
Cacti/cactiis not pinned to a ref/tag/sha. That makes CI non-deterministic (upstream changes can break this plugin’s CI without any change in this repo). Consider pinning to a known branch/tag (e.g.,1.2.xor a specific release) that matches the supported Cacti version range.
- name: Checkout Cacti
uses: actions/checkout@v4
with:
repository: Cacti/cacti
path: cacti
.github/workflows/plugin-ci-workflow.yml:58
- The MySQL service healthcheck uses
mysqladmin pingwithout credentials. WithMYSQL_ROOT_PASSWORDset, this commonly fails and the service may never become healthy, causing the job to fail before tests run. Update the health command to authenticate (or use a healthcheck that doesn’t require auth).
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@bmfmancini , you removed all the code quality checks. Fix that and it's ready to go. |
|
What the ? Yea did not mean to do that |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: bmfmancini <13388748+bmfmancini@users.noreply.github.com>
[WIP] Rename triage_agent.md.agent.md to triage_agent.agent.md
No description provided.