Repository navigation
Conversation
Rename the url rows to uri to match 3e2e806, add the sbom row to artifact published, and drop the severity row that was copied into testCaseRun skipped. Add a check to tools/validate.js that fails when an event table and its schema list different fields. Refs cdevents#342 Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
afrittoli
approved these changes
Nov 23, 2026
afrittoli
left a comment
Member
There was a problem hiding this comment.
Thanks for this PR, it's much appreciated!
We discussed in the past generating these docs, and that's still my preferred direction. However this PR provides a useful intermediate step until doc generation can be tackled.
One thing that your work made me realize is that we have no docs for the approval events. This is something we should have detected, and it would be great if CI could help us from making that mistake in the future.
An example of how CI could behave:
- Collect the event schemas. Take every top-level schemas/*.json file (the _defs/, links/ and registry/ folders are excluded automatically) and keep the ones whose context.type enum starts with dev.cdevents.
- Collect the documented events. Walk the docs as the PR does now. While walking, also flag any ### heading that links to conformance/ but doesn't match the heading regex, so a typo in a heading fails instead of being skipped silently.
- Compare the two sets:
- An event in a doc with no schema is an error (today the script stops with a fatal error from loadJSON).
- A schema with no doc table is an error, unless it is on the allowlist.
- A schema with a doc table goes through the field comparison the PR already does.
- Allowlist the current gap, for example:
// Event schemas with no doc section yet; remove an entry once its docs land
const UNDOCUMENTED_EVENTS = ["approvalcreated", "approvalupdated", "approvalclosed"];
If an allowlisted schema gets a doc table, the script should also fail, so the entry is removed and can't hide a later regression. - Optionally, find the docs by search. SPEC_DOCS is hard-coded, so a new event doc that isn't added to it would never be checked. The script could scan every .md at the repo root for headings that link to conformance/.json. README.md would need excluding: it mentions the conformance folder, though not in an event heading.
This can be follow-up work if you are interested.
Author
|
thx! Makes sense, I'm happy to take the coverage check as a follow-up once this lands, approval events allowlisted like you sketched. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Refs #342
This fixes the field name gaps from #342. The
urlrows becomeurito match the rename in 3e2e806, artifact published gets thesbomrow its schema already has, and I dropped theseverityrow from testCaseRun skipped. That row came in with the skipped event as a copy from finished ('Severity if the test failed'), and the schema never had it.I also added a step to tools/validate.js that reads the field table under each event heading and fails if it lists different fields than
subject.contentin the schema, so this can't drift again. It only compares names. The required-flag mismatches listed in #342 are still open, since I'm not sure which side is right there.Submitter Checklist
As the author of this PR, please check off the items in this checklist: