Skip to content

Conversation

@lippserd
Copy link
Member

@lippserd lippserd commented Oct 1, 2025

This PR switches to the new PHP workflow, which combines linting, static analysis, and unit testing. phpcs.xml and phpunit.xml have been removed, as the new workflow provides sane defaults for both and the files did not contain any special configurations anyway. Since the new workflow uses the latest PHPUnit version by default, deprecated PHPUnit features have been migrated.

  • After merging, I will update the branch protection required status checks to match the new workflow - below is a dry run showing what would happen.
./gh-update-branch-protection-checks/gh-update-branch-protection-checks.sh --repo Icinga/ipl-sql --pr 93 --dry-run
[INFO] Fetching PR details...
[WARNING] PR #93 is not merged; continuing anyway...
[INFO] Target branch: main
[INFO] PR head branch: php-workflows
[INFO] PR head commit SHA: 44c740513a7cb4d91425209a9a87d32f0577c88b
[INFO] Listing workflow runs triggered by commit 44c740513a7cb4d91425209a9a87d32f0577c88b...
[INFO] Workflow runs: 20025719245
[INFO] Listing jobs for workflow 20025719245...
[INFO] Jobs: PHP / Static analysis (8.2) / PHPStan 8.2, PHP / Static analysis (8.4) / PHPStan 8.4, PHP / Static analysis (8.3) / PHPStan 8.3, PHP / Static analysis (8.5) / PHPStan 8.5, PHP / Test (8.5) / PHPUnit 8.5, PHP / Test (8.3) / PHPUnit 8.3, PHP / Test (8.2) / PHPUnit 8.2, PHP / Test (8.4) / PHPUnit 8.4, PHP / Lint (8.4) / Linters 8.4, PHP / Lint (8.5) / Linters 8.5, PHP / Lint (8.2) / Linters 8.2, PHP / Lint (8.3) / Linters 8.3
[INFO] Fetching current branch protection required status checks...
[INFO] Comparing branch protection required status checks...
--- /dev/fd/63	2025-12-08 13:25:19.444896064 +0100
+++ /dev/fd/62	2025-12-08 13:25:19.445129731 +0100
@@ -43,27 +43,51 @@
       },
       {
         "app_id": 15368,
-        "context": "Static analysis for php 8.2 on ubuntu-latest"
+        "context": "PHP / Lint (8.2) / Linters 8.2"
       },
       {
         "app_id": 15368,
-        "context": "Static analysis for php 8.3 on ubuntu-latest"
+        "context": "PHP / Lint (8.3) / Linters 8.3"
       },
       {
         "app_id": 15368,
-        "context": "Static analysis for php 8.4 on ubuntu-latest"
+        "context": "PHP / Lint (8.4) / Linters 8.4"
       },
       {
         "app_id": 15368,
-        "context": "Unit tests with php 8.2 on ubuntu-latest"
+        "context": "PHP / Lint (8.5) / Linters 8.5"
       },
       {
         "app_id": 15368,
-        "context": "Unit tests with php 8.3 on ubuntu-latest"
+        "context": "PHP / Static analysis (8.2) / PHPStan 8.2"
       },
       {
         "app_id": 15368,
-        "context": "Unit tests with php 8.4 on ubuntu-latest"
+        "context": "PHP / Static analysis (8.3) / PHPStan 8.3"
+      },
+      {
+        "app_id": 15368,
+        "context": "PHP / Static analysis (8.4) / PHPStan 8.4"
+      },
+      {
+        "app_id": 15368,
+        "context": "PHP / Static analysis (8.5) / PHPStan 8.5"
+      },
+      {
+        "app_id": 15368,
+        "context": "PHP / Test (8.2) / PHPUnit 8.2"
+      },
+      {
+        "app_id": 15368,
+        "context": "PHP / Test (8.3) / PHPUnit 8.3"
+      },
+      {
+        "app_id": 15368,
+        "context": "PHP / Test (8.4) / PHPUnit 8.4"
+      },
+      {
+        "app_id": 15368,
+        "context": "PHP / Test (8.5) / PHPUnit 8.5"
       }
     ],
     "contexts_url": "https://api.github.com/repos/Icinga/ipl-sql/branches/main/protection/required_status_checks/contexts",
[SUCCESS] [dry-run] No changes applied.

@cla-bot cla-bot bot added the cla/signed label Oct 1, 2025
@lippserd lippserd force-pushed the php-workflows branch 2 times, most recently from a33f3f2 to 4a10d58 Compare October 20, 2025 11:47
@lippserd lippserd force-pushed the php-workflows branch 2 times, most recently from 0107a80 to 44c7405 Compare December 8, 2025 10:56
@lippserd lippserd marked this pull request as ready for review December 8, 2025 12:28
@lippserd lippserd changed the title GitHub Actions: Use new PHP workflows GitHub Actions: Use new PHP workflow Dec 8, 2025
@lippserd lippserd merged commit 5efc779 into main Dec 9, 2025
13 checks passed
@lippserd lippserd deleted the php-workflows branch December 9, 2025 12:11
@lippserd
Copy link
Member Author

lippserd commented Dec 9, 2025

I have updated the branch protection required status checks to match the new workflow.

BastianLedererIcinga added a commit that referenced this pull request Dec 11, 2025
`scanDirectories` was set to `/usr/share/icinga-php` to simplify local testing,
as both the Icinga PHP Library and Icinga PHP Thirdparty are installed there in
our development environment. Our individual PHP library components, which make
up these libraries, are self-contained, as they define all necessary
dependencies themselves. This then requires testing with exactly these
dependencies instead of an arbitrary folder that could contain anything, e.g.,
dependencies in unexpected versions or dependencies that have not yet been
defined. For remote and local testing, `composer install` must be executed and
tests must be performed with exactly the resulting dependencies. Since PHPStan
uses the Composer autoloader by default, if available, `scanDirectories` does
not need to be defined at all.

- #93 makes it superfluous for github actions
BastianLedererIcinga added a commit that referenced this pull request Dec 11, 2025
`scanDirectories` was set to `/usr/share/icinga-php` to simplify local testing,
as both the Icinga PHP Library and Icinga PHP Thirdparty are installed there in
our development environment. Our individual PHP library components, which make
up these libraries, are self-contained, as they define all necessary
dependencies themselves. This then requires testing with exactly these
dependencies instead of an arbitrary folder that could contain anything, e.g.,
dependencies in unexpected versions or dependencies that have not yet been
defined. For remote and local testing, `composer install` must be executed and
tests must be performed with exactly the resulting dependencies. Since PHPStan
uses the Composer autoloader by default, if available, `scanDirectories` does
not need to be defined at all.

- #93 makes it superfluous for github actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants