Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix element map so changelog rows are handled correctly #146

Merged
merged 7 commits into from
Sep 23, 2024

Conversation

jimwins
Copy link
Member

@jimwins jimwins commented Aug 19, 2024

https://www.php.net/manual/en/doc.changelog.php is empty because this was backwards and changelog entries weren't actually being indexed.

@cmb69
Copy link
Member

cmb69 commented Aug 21, 2024

Hmm, wouldn't that revert bacc87c? @sy-records can you check?

@jimwins
Copy link
Member Author

jimwins commented Aug 21, 2024

Yeah, I'm really not quite sure what is going here. Without my change, format_row() never gets called so nothing is added to the $this->changelog array. But with the change, some things in rows don't get properly linked.

Looks like we have one map that is trying to handle <tbody><row><entry> and another just <tbody><row> and things are getting confused. format_entry() is treating $this->currentChangelog as an array of strings, format_row() treats it as an array containing of the membership and id?

@jimwins
Copy link
Member Author

jimwins commented Aug 22, 2024

Okay, figured out how to solve the issue. When format_row() was actually being used, the id was no longer being saved, among other things. Now it does what it needs to do and falls through to UNDEF() so that does what it needs to do.

With this the changelog is rendered and the other things shouldn't change.

The sorting/grouping of the changelog is less than ideal because a change across multiple versions ("8.0.21, 8.1.8, 8.2.0", for example) will get sorted only with that first version number.

What we could do is when saving things to the changelogs table in phpdotnet/phd/IndexRepository.php, split the version and save N copies of that entry so it can then appear with each specific version. We can toss irregular versions because those will be for PECL and we don't include that in the generated changelog. That's going to make the changelog even more huge, though. (The XHTML version right now is about 317K.)

Copy link
Member

@sy-records sy-records left a comment

Choose a reason for hiding this comment

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

I tested it.

LGTM.

This means the changelog page goes from 317K to 329K (as chunked-XHTML)
due to the duplication it creates but I think that the changelog shown
by version is more useful this way.
@jimwins
Copy link
Member Author

jimwins commented Aug 22, 2024

Pushed a change to the PR to do that version splitting. Together with the cleanup in php/doc-en#3672, this results in a doc.changelog.html that is 329K, but that includes changes since 5.0.0. Changing it to 8.0.0 takes it down to 274K. (This is configured in doc-base/manual.xml/in.)

@cmb69
Copy link
Member

cmb69 commented Aug 22, 2024

[…], but that includes changes since 5.0.0.

Actually, the current documentation shouldn't care about PHP 5 anymore.

@jimwins
Copy link
Member Author

jimwins commented Aug 22, 2024

Opened php/doc-base#146 to bump up it up to 7.0.0. That shaves off ~8K.

@haszi
Copy link
Contributor

haszi commented Aug 28, 2024

Could you also add a test showing how the changelog entries are now indexed and another one that shows that whatever was not properly linked after the first commit is now being linked correctly?

@jimwins jimwins requested a review from haszi August 28, 2024 23:14
@jimwins
Copy link
Member Author

jimwins commented Sep 2, 2024

Will merge this once php/doc-en#3672 is approved and merged, I'd rather not merge this and end up with the messy changelog that results without those cleanups.

@jimwins jimwins merged commit 417b066 into php:master Sep 23, 2024
9 checks passed
@jimwins jimwins deleted the fix-changelog-handling branch September 23, 2024 18:16
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.

4 participants