Skip to content
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

✨ Add path arg to filter commits #238

Closed
wants to merge 2 commits into from

Conversation

thlmenezes
Copy link

@thlmenezes thlmenezes commented Mar 6, 2022

Summary

TL;DR filter commits by path on changelog generation works, but untested.

As discussed in #158, after this comment. One of the tasks to enabling per monorepo package changelogs is to filter commits from a folder.

The dependency responsible for fetching raw commits enables the path option from git log as seen in the docs here

Help Needed

  • how to test this behavior with jest?
    • I've searched earlier this week how does git stores and tracks the folder structure, but could not understand enough to write a test case to improve code coverage with the new getCommits path option

Missing features

  • tests
  • docs

Test Plan

  • run
node packages/gitmoji-changelog-cli/src/index.js --path packages/gitmoji-changelog-cli
  • The command is expected to fail with FunctionalError: No changes found. You may need to fetch or pull the last changes.
  • Add a new comment to the selected testing folder (i.e packages/gitmoji-changelog-cli)
  • Rerun changelog command with path argument
  • The result will be something along the lines of
<a name="0.0.1"></a>
## 0.0.1 (2022-03-06)

### Miscellaneous

- 🚧 test commit [[2640d11](https://github.com/thlmenezes/gitmoji-changelog/commit/2640d110fa580f6591df4fa188772c1b99f1f3ad)]

For reference, without the path argument my changelog for this pr becomes

<a name="0.0.1"></a>
## 0.0.1 (2022-03-06)

### Added

- ✨ path option in generateChangelog [[66b0da7](https://github.com/thlmenezes/gitmoji-changelog/commit/66b0da7746e10ab04cecc6e510e9128570f6ef94)]
- ✨ path option to getCommits [[0b5eaef](https://github.com/thlmenezes/gitmoji-changelog/commit/0b5eaef34408d938a4d9c2c3f8134edf96f32d2c)]

### Miscellaneous

- 🚧 test commit [[2640d11](https://github.com/thlmenezes/gitmoji-changelog/commit/2640d110fa580f6591df4fa188772c1b99f1f3ad)]

@thlmenezes thlmenezes closed this Oct 13, 2023
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.

1 participant