Skip to content

Fix path-resolution bug in changenotes.mts validate by using getChangenotes - #4156

Draft
mario-campos wants to merge 13 commits into
mainfrom
mario-campos/fix-validate-cmd
Draft

mario-campos wants to merge 13 commits into
mainfrom
mario-campos/fix-validate-cmd

Conversation

@mario-campos

@mario-campos mario-campos commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

isValidChangenoteFile receives a file name (no leading path) and then attempts to read that file, regardless of the CWD. If the user's CWD is not in unreleased-change-notes, then the command will likely fail to open the file.

Incidentally, for #4155, I've added getChangenotes, which consolidates some duplicative code between the assemble and validate commands. We can take advantage of that here in validate, and in so doing, fix the bug.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Which use cases does this change impact?

Workflow types:

  • N/A

Products:

  • N/A

Environments:

  • Testing/None - This change does not impact any CodeQL workflows in production.

How did/will you validate this change?

  • Unit tests - I am depending on unit test coverage (i.e. tests in .test.ts files).

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • Development/testing only - This change cannot cause any failures in production.

How will you know if something goes wrong after this change is released?

  • N/A

Are there any special considerations for merging or releasing this change?

  • No special considerations - This change can be merged at any time.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

Changing `NO_CHANGES_STR` to just be the text will make it easier to insert/use. To not break anything, I added the deleted newlines to the locations where `NO_CHANGES_STR` was used.
This will be used by the `pr-checks/changenotes.mts` script to "compile" the latest release entry of CHANGELOG.md.
This command will "flush" or move the changenotes in the `unreleased-change-notes` directory to the `[UNRELEASED]` section of the CHANGELOG.md file.
@github-actions github-actions Bot added the size/XS Should be very easy to review label Sep 18, 2026
@mario-campos
mario-campos force-pushed the mario-campos/fix-validate-cmd branch from fc0dbb2 to dedce4e Compare September 18, 2026 20:09
@github-actions github-actions Bot added size/L May be hard to review and removed size/XS Should be very easy to review labels Sep 18, 2026
@mario-campos mario-campos changed the title Fix path-resolution bug in changenotes.mts validate command Fix path-resolution bug in changenotes.mts validate by using getChangenotes Sep 18, 2026
Comment thread pr-checks/changelog/validate.mts Fixed
This reduces duplicate code between `assemble` and `validate`. It also has the benefit of fixing a bug in the current implementation of `validate`, where `isValidChangenoteFile` receives a relative file name where it should receive an absolute one.
@mario-campos
mario-campos force-pushed the mario-campos/fix-validate-cmd branch from dedce4e to bf6da6f Compare September 18, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L May be hard to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants