Skip to content

[Website] Changelog component docs script format enhancements #2953

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

dchyun
Copy link
Contributor

@dchyun dchyun commented Jun 16, 2025

📌 Summary

If merged, this PR would update the script that generate component changelog entries to a new format, which would support the following enhancements in writing changelog entries.

  • Support for multi-line changes for one component
  • Remove the requirement that component names in the changelog match exactly to what the script expects

🛠️ Detailed description

New format

In the new format, changelog component entries must contain comments above and below each component entry that tell the script which portions to use in the appropriate component changelog files.

<!-- START components/name -->
`ComponentName` - Change description
<!-- END -->

The path used inside the comments directs the script to what website docs file to attach the entry. That path must match exactly. For example a change to the LinkStandalone would use the path components/links/standalone.

When the script is ran, these comments will be removed following parsing.

Testing

There is a temporary commit included in this PR that allows testing of the script locally. To test this change do the following:

  1. Cd into ./website
  2. Run pnpm generate-component-changelog-entries
  3. Review that the appropriate component changelog files have been updated, and the comments have been removed from the CHANGELOG.md and website release notes page.
  4. Do not commit any changes made

📸 Screenshots

Changeset file format

Before

`ComponentName` - This is a list of changes. Change one. Change two.

After

<!-- START components/name -->
`ComponentName` - This is a list of changes
- Change one
- Change two
<!-- END -->

🔗 External links

Jira ticket: HDS-4951


💬 Please consider using conventional comments when reviewing this PR.

📋 PCI review checklist
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've worked with GRC to document the impact of any changes to security controls.
    Examples of changes to controls include access controls, encryption, logging, etc.
  • If applicable, I've worked with GRC to ensure compliance due to a significant change to the in-scope PCI environment.
    Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.

Copy link

vercel bot commented Jun 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
hds-showcase ✅ Ready (Inspect) Visit Preview Jul 8, 2025 6:11pm
hds-website ✅ Ready (Inspect) Visit Preview Jul 8, 2025 6:11pm

@hashibot-hds hashibot-hds added packages/components docs-website Content updates to the documentation website labels Jun 16, 2025
heatherlarsen
heatherlarsen previously approved these changes Jul 7, 2025
Copy link
Contributor

@heatherlarsen heatherlarsen left a comment

Choose a reason for hiding this comment

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

@dchyun Love this change! 👏🏻

Copy link
Contributor

@didoo didoo left a comment

Choose a reason for hiding this comment

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

There is an issue with allComponentPaths being used as an object, where now is an array (and potentially is not needed anymore). Also, a few general observations:

Non-existing path (eg. for a typo)
This (wrong) case is not handled (I would expect an error to be thrown, so there is visibility that something was not correct in the format used:

<!-- START foo/bar -->
`Card` - Added something to the component
<!-- END foo/bar -->

Opening/Closing tags not matching (eg. for a typo)
Same as above, I think this should be handled too

<!-- START components/card -->
`Card` - Added something to the component
<!-- END cmnponents/car -->

(this leads me to a question: could the regex be this ^(<!-- START \[${componentName}\])((.|\n)*?)(<!-- END -->)$ and be run against this (simplified) format?

<!-- START [components/tag] -->
`Tag` - Test change
<!-- END -->

(I've added the [] for better readability; it's an idea, for your consideration)

@dchyun dchyun force-pushed the dchyun/changelog-script-enhancement branch from 3ecc9ea to 385e241 Compare July 8, 2025 18:03
@dchyun
Copy link
Contributor Author

dchyun commented Jul 8, 2025

@didoo I took your suggestion and updated the format slightly to no longer have the path in the "END" statement.

<!-- START components/tag -->
`Tag` - Test change
<!-- END -->

I also added in support for notifying the user of an incorrect component path. It will output a message in the console when the script is run with the name of the incorrect path.

No path found for changelog entry: components/missing-path

could the regex be this ^(<!-- START \[${componentName}\])((.|\n)*?)(<!-- END -->)$
(I've added the [] for better readability; it's an idea, for your consideration)

I tried adding this in with the regex you suggested, and ran into some issues with the regex parser no longer automatically escaping the / characters inside the componentName. I've kept it without the [] for now, but don't have a strong opinion and could look into it further if we want to adopt that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-website Content updates to the documentation website packages/components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants