Skip to content

fix(routing): ship the legacy alias cache and read it instead of rebuilding it (#605) - #606

Merged
Neophytis merged 2 commits into
mainfrom
neophytis/605-alias-cache-write
Oct 14, 2026
Merged

Neophytis merged 2 commits into
mainfrom
neophytis/605-alias-cache-write

Conversation

@Neophytis

@Neophytis Neophytis commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #605

Target branch: main

What:

  • Commit build/alias.cache.ini, the legacy router's alias table (7 lines, generated from build/*/alias.ini with the router's own parse and write steps).
  • rox_docker.ini: IniCache = "1", so the router reads that file instead of rebuilding it on every request.
  • .gitignore: an exception for that one file (*.cache.ini stays ignored).

Why: with IniCache = "0" the router rebuilds the table on every legacy page and writes it to build/, which is read-only in the image. The write fails and logs an error: about 40,000 a day on prod, each with 50 buffered log lines.

Checked: on stage, 8 logged-in legacy pages:

Setup Errors
As today (no file, IniCache = "0") 4
Committed file, IniCache = "0" 4
Committed file, IniCache = "1" (this PR) 0

With IniCache = "0" the router ignores the committed file and still tries to write it, so the file alone does not stop the errors; both changes are needed. /search, /donate, /people/... and the other aliases route as before.

Details
  • localhost still rebuilds the table on every request (the router's own check), so local development is unchanged.
  • If someone adds or changes a build/*/alias.ini, the cache file has to be regenerated in the same PR. Legacy pages are being migrated to Symfony, so this should be rare.
  • The file keeps two quirks of the router's output: a double space after searchmembers = (an empty alias from splitting the multi-line values), and rss = feed only (build/rss/alias.ini defines rss twice; the last one wins).
  • No PHP code changes: the earlier commit on this branch is undone.

@thisismeonmounteverest thisismeonmounteverest 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.

The correct way to fix this is to checkin the alias.cache.ini file instead of changing the code.

…ilding it (#605)

Commits build/alias.cache.ini and sets IniCache = "1" in rox_docker.ini, as
asked in review; the router code goes back to main's.
@Neophytis Neophytis changed the title fix(routing): write the legacy alias cache only when it is read (#605) fix(routing): ship the legacy alias cache and read it instead of rebuilding it (#605) Oct 14, 2026
@Neophytis
Neophytis marked this pull request as draft October 14, 2026 20:10
@Neophytis

Copy link
Copy Markdown
Contributor Author

The correct way to fix this is to checkin the alias.cache.ini file instead of changing the code.

Not quite it's a combination but your suggestion gave part of the answer

@Neophytis
Neophytis marked this pull request as ready for review October 14, 2026 20:14
@Neophytis
Neophytis merged commit 97bb352 into main Oct 14, 2026
13 checks passed
@Neophytis
Neophytis deleted the neophytis/605-alias-cache-write branch October 14, 2026 20:23
Neophytis added a commit that referenced this pull request Oct 14, 2026
From main 36f83b7 (#590 login reminders, data retention batches), 356932f
(#607), 4b5adf3 (#603 login reminder UTM) and 97bb352 (#606 legacy alias
cache, IniCache = "1"; the cache file matches route C's alias.ini files).

Kept for develop: its composer versions (symfony/stopwatch 7.4),
Member::__serialize, the AvatarController constructor, getFields() and
setAddressHidden(). For Symfony 7 and Doctrine ORM 3: data:retention uses
#[AsCommand], YearDiff uses TokenType and getSql(): string, as DateDiff does.
php-cs-fixer 3.88.2.

Checked on the local stack (route C image, this code): cache:clear,
doctrine:schema:validate (mapping), members:remind:login,
members:remove:notconfirmed and data:retention run.
@thisismeonmounteverest

Copy link
Copy Markdown
Contributor

See my comment on the original pull request: #554

Neophytis added a commit that referenced this pull request Oct 15, 2026
Reverts 693f312 (the port of main's #590 login reminders and data
retention batches, #607 data retention fix, #603 reminder UTM and #606
alias cache) and its follow-ups 38b061c (data:retention on DBAL 4) and
4d0cffc (members:remind:login without setUpdated). Route C ships only
our work; the reminder, data retention and alias cache changes are left
to their author on main.

The 17 files are back to their state before the port, except
config/services.yaml, which keeps d1180ea (app.userprovider autowired,
independent of the port). data:retention is develop's own command again.
Neophytis added a commit that referenced this pull request Oct 15, 2026
* Revert "fix(routing): ship the legacy alias cache and read it instead of rebuilding it (#605) (#606)"

This reverts commit 97bb352.

* Revert "fix(analytics): login reminder UTM uses source 'reminder', campaign 'login_reminder' (#590) (#603)"

This reverts commit 4b5adf3.
Neophytis added a commit that referenced this pull request Oct 15, 2026
Records main's history so #582 merges without conflicts. Main's changes
since the last port are not taken: #590 and #607 stay out of route C
(af49b62), #603 and #606 are reverted on main (#609), #595 is on
route C as 29cfe3e.
Neophytis added a commit that referenced this pull request Oct 15, 2026
From main 36f83b7 (#590 login reminders, data retention batches), 356932f
(#607), 4b5adf3 (#603 login reminder UTM) and 97bb352 (#606 legacy alias
cache, IniCache = "1"; the cache file matches route C's alias.ini files).

Kept for develop: its composer versions (symfony/stopwatch 7.4),
Member::__serialize, the AvatarController constructor, getFields() and
setAddressHidden(). For Symfony 7 and Doctrine ORM 3: data:retention uses
#[AsCommand], YearDiff uses TokenType and getSql(): string, as DateDiff does.
php-cs-fixer 3.88.2.

Checked on the local stack (route C image, this code): cache:clear,
doctrine:schema:validate (mapping), members:remind:login,
members:remove:notconfirmed and data:retention run.
Neophytis added a commit that referenced this pull request Oct 15, 2026
Reverts 693f312 (the port of main's #590 login reminders and data
retention batches, #607 data retention fix, #603 reminder UTM and #606
alias cache) and its follow-ups 38b061c (data:retention on DBAL 4) and
4d0cffc (members:remind:login without setUpdated). Route C ships only
our work; the reminder, data retention and alias cache changes are left
to their author on main.

The 17 files are back to their state before the port, except
config/services.yaml, which keeps d1180ea (app.userprovider autowired,
independent of the port). data:retention is develop's own command again.
Neophytis added a commit that referenced this pull request Oct 15, 2026
Records main's history so #582 merges without conflicts. Main's changes
since the last port are not taken: #590 and #607 stay out of route C
(af49b62), #603 and #606 are reverted on main (#609), #595 is on
route C as 29cfe3e.
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.

2 participants