Skip to content

IBX-11779: Updated Ibexa CS, PHPStan, and GHA#42

Merged
alongosz merged 19 commits into
mainfrom
ibx-11779-update-package-codebase
May 15, 2026
Merged

IBX-11779: Updated Ibexa CS, PHPStan, and GHA#42
alongosz merged 19 commits into
mainfrom
ibx-11779-update-package-codebase

Conversation

@alongosz
Copy link
Copy Markdown
Member

@alongosz alongosz commented May 14, 2026

🎫 Issue IBX-11779

Description:

The main reason behind touching this package was to introduce Ibexa Code Style ~2.3.0 to all skeletons. However looks like CI is completely broken. While at it, I've bumped PHPStan and fixed reported issues with Codex's help.

Sadly there are no unit nor integration tests of any kind, so I've checked bundle generation command manually. Please note that this is a self-contained Symfony 5.4 console application (yeah we should bump Symfony too, but the scope here is too wide already).

Bundle generator is used by the template cleanup workflow when creating a new repository using one of our templates.

See review remarks posted ass diff comments for more detailed information on the changes.

Changelog of bundle generator GHA:
  • [GHA] Dropped PR assignees workflow (f7baca8)
  • [GHA][Backend CI] Dropped Satis configuration (d8c239b)
  • [GHA][Backend CI] Dropped SQLite & GD extension from PHP setup (1213861)
  • [GHA][Backend CI] Updated ubuntu and actions versions (90dac99)
Changelog of bundle generator codebase:
  • [CS] Bumped Ibexa Code Style to ~2.3.0 (3c683a6)
  • [PHPStan] Bumped PHPStan to ^2 (e799a80)
  • [CS] Aligned generator codebase with Ibexa Code Style 2.3.0 (a46d404)
  • Fixed static analysis issues in generator codebase (4c60c39)
  • [PHPStan] Removed resolved issues from the baseline (69f97d2)
Changelog of repository skeletons:
  • [Skeletons][CS] Aligned skeletons with new Ibexa Code Style 2.3.0 (69c9f0d)
  • [Skeletons] Bumped Ibexa Code Style to ~2.3.0 (3b83a24)
  • [Skeletons] Bumped Symfony to ^7.4 (11c89c2)
  • [Skeletons] Dropped obsolete main branch from Backend CI GHA workflow (3d90690)
  • [Skeletons][EE] Replaced TRAVIS_GITHUB_TOKEN with GitHub App secrets (fbc8331)
  • [Skeletons][EE] Updated Backend CI GHA (ef4d0e8)
  • [Skeletons][OSS] Updated Backend CI GHA (9113471)
  • [Skeletons][Extension] Updated 3rd party GHA workflows (0a1a6e9)
  • [Skeletons] Dropped obsolete pull_request_template.md (33f989e)

alongosz and others added 18 commits May 14, 2026 11:32
This is not part of the product, so having assignees doesn't make sense here
This is not a product package, it won't have any private ibexa dependencies
They're unnecessary for bundle-generator GHA.
Co-Authored-By: OpenAI Codex <codex@openai.com>
Aligned Backend CI GHA workflow with the latest conventions and requirements
Aligned OSS Backend CI GHA workflow with the latest conventions and requirements
@alongosz alongosz force-pushed the ibx-11779-update-package-codebase branch from d932d28 to e39601c Compare May 14, 2026 13:07
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 14, 2026

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Copy link
Copy Markdown
Member Author

@alongosz alongosz left a comment

Choose a reason for hiding this comment

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

Note

Review notes as diff comments can be found below:

jobs:
tests:
name: Tests
runs-on: "ubuntu-20.04"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note

Made GHA workflow completely not runnable as Ubuntu 20 has been discontinued on GHA.

Comment on lines -30 to -40
extensions: pdo_sqlite, gd
tools: cs2pr

- name: Add composer keys for private packagist
run: |
composer config http-basic.updates.ibexa.co $SATIS_NETWORK_KEY $SATIS_NETWORK_TOKEN
composer config github-oauth.github.com $TRAVIS_GITHUB_TOKEN
env:
SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }}
SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }}
TRAVIS_GITHUB_TOKEN: ${{ secrets.TRAVIS_GITHUB_TOKEN }}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note

Changes not needed for GHA run for the bundle generator itself, as it shouldn't install any Ibexa packages, except for Ibexa Code Style, which is served by Packagist.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note

Deleted obsolete PR assignment workflow as it rather doesn't apply to this package.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note

Obsolete, handled by org-wide PR template.

on:
push:
branches:
- main
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note

Obsolete, we dropped main branches.

Comment on lines -161 to +122
image: ghcr.io/ibexa/core/mysql
image: ${{ matrix.image }}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note

Looks like our own image has not been updated in the last 4 years and we rather tend to use generic one (TBH not sure why we had custom in the first place)

Comment on lines +20 to +23
- uses: ibexa/gh-workflows/actions/composer-install@main
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: 'pdo_sqlite, gd'
tools: cs2pr

- uses: ramsey/composer-install@v3
with:
dependency-versions: "highest"
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note

OSS packages shouldn't need Satis tokens by default.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note

A bit of refactoring here of issues spotted by PHPStan.

@alongosz alongosz marked this pull request as ready for review May 14, 2026 13:27
$contents = file_get_contents($pathname);

if ($contents === false) {
throw new InvalidArgumentException("Unable to get contents of the file '$pathname'");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not for this particular PR, but general comment:

Did we consider to use package which will secure us against such non expected native functions results? I mean https://github.com/thecodingmachine/safe in particular.
There's also phpstan rule package to enforce using of these "safe" functions everywhere.

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.

I don't recall such discussion tbh. It's always a balance between added value and the risk of such 3rd party packages being left behind support-wise. 😉

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@konradoboza I think it's a quite stable package. The added value is that it reduces boilerplate code around handling types/additional conditions (to meet phpstan rules) and makes more strict usage of native php functions (reducing potential bugs in this area).

I've used that lib in my previous company and it worked fine. It's something we could consider to introduce in our stack, if everybody agrees it's useful 😉

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.

Sure, we can discuss within the Team but I would personally see it as an experiment if some newly added package in the future. 😉

Comment thread .github/workflows/backend-ci.yaml
@alongosz alongosz merged commit 7fe2c16 into main May 15, 2026
5 checks passed
@alongosz alongosz deleted the ibx-11779-update-package-codebase branch May 15, 2026 11:00
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.

5 participants