Skip to content

Route C step 1, for comment: develop@4a3b74550 with Symfony 7.4, PHP 8.4, ORM 3 (#519) - #582

Draft
Neophytis wants to merge 202 commits into
mainfrom
neophytis/519-route-c-4a3b
Draft

Neophytis wants to merge 202 commits into
mainfrom
neophytis/519-route-c-4a3b

Conversation

@Neophytis

@Neophytis Neophytis commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Draft for comment. Do not merge. This branch replaces main's application code with develop at 4a3b74550. main has 125 commits this branch does not have yet (listed at the end); merging now would remove them.

Part of #519 (route C: upgrade the framework first, redesign the schema later). Target branch: main.

What this is

develop at 4a3b74550 (2025-10-20) is the last develop commit that still runs on prod's database. One commit later (7ecf67c4c, "Introduce new member entity") develop moves the login and about 160 files to the new member table. At 4a3b74550 it already has Symfony 7.4, PHP 8.4 and Doctrine ORM 3, and its CI was green.

On top of it, everything needed to run it the way prod runs:

Change Source
Dockerfile (PHP 8.4.26), docker/, docker-compose.yml, .trivyignore, image workflows main
Symfony 7.4.x-dev to 7.4.20 releases (SYMFONY_REQUIRE=7.4.*), Twig, Guzzle patch releases composer update, audit clean
Intervention Image v4 (300d2e2e2, #535) main
circle-flags and @tomickigrzegorz/autocomplete from npm (the GitHub sources need git in the build; the autocomplete commit no longer exists) develop
Doctrine reads DB_* instead of a DATABASE_URL built in .env; the session handler reuses the Doctrine connection main
translations:add:missing: bind the three parameters develop
ParamConverter docblocks to #[MapEntity] (5 controllers) develop
{username:member} on 23 routes (controller_resolver.auto_mapping is false) develop
DBAL 4 parameter names without the leading : in the conversation adapters new; develop has the same bug
error500.html.twig trans({username: ...}) main and develop
public/images/logo_index_top.png main
profile.js null check for the language switch new, minimal
Branch builds no longer move the rolling stage image tags new

Tested on stage (prod data copy, 2026-10-09)

  • Image sha-cbf2c40: deploy and stage smoke tests green, Trivy 0 findings (OS, npm, Composer), no CRITICAL in the PHP log after deploy.
  • Browser check of 21 pages, logged out and logged in, compared with prod: same status codes and assets on every page, comment order identical. Also green: notes, relations, preferences, conversations with a member, messages, requests, invitations, forum posts by member, avatars (resized through Intervention v4), group members, gallery.
  • Same as prod (not regressions): JS errors on /faq and /feedback, /locale/fr 404, visitors page redirect.
  • Visible difference: the header. main has the new header, logos and home page (2026-04-24, 2026-05-12); this branch has develop's older header. That is part of the list below.

Not ported yet

The 125 main commits below are the porting list for this route. Some of the Docker and CI ones are already covered by taking main's Docker layer and workflows. Each group would be its own reviewed PR onto this branch.

125 commits on main that this branch does not have

Docker, CI and deploy (28)

Security and privacy (7)

  • 23aae920e 2024-04-27 Use session invalidation to force user logout to avoid re-activation of just retired member.
  • 58ceac4ff 2026-08-15 fix(proxy): forward X-Forwarded-Proto so Symfony generates https:// URLs
  • 5fdbc73ad 2026-08-27 fix(proxy): declare trusted_proxies/headers in framework.yaml; cookie_samesite lax
  • 0633769fb 2026-08-27 fix(proxy): trusted_headers must be YAML list in Symfony 5.4, not env string
  • aa9ed3ee2 2026-08-27 chore: remove api-platform/core (unused, accumulating CVEs)
  • 777a5d0a0 2026-09-02 Migrate cron job to symfony command.
  • 3eb41314c 2026-09-27 fix(session): keep members logged in for 7 days, remember-me samesite lax (fix(session): keep members logged in for 7 days, remember-me samesite lax #516)

Mail (9)

Frontend, layout and UX (10)

  • a44166832 2026-04-24 Add new logos everywhere. Update navigation and footer. New home page.
  • fcf91311f 2026-04-25 Fix menu for legacy pages like signup.
  • c43ed7902 2026-04-25 Fix menu for pages that work without login.
  • 46fae7b9e 2026-04-25 Fix menu for policy pages.
  • 4c1cf4337 2026-04-26 Fix menu overflow on legacy pages.
  • 6c8e69194 2026-05-06 Use new logo on error pages. Update yarn.lock for browserslist.
  • 002be5378 2026-05-12 login access from header + redesign login page
  • e7286e054 2026-05-31 Give full logo space to breath. Fix wordmark becoming too small compared to icon.
  • 0ad55a778 2026-06-10 Make sure the member menu is right aligned.
  • 5a56b5350 2026-06-13 Update web preview images. Fix old logo in base-lite template.

Bug fixes (29)

Other (42)

  • 51f0d0aed 2023-07-10 Add flash that is shown if comment is locked.
  • 6d620c344 2023-07-11 Set status to active after successful login (even if login was using remember me).
  • ee51b7cfb 2023-07-13 Show comment update on profile page and set ADMIN_CHECK for negative comments.
  • c6c666b1f 2024-04-27 Make /deleteprofile accessible without redirect from Play store compliance.
  • ee911ab63 2026-05-06 Add blocked messages to the admin tools.
  • 007022ed7 2026-05-09 Force checkbox appearance.
  • 5860d89b3 2026-05-11 Add more constraints for activities.
  • a111d0bb6 2026-05-11 Align master with production.
  • 975963892 2026-05-13 Further align master and www.
  • 32dd5d34f 2026-05-13 Move to Noto Sans and some alignment of master and www.
  • 229b4cfde 2026-05-31 Align login forms. Fix signup date.
  • 769066748 2026-06-06 Use full size sheet only for xs and sm screens.
  • ff0b40877 2026-06-07 Use Noto Sans on /login as well.
  • 93157bfa9 2026-08-04 Use latest ACPu extension.
  • 4ce44da92 2026-08-13 Update formatting options for messages.
  • 4d0622f5d 2026-08-15 perf(nginx): enable gzip and long-lived cache for hashed assets
  • 90137e8b6 2026-08-27 perf(homepage): cache statistics queries for 1 hour
  • 112fd85c4 2026-08-27 chore: remove api-platform Serializer normalizers left behind by 3dd46fc
  • 7db45bf3e 2026-08-27 chore: remove unused @groups annotations from entities
  • ed1517520 2026-08-27 perf(trips): add bounding-box pre-filter before haversine GeoDistance
  • f2cd5dfec 2026-08-30 chore(db): pin MariaDB to 12.3 LTS (mariadb:lts tag)
  • 965102a02 2026-09-02 Rewrite to use only PHP 7.4 features.
  • e25594574 2026-09-02 Add system to highlights.
  • 92297d20b 2026-09-02 Add external contact info.
  • 5984133e3 2026-09-02 Set correct anchor (#external is referenced in tou).
  • efabe053c 2026-09-06 Remove SQL_CALC_FOUND_ROWS everywhere.
  • 5d265d2ef 2026-09-06 Some cleanup in ForumCleanupCommand.
  • 96117b2ce 2026-09-10 Removing spurious < from template.
  • fc6bc398e 2026-09-10 feat(analytics): parameterize Plausible script URL via PLAUSIBLE_SCRIPT_URL env var
  • 0249203aa 2026-09-15 feat(analytics): add Plausible custom event tracking for key user actions
  • 70b7df3ec 2026-09-19 Revert fix for display glitch (not effective).
  • 782c9ccee 2026-09-20 Update LOCALES to include Armenian
  • d28f0215f 2026-09-20 Add necessary files to support Armenian in translations directory.
  • 02cf7e57c 2026-09-20 Use object instances instead of static access for Mod_htmlpure.
  • fcd8c91bc 2026-09-21 Feat: Add znuny to the credits page. Closes Add znuny to the credits page #510.
  • 455c60064 2026-10-01 Add Ukrainian and fix display glitch in language dropdown.
  • ec4b02939 2026-10-02 Use symfony translator instead of loading rows from the database.
  • 300d2e2e2 2026-10-02 Upgrade to Intervention image library v4.x and adapt image handling code accordingly.
  • 0dd7c6906 2026-10-04 Set absolute URL on empty referrer. Return a valid redirect response in all cases.
  • af342242f 2026-10-04 Backport fix for 548 to production source.
  • fa6a63567 2026-10-05 feat(logging): write warnings to stderr in prod as they happen ([High priority] Prod logs at debug level, about 2 GB/day in the container: port #499 logging config to feature/docker-master #524 follow-up) (feat(logging): write warnings to stderr in prod as they happen (#524 follow-up) #559)
  • 43d64020d 2026-10-09 style: bring src/ back in line with php-cs-fixer (Fix CI on feature/docker-master (future main): 8 jobs fail on every push #517) (style: bring src/ back in line with php-cs-fixer (#517) #573)

Questions for review

  1. Is 4a3b74550 the right base, or should this start from a later develop commit and keep the old members table some other way?
  2. Sign-up: keep main's flow until the schema step (as Privacy: member email addresses in /signup/resend URLs reach Plausible and logs (low priority) #541 suggests, develop's sign-up comes with the new tables)?
  3. Profile comments: main sorts them (new experiences first), develop shows the last 10. Which one?
  4. Prod's Doctrine migration history is empty: mark already-applied migrations as executed #560: remove the 2020 migrations, as suggested. The functions and the forum_trads view from Version20200307133359 then need another way into fresh databases (devcontainer, CI), for example a SQL file next to languages.sql.

gabriel-BW and others added 30 commits January 2, 2024 10:00
Added a missing translation fetch (wordcode is already existing but not used)
…f applicable. Sort translations correctly. Show/hide password.
thisismeonmounteverest and others added 29 commits October 9, 2026 19:37
… (#558)

Prod wrote every record at debug level to rotating files in the container
(about 1.6 GB a day) plus an unbounded prod.deprecations.log (about 1.5 GB
a day). Nothing reached docker logs, so errors never got to VictoriaLogs.

- main: fingers_crossed at error, 404/405 excluded, 50-record buffer,
  JSON to php://stderr. Normal requests write nothing; a failing request
  writes the error plus its buffered context.
- Deprecations go to their own handler whose path is the DEPRECATION_LOG
  env var, default /dev/null. Stage sets php://stderr; prod can turn it
  on with an env change and a restart, no new image. A summary of the
  last 2.5 days of prod deprecations is on #519.
- Drop the syslog and file handlers (no syslog in the container, files
  are lost on each deploy).
- SuggestLocationController::logSearchInfo() logged every suggestion at
  alert, which would trigger the error buffer on each request. Now debug.

(cherry picked from commit 2f94d37)
…follow-up) (#559)

Since #558, prod writes only errors (with their buffered request context).
Warnings from requests that don't fail were no longer written anywhere. On
3.8.0 that was about 28k a day, and they pointed at real problems: the
avatar fallback (#556, which members have unreadable avatar files), header
injection in the language switcher (#550), undecodable sessions (#532).

- warnings: a filter handler that passes only the warning level, straight
  to php://stderr as JSON, no buffer. Errors stay with "main", so an error
  is never written twice. A warning in a request that later fails appears
  twice (alone and as context of the error), about 400 requests a day.
- Deprecations, notices and debug stay off. Volume: about 28k lines a day,
  about 20k once ROX-502 (alias.cache.ini warning) is fixed.

(cherry picked from commit fa6a635)
…come/sysadmins-infra#654) (#564)

/about/faq answered with a 302 to /faq and every page linked to
/about/faq (footer, landing, search map, About submenu), so Google kept
/about/faq as canonical and reported /faq as a duplicate, against the
sitemap and canonical tag. The redirect is now a 301 and the links use
faqs_overview. Also fixes the groups menu link about/faq/6 (404) to faq/6.

(cherry picked from commit 5f5ff1b)
- Manticore commands: keep this base's versions (manticoresearch-php 4,
  table() API; main's code is for client 3). Port from main: forum index
  reads forums_posts.message with a LEFT JOIN on languages (8ea7efa; no
  dependency on the forum_trads view, see #560) and memory_limit -1 (#506).
  Not ported: main's geonames column rename to geoname_id; prod's column is
  geonameId, which this base already uses.
- Member.php: back to this base's version. main's api-platform and @groups
  cleanups (9eb5030, 7db45bf) clash with this base's attributes; the
  #[Groups] here are Symfony Serializer attributes and stay.
- AvatarController: this base's version plus main's #548 fallback (log and
  serve the empty avatar when the file is missing or cannot be created);
  the membersphotos entry was already here.
- LocaleController: this base's version plus main 0dd7c69 (absolute
  homepage URL when there is no referrer; the old code passed a
  RedirectResponse object to new RedirectResponse()).
- Remove duplicate #[MapEntity] attributes in CommentController and
  LocaleController (repeated attributes make the route fail).
- StatisticsModel: main's 1-hour cache with DBAL 4 fetchAssociative /
  fetchAllAssociative.
- FaqController: /about/faq redirect as a #[Route] attribute.
- forum:cleanup: #[AsCommand] again after main's cleanup commit.
- SearchController: Routing\Attribute\Route.
(cherry picked from commit 4c1cf43)
(cherry picked from commit 007022e)
(cherry picked from commit a111d0b)
(cherry picked from commit 9759638)
(cherry picked from commit 229b4cf)
(cherry picked from commit ff0b408)
main a111d0b adds checkCommentSpam(); this base already has it, and the
line-by-line merge broke the file.
The navigation's _logout_main route comes from security.route_loader.logout
(config/routes/security.yaml), so it needs no controller route.
package.json, yarn.lock and webpack.config.js back to this base's versions
(the automatic merge had brought in main's CKEditor 40 / FontAwesome 5
stack). Added only what the redesign needs: @fontsource/noto-sans (main
32dd5d3) and the block_highlight entry (main 4ce44da); password/showhide
was already there.
… config/reference.php (#519)

The automatic merge of main's api-platform cleanup added main's JWT bundle
line to bundles.php; this base does not install the bundle. reference.php
was generated by a local console run and is not tracked on this base.
main 6cfaac3 adds a find() override that LEFT JOINs the legs and their
locations; Doctrine ORM 3 requires the typed parent signature.
main 7db45bf (remove unused @groups) only deletes lines, but the
automatic merge replaced this base's #[ORM] attributes with main's @Orm
docblocks, which Symfony 7 ignores (Location then had no identifier).
Location, NewLocation, Country, Address, Language and MembersLanguagesLevel
restored.
@Neophytis

Copy link
Copy Markdown
Contributor Author

End point of the test reached (stage image sha-18c05ae: deploy and smoke tests green, Trivy 0, no CRITICAL in the log).

All 125 main-only commits are handled:

Commits
Ported (cherry-picked, then adapted to Symfony 7.4 / DBAL 4 / ORM 3 / Manticore client 4) about 60
Already on this base about 35
Skipped on purpose: CI, Docker and tooling (the branch has main's Docker layer and image workflows), earlier Plausible steps, the PHP 7.4 downgrade about 25

Stage compared with prod (logged out and logged in, 21 pages plus 13 member, conversation and gallery routes): same status codes and assets, comment order identical, home and login pixel-identical (the new header, logos and home page are in), Plausible on every layout. JS errors on /faq and /feedback are the same as on prod.

Adaptations worth reviewing

  • Manticore commands stay on this base's client 4 code; main's forum query fix is ported, main's geoname_id rename is not (prod's column is geonameId).
  • Six entities, Member.php, CommentModel.php and the frontend config were restored to this base's versions where the automatic merge mixed in main's Symfony 5 annotations or main's CKEditor 40 package set; only the intended changes were re-applied.
  • TripRepository::find() with the ORM 3 signature; StatisticsModel cache with DBAL 4 fetch methods; LocaleController with main's absolute-URL fix (the language switch also had a repeated #[MapEntity], now fixed).

One open product decision: /signup here is develop's one-page Symfony sign-up (writes to members, addresses, memberstrads, memberspreferences, which all exist in prod's schema). Prod uses the legacy 5-step form. #541 suggests develop's sign-up; not yet tested end to end (no real sign-up submitted on stage, to avoid sending mail).

Still draft: this branch replaces main's code, and the rest of develop (new schema, Bootstrap 5, Symfony 8.1, FrankenPHP) depends on the member migration, which is the next piece of work.

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