Skip to content

ci: run composer commands with sudo in plugin CI workflow - #241

Merged
TheWitness merged 1 commit into
developfrom
ci/fix-permissions
Sep 18, 2026
Merged

TheWitness merged 1 commit into
developfrom
ci/fix-permissions

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Summary

The Install Composer Dependencies step in .github/workflows/plugin-ci-workflow.yml ran composer config, composer require, rm, and composer install without sudo. Recent changes to the CI runner mean these commands need elevated permissions to write to the shared cacti checkout, so the step was failing.

Changes

  • Prefix composer config, composer require, rm -f composer.lock, and composer install with sudo in the Pest install step.
  • Drop the deprecated --dev flag from composer require (Composer no longer supports it on require).

Before

composer config --no-plugins allow-plugins.pestphp/pest-plugin true
composer require --dev --no-progress --no-interaction "pestphp/pest: ^3" "pestphp/pest-plugin-drift: ^3.0"
rm -f composer.lock
composer install --dev --no-progress

After

sudo composer config --no-plugins allow-plugins.pestphp/pest-plugin true
sudo composer require --no-progress --no-interaction "pestphp/pest: ^3" "pestphp/pest-plugin-drift: ^3.0"
sudo rm -f composer.lock
sudo composer install --dev --no-progress

The Pest install step in .github/workflows/plugin-ci-workflow.yml now runs
composer config, composer require, rm, and composer install with sudo so
the step can write to directories owned by another user in the CI
runner. Also drop the deprecated --dev flag from composer require.

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.

🟡 Changes recommended

Running Composer via sudo in non-interactive CI can disable plugins unless explicitly allowed, and the current Composer flags/sections (install --dev, require vs require-dev) are likely to break or behave unexpectedly.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR updates the plugin CI workflow to make the Composer/Pest installation step succeed on newer GitHub Actions runners by running the relevant Composer and file commands with elevated permissions.

Changes:

  • Prefix Composer config/require/install and rm composer.lock with sudo in the “Install Composer Dependencies” step.
  • Remove --dev from composer require to address CLI flag changes.
File summaries
File Description
.github/workflows/plugin-ci-workflow.yml Adjusts the CI Composer dependency installation commands to run with sudo and updates Composer flags.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

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

LGTM - same change as plugin_syslog#359.

@TheWitness
TheWitness merged commit b12cdec into develop Sep 18, 2026
6 checks passed
@TheWitness
TheWitness deleted the ci/fix-permissions branch September 18, 2026 21:08
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.

3 participants