Skip to content

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

Merged
TheWitness merged 4 commits into
developfrom
ci/fix-permissions
Sep 18, 2026
Merged

TheWitness merged 4 commits 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

Composer plugin execution and production-versus-development dependency handling need correction.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This pull request updates the plugin CI workflow to run Composer operations with elevated permissions and adjusts Pest dependency installation.

Changes:

  • Adds sudo to Composer and lockfile commands.
  • Removes the deprecated --dev flag from composer require.
File summaries
File Description
.github/workflows/plugin-ci-workflow.yml Adjusts Composer dependency installation in CI.
Review details

Suppressed comments (1)

.github/workflows/plugin-ci-workflow.yml:134

  • Removing --dev changes Composer's target section: composer require will add these test-only packages to require, while the later composer install --dev only controls what is installed and does not move them back to require-dev. Keep the dev flag (or use the supported equivalent) so the CI-only Pest dependencies are not recorded as production requirements.
          sudo composer require --no-progress --no-interaction "pestphp/pest: ^3" "pestphp/pest-plugin-drift: ^3.0"
  • 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.

Comment thread .github/workflows/plugin-ci-workflow.yml
bmfmancini
bmfmancini previously approved these changes Sep 18, 2026

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

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
bmfmancini
bmfmancini previously approved these changes Sep 18, 2026
@TheWitness
TheWitness merged commit b7cf1e4 into develop Sep 18, 2026
7 checks passed
@TheWitness
TheWitness deleted the ci/fix-permissions branch September 18, 2026 15:42
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