Skip to content

Add Github instructions and update agents#75

Merged
TheWitness merged 12 commits intoCacti:mainfrom
bmfmancini:main
Feb 14, 2026
Merged

Add Github instructions and update agents#75
TheWitness merged 12 commits intoCacti:mainfrom
bmfmancini:main

Conversation

@bmfmancini
Copy link
Member

No description provided.

Add agents and Pipelines
Add missing .github folder
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.cnf and 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 the cat ~/.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.php generation pipeline includes duplicate/no-op substitutions (s/'cacti'/'cacti'/g does nothing, and the cactiuser substitution appears twice). This makes the workflow harder to maintain and suggests a missing intended replacement (e.g., password). Remove the redundant sed operations 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_USR is set to --defaults-file=~/.my.cnf, but ~ will not be expanded when it comes from a variable expansion in bash. This can cause mysql to 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 via host = 127.0.0.1 (and config.php is rewritten to 127.0.0.1). MySQL treats localhost and 127.0.0.1 as different hosts, so authentication can fail. Create/grant the user for 127.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/cacti is 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.x or 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 ping without credentials. With MYSQL_ROOT_PASSWORD set, 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.

@TheWitness
Copy link
Member

@bmfmancini , you removed all the code quality checks. Fix that and it's ready to go.

@bmfmancini
Copy link
Member Author

What the ? Yea did not mean to do that

@TheWitness TheWitness merged commit 4155135 into Cacti:main Feb 14, 2026
4 checks passed
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.

4 participants