-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc,tools: get altDocs versions from CHANGELOG.md #27661
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code itself LGTM while I would prefer not to use a fixture. That could be done by
a) not reading the whole changelog entry but only a small top part of the file
b) by checking that the current output is the "minimum" expectation instead of the absolute truth and that there could be more versions and more lts
entries.
That way it would be easier to detect changes that might break this (e.g. parts of the file structure would be changed or old entries would be moved). That is not as likely but it still seems a possibility.
But I'm also fine with the code as is. This is definitely an improvement over the current situation!
I've just realised this isn't going to work as expected outside of Lines 170 to 181 in 07458ba
which allows docs for, e.g. Node.js 8, to point to newer versions, e.g. Node.js 10. |
And I've just realised that the table for Node.js 8 doesn't match the table in master: Lines 396 to 407 in b230833
LTS label from Node.js 4).
|
@richardlau we could check the file in the repository instead. That's not a great solution but it would at least always work in case there's a network connection. That way it's always up to date. |
Yeah, less than ideal but probably okay? I'll do that later (after I've eaten). I've pushed a change to remove the test fixture and do sanity checks on the versions (e.g. LTS releases are never odd numbered releases) rather than a deepStrictEqual assertion. |
@BridgeAR Quick thought -- If we're going to need a network connection we might be better off reading |
@richardlau I thought about that as well and it is indeed the perfect data. The reason why I still prefer the changelog approach right now is that it's another repository and we update that file manually. We did lack behind before (just a bit but still) and might forget to update that file at times while that would not happen with the changelogs. |
This comment has been minimized.
This comment has been minimized.
We did forget to update the list of versions in the changelog, see #27414 (this step is in the release process docs being proposed in #25497). I've kept with parsing the changelog for now (albeit the code now fetches the version from the master branch) since I'd already written the parsing regular expressions. Since the code now fetches from the master branch building the docs and the newly added test will make an Internet request. cc @nodejs/documentation |
@richardlau we could also just parse the filenames instead of reading the entries from the main changelog.md. I doubt that we'll ever forget a to add such entry. But I'm actually happy with either implementation as long as it automates the process. The test itself should probably be moved to |
@BridgeAR We won't be able to determine LTS status by just parsing filenames. I've moved the test to |
#27658 (comment) is also relevant here -- the LTS labels in current master don't seem correct. 4.x and 6.x are both EOL (and both were LTS previously), so they should have identical labelling (either both have LTS label or both not have it, or both have an EOL label). Refs: #20904 nodejs/Release#440 |
I pushed an update to #27658 that makes the LTS status consistent (both 4 and 6 no longer have it). Once the changelog is consistent this PR will make the LTS labels in the "View another version" drop down in the built docs consistent automatically (provided we keep the changelog accurate). |
@richardlau This is ready, right? Do you want to go ahead and land this? |
I think it was. It’s a long weekend here in UK (public holiday on Monday) so it’ll be Tuesday at the earliest before I can land this. |
Parse `CHANGELOG.md` for versions of Node.js used by the documentation feature `View another version` so that we don't have to manually update the list when we cut a new version or transition a release to LTS.
|
Still LGTM. |
I'd assumed (perhaps naively) that this LGTM should have satisfied -bash-4.2$ git-node land 27661
✔ Done loading data for nodejs/node/pull/27661
----------------------------------- PR info ------------------------------------
Title doc,tools: get altDocs versions from CHANGELOG.md (#27661)
⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch richardlau:autoaltdocs -> nodejs:master
Labels doc, review wanted, tools
Commits 1
- doc,tools: get altDocs versions from CHANGELOG.md
Committers 1
- Richard Lau <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/27661
Reviewed-By: Rich Trott <[email protected]>
--------------------------------------------------------------------------------
⚠ Commits were pushed since the last review:
⚠ - doc,tools: get altDocs versions from CHANGELOG.md
ℹ Last Full PR CI on 2019-05-29T12:26:38Z: https://ci.nodejs.org/job/node-test-pull-request/23453/
ℹ This PR was created on Sun, 12 May 2019 17:14:09 GMT
✔ Approvals: 1
✔ - Rich Trott (@Trott) (TSC): https://github.com/nodejs/node/pull/27661#pullrequestreview-236953915
--------------------------------------------------------------------------------
? This PR is not ready to land, do you want to continue? There's a couple of reasons for this:
|
Parse `CHANGELOG.md` for versions of Node.js used by the documentation feature `View another version` so that we don't have to manually update the list when we cut a new version or transition a release to LTS. PR-URL: nodejs#27661 Reviewed-By: Rich Trott <[email protected]>
Landed in 4ec6135 |
Parse `CHANGELOG.md` for versions of Node.js used by the documentation feature `View another version` so that we don't have to manually update the list when we cut a new version or transition a release to LTS. PR-URL: #27661 Reviewed-By: Rich Trott <[email protected]>
Parse `CHANGELOG.md` for versions of Node.js used by the documentation feature `View another version` so that we don't have to manually update the list when we cut a new version or transition a release to LTS. Backport-PR-URL: nodejs#32642 PR-URL: nodejs#27661 Reviewed-By: Rich Trott <[email protected]>
Parse `CHANGELOG.md` for versions of Node.js used by the documentation feature `View another version` so that we don't have to manually update the list when we cut a new version or transition a release to LTS. Backport-PR-URL: #32642 PR-URL: #27661 Reviewed-By: Rich Trott <[email protected]>
Parse
CHANGELOG.md
for versions of Node.js used by the documentationfeature
View another version
so that we don't have to manually updatethe list when we cut a new version or transition a release to LTS.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes