Skip to content

Add and enable the validate-changelog-entry rule for validating Markdown-based changelog entries.#71

Merged
filipsobol merged 2 commits into
masterfrom
ck/18777-add-rule-to-validate-changelog-entry
Jul 10, 2025
Merged

Add and enable the validate-changelog-entry rule for validating Markdown-based changelog entries.#71
filipsobol merged 2 commits into
masterfrom
ck/18777-add-rule-to-validate-changelog-entry

Conversation

@filipsobol
Copy link
Copy Markdown
Member

@filipsobol filipsobol commented Jul 7, 2025

🚀 Summary

  • Add and enable the validate-changelog-entry rule for validating Markdown-based changelog entries.
  • Migrate CI from Machine executors to Docker executors.

📌 Related issues


💡 Additional information


Error highlighting

I implemented this rule so that it tracks the positions of invalid entries rather than highlighting the entire frontmatter block as invalid. This makes it much easier to locate the issue.

output.mp4

How to test

  1. Clone this repo into the external folder and check out the ck/18777-add-rule-to-validate-changelog-entry branch.
  2. Check out the ck/18777-lint-changelog-entries branches in the core and commercial repositories (core PR, commercial PR).
  3. Run yarn reinstall.
  4. Run yarn nice in both the core and commercial repositories, and experiment with the generated changelog file. Add valid and invalid values, remove values, etc., to verify that all cases are covered by the rule and that it doesn't break under any circumstances.

@filipsobol filipsobol marked this pull request as ready for review July 8, 2025 14:28
@filipsobol filipsobol changed the title [WIP] Add and enable validate-changelog-entry rule for validating Markdown-based changelog entries. Add and enable the validate-changelog-entry rule for validating Markdown-based changelog entries. Jul 8, 2025
plugins: {
markdown
},
language: 'markdown/gfm',
Copy link
Copy Markdown
Member Author

@filipsobol filipsobol Jul 8, 2025

Choose a reason for hiding this comment

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

Unlike other tests in this project, this one uses ESM. This is because otherwise ESLint fails to load the markdown/gfm language.

However, because all tests are loaded using require() I had to update our CI configuration to use Node 22.12, which added support for require(esm). This is the same change we recently implemented in other repositories.

Comment thread .circleci/config.yml
Comment on lines +83 to +84
docker:
- image: cimg/node:22.12.0
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@filipsobol filipsobol force-pushed the ck/18777-add-rule-to-validate-changelog-entry branch from 129b41f to 7a68166 Compare July 9, 2025 08:49
@filipsobol filipsobol linked an issue Jul 9, 2025 that may be closed by this pull request
const yaml = require( 'yaml' );

const ALLOWED_TYPES = {
single: [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps we could follow DRY principle, and extract common values to a common key, and create a function that would return joined list? Then again, its just twice, so I'm, not really insisting here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

IMO that will overcomplicate a pretty simple bit of code. Pulling things out and adding a function would just add unnecessary abstraction without much real benefit here.

@filipsobol filipsobol merged commit 57b894f into master Jul 10, 2025
3 checks passed
@filipsobol filipsobol deleted the ck/18777-add-rule-to-validate-changelog-entry branch July 10, 2025 08:52
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.

Create a rule for checking changelog entry files

2 participants