-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
build, doc: use new api doc tooling #57343
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
77ede22
to
3423c21
Compare
3423c21
to
451f8a7
Compare
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.
@flakey5 I guess you also need to check our GitHub Action Workflows, and also other mentions of these files within the source.
Like within the Contributor Docs, there is a file that describes how the legacy API doc tooling works, and I believe there are other references also.
cf2609b
to
a3ce99d
Compare
It also looks like |
Also not sure what's going on with |
REPLACEME shouldn't error, imo, just give a warning. Our linter should have warn and error levels. And yes introduced_in must be top level! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #57343 +/- ##
==========================================
- Coverage 90.23% 90.14% -0.10%
==========================================
Files 630 628 -2
Lines 185129 184619 -510
Branches 36234 36079 -155
==========================================
- Hits 167049 166420 -629
- Misses 11037 11211 +174
+ Partials 7043 6988 -55 🚀 New features to boost your workflow:
|
I’m not sure either, but I’ll check it out. |
On the README.md file you updated ( |
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.
This is the result of many months of arduous work between many awesome folks, including @flakey5 @AugustinMauroy @araujogui @ovflowd @avivkeller and others.
I'm so proud of what we are achieving here and this is a huge step towards a modern tooling and a revamped API docs within Node.js
Approving, as I believe this is ready!
cc @nodejs/collaborators can we have another approval here? 🙏 |
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.
RSLGTM because it is hard to review and outside of my comfort zone.
69bef76
to
dd55609
Compare
Hey everyone, The Website and Web-Infra teams have been looking into an issue where GitHub Actions seemed to report incorrect line numbers for Since Actions use a merge commit, the reported line numbers were actually correct in the main branch. The mismatch happened because the PR’s head branch was outdated—it didn’t have that merge commit, so it had older versions of the files. That made it look like the errors were in the wrong place. Once we updated the branch, everything lined up correctly, and the errors disappeared. That also explains why we couldn’t reproduce it locally—our branches didn’t include the merge commit. For more information on our investigation into this, please see this Slack thread. In short: everything was working fine; the GitHub UI's use of the outdated branch when showing flagged files just made it seem like it wasn’t. |
How is it working fine if it reports |
Apparently GitHub shows the file contents from files on the parent branch. So if the PR branch is out of sync with main, the api-docs-tooling is correctly reporting the files, but the GitHub PR diff is showing the files from |
The branch got rebased and it seems to be correctly saying which YAML blocks have errors. Although, cc @araujogui it'd be good if it shown the exact line within the YAML. |
I mean, not showing the correct line is indeed something we should try to fix (but IMO not blocking). However, I think a more problematic behavior is to report |
Currently, we have it setup to report
GitHub's behavior during a pull request (PR) process can cause discrepancies between what Here’s what happens:
However, the GitHub PR diff operates differently:
|
We treat REPLACEME as a warning, not an error. More to create a nudge to remind contributors to eventually change the REPLACEME to a version. |
Tests are failing due to nodejs/api-docs-tooling#228, however this function should be exported from Edit: Reverting @ nodejs/api-docs-tooling#237 |
The CI seems to be using Node v20, not sure if intentional. |
But FWIW @avivkeller let’s not use experimental features on the api doc tooling. Add the glob package back and lets just stay on the safe side :) |
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.
Issues that need to be addressed:
- We should keep the existing tests (at least for now, can be removed in a follow up).
- We should not report
REPLACEME
as an invalid version. - We should report invalid versions as a hard failure.
- It pretends it generates the docs for Node.js 22.14.0 instead of 24.0.0 🤨
make: *** No rule to make target 'out/doc/api/index.html'
There are some weird inconsistencies with the current docs, e.g. About this documentation
and Usage and example
are listed on a stand alone section in current nav menu, with this PR it's in the middle of the other pages. It uses Added In
instead of Added in
. It seems there have been a lot of (arguably small) decisions that were made. It'd be useful to have a list.
Contributors should never change REPLACEME to a version |
For background, the |
Those were already talked over when we were introducing the legacy-html generators on api-docs-tooling and we had the TSC chiming in and giving a 👍 ; I recall @targos provided a lot of good feedback when we introduced these generators. So intentionally, the new tooling is not providing an exact 1:1 match. But functionally it is an 1:1 match. We did deep comparisons between the HTML and contents. (But yes, there are some minor differences) |
That’s what I meant when I said contributors. Apologies for the poor explanation from my side! |
I recall there was a request from someone that we reported on that so that no one forgets to accidentally make a release without replacing all REPLACEME. |
Odd, it should be getting the version from the process variable. Running locally on main it gives me 24.0.0 (or something similar, gotta double check) |
Probably b/c you are using the built node executable, whereas this is building from v22.14.0 (Github Actions uses the latest LTS). |
There are already checks for that, added in #24575: Lines 1072 to 1078 in 1a6bef2
|
Switches over to using the new doc generation tooling. For more background on this, please see nodejs#52343 Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> Co-authored-by: Claudio W <cwunder@gnome.org>
ef6e54e
to
2ecd61f
Compare
Where was this seen? |
This has been addressed :-)
This can probably be solved by explicitly passing the version of Node.js we are trying to generate to the new tooling. IIRC there should be some parsing logic in the Makefile. (I think it's Line 895 in ca74d64
|
If you run |
@flakey5 have you restored index.md? |
|
||
node_use_icu = $(call available-node,"-p" "typeof Intl === 'object'") | ||
|
||
out/doc/api/%.json out/doc/api/%.html: doc/api/%.md tools/doc/generate.mjs \ |
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.
FWIW It's B/C this part was removed
Switches over to using the new doc generation tooling. For more background on this, please see #52343
Currently a draft just to get feedback on the approach to this integration.cc @nodejs/web-infra