* PostgreSQL: the owner was never the story, so stop asking who owns the tables
For as long as the install check has existed, it asked pg_tables who owned
the tables and compared that against the database login. Nobody asked why.
The login is a gateway user, the tables belong to whatever role ran the
install, and whenever those two names diverged the check reported the schema
as missing. Visibility was the question all along.
tablesAreCorrect() now asks pg_class which ordinary and partitioned tables
are visible on the search_path. If PostgreSQL can see it, it counts. A table
parked in a schema outside the path does not hide a missing one, and a view
named like a table is not a table.
The new test builds a role, a visible schema, a hidden schema, and a view
with a suspicious name, then checks that each answer is the true one. It runs
against a real PostgreSQL 18 service in CI. Locally it skips unless
FRESHRSS_TEST_PGSQL_DSN is set.
* Pin the CI Postgres service to a digest, because somebody moved the tag
For the record: nobody announced it. The postgres:18-alpine tag sat in
tests.yml like a loaded gun pointed at every CI run, and zizmor was the
first thing to notice it had no fixed identity at all. Remember the
Denver Airport. Remember that tags are not promises.
This commit replaces the mutable tag with the exact multi-arch digest the
suite was already tested against:
postgres:18-alpine@sha256:eaef288f54a90a909e49f0121d5d047a5e974e922699de4249625cf7cde34f36
This is not a version bump. Same image, same PostgreSQL 18, same Alpine
base. The only thing that changed is that the image can no longer be
swapped out from under us between Tuesday's green run and Thursday's
mystery failure.
Verification: all pre-commit PHP, test, JS, CSS and Markdown checks pass.
Local pedantic offline zizmor reports no findings. This resolves the
unpinned-service-image blocker on PR #9535.
* Rewrite test a bit
* Fix make test-all
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* Check SVG optimization in the tests CI workflow with SVGO
Previously it was only recommended by the documentation that SVG images should be optimized using [SVGOMG](https://github.com/jakearchibald/svgomg), the web GUI version of https://github.com/svg/svgo (CLI)
Now all SVG images are optimized, and optimization is mandatory enforced by the tests CI workflow.
\+ SVGs are sanitized of potentially malicious JS code using the https://svgo.dev/docs/plugins/removeScripts/ plugin
* Output prettified SVGs instead and remove unchanged files from stdout
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* Use `removeScripts` SVGO plugin to reduce risk of malicious SVGs
* Move the CLI options to the JS config instead
* Disable `removeComments` plugin included in the default preset
* editorconfig, and easier config
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* Add zizmor workflow for action security checks
https://docs.zizmor.sh/integrations/#github-actionshttps://github.com/zizmorcore/zizmor-action
To avoid pushing unsafe actions and also for performing the scan automatically on each zizmor upgrade, in case there are any new unsafe behaviors to find.
* Zizmor fixes
* Set dependabot cooldowns to 7 days
* Fix workflow concurrency and improve code quality
* Use pedantic persona in zizmor workflow
* Dev updates: composer, hadolint, typos...
Composer compatibility PHP 8.6.
Manual updates not supported by Dependabot
* Fix hadolint
* Update lib/Minz/Url.php
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
* Add sha256sum for composer
---------
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
* Pin the docker and pages actions to full commits
The docker-publish workflow logs into Docker Hub and pushes the
official images, and its actions were referenced by version tags. A
tag is a movable pointer, whoever controls an action repository can
point it at different code after review, which is how the
tj-actions/changed-files incident (CVE-2025-30066) leaked CI secrets
at scale. A full commit cannot be retargeted. setup-ruby and
dockerhub-description were already pinned this way here, this extends
the same practice to the rest.
Each pin keeps the version as a trailing comment for review against
the action's releases page, versions stay exactly where they were,
and dependabot bumps commit pins the same way it bumps tags.
* Declare token permissions on the tests and description workflows
Both ran with the repository's default token grants and neither
writes through the GitHub token, the Docker Hub description update
authenticates with its own credentials. They drop to a read only
token, matching what docker-publish and the pages workflow already
declare.
* PHPStan 2.0
fix https://github.com/FreshRSS/FreshRSS/issues/6989https://github.com/phpstan/phpstan/releases/tag/2.0.0https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md
* More
* More
* Done
* fix i18n CLI
* Restore a PHPStan Next test
For work towards PHPStan Level 10
* 4 more on Level 10
* fix getTagsForEntry
* API at Level 10
* More Level 10
* Finish Minz at Level 10
* Finish CLI at Level 10
* Finish Controllers at Level 10
* More Level 10
* More
* Pass bleedingEdge
* Clean PHPStan options and add TODOs
* Level 10 for main config
* More
* Consitency array vs. list
* Sanitize themes get_infos
* Simplify TagDAO->getTagsForEntries()
* Finish reportAnyTypeWideningInVarTag
* Prepare checkBenevolentUnionTypes and checkImplicitMixed
* Fixes
* Refix
* Another fix
* Casing of __METHOD__ constant
* Minor update dependencies
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/5691
Mostly dev dependencies; nothing that affects our runtime
* Update versions for GitHub Actions
* Fix newly found typos
* Fix exclude path
* Automated test towards PHPStan level 6
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112
With this automated tests, files that are passing Level 6 are tested to avoid regressions towards Level 5 (which is the current baseline for the whole code-base)
It is included when calling `make test-all` or can be called specifically by `composer run-script phpstan-next`
* Test and example with 3 new passing files
Silence irrelevant NPM errors when a test fails. See e.g. https://github.com/FreshRSS/FreshRSS/runs/3999501244?check_suite_focus=true
```text
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! freshrss@ markdownlint: `markdownlint '**/*.md'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the freshrss@ markdownlint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-10-25T16_15_34_166Z-debug.log
```
Efforts to reduce the resources used by CI:
* Only one git checkout
* Exclusion of irrelevant directories for several commands
* Fix some rtlcss warnings
* Move some commands from tests.yml to composer.json to make them reusasble
* Initial efforts to take avantage of all that from `make` (help welcome)