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 commitizen changelog generation and automatic release task #138

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tfiedlerdejanze
Copy link
Owner

@tfiedlerdejanze tfiedlerdejanze commented Jun 13, 2024

Resolves #136 and #31

@coveralls
Copy link

coveralls commented Jun 13, 2024

Pull Request Test Coverage Report for Build 9fe0a054ad74d6996c1a4a2e91d140d34bca5e43-PR-138

Details

  • 8 of 41 (19.51%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-13.5%) to 79.167%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/expublish/semver.ex 0 8 0.0%
lib/expublish/changelog.ex 0 12 0.0%
lib/expublish/git.ex 1 14 7.14%
Totals Coverage Status
Change from base Build 67e626d641efcdb237ba7935ee9150d84a65c74b: -13.5%
Covered Lines: 171
Relevant Lines: 216

💛 - Coveralls

|> Logger.info()

{"123 feat: some commit\n456 fix: another commit", 0}
end
Copy link
Owner Author

Choose a reason for hiding this comment

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

Time to use something like Mox

@coveralls
Copy link

coveralls commented Jun 13, 2024

Pull Request Test Coverage Report for Build 62aec3021fe7db964e916c870ecada2ba4e64b3a-PR-138

Details

  • 26 of 41 (63.41%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-5.2%) to 87.5%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/expublish/changelog.ex 9 12 75.0%
lib/expublish/semver.ex 4 8 50.0%
lib/expublish/git.ex 6 14 42.86%
Totals Coverage Status
Change from base Build 67e626d641efcdb237ba7935ee9150d84a65c74b: -5.2%
Covered Lines: 189
Relevant Lines: 216

💛 - Coveralls

collect(rest, %__MODULE__{acc | all: [commit | acc.all], feature: [commit | acc.feature]})
end

defp collect(["BREAKING CHANGE" <> _ = commit | rest], acc) do
Copy link

@marc0s marc0s Jul 23, 2024

Choose a reason for hiding this comment

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

If I understand correctly the specification, BREAKING CHANGE: is not a valid type for a commit. That is, a commit subject cannot start with BREAKING CHANGE: <description>.

BREAKING CHANGE (or BREAKING-CHANGE) is a valid token to be found in the footer.

If we want to indicate a breaking change by looking only at the first line of the commit, we should look for a ! after the commit type (or scope), like in fix!: some fix that is also a breaking change or fix(parser)!: some fix to the parser that is a breaking change.

Unfortunately, this implies --oneline cannot be used https://github.com/tfiedlerdejanze/expublish/pull/138/files#diff-2c4e7ba552cf4684b4bc0dd08450ff59592e3e8b06e4675ef3aa3f580862f0bbR74 as we need the full commit message to look for a possible BREAKING CHANGE token.

Copy link

Choose a reason for hiding this comment

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

A naïve attempt to be closer to the spec wrt breaking changes(while still using --oneline for fetching commits): marc0s@ecae0d0

@marc0s
Copy link

marc0s commented Jul 23, 2024

I've done a quick test after adding some fixes to a repo and running mix explublish.release --dry-run and it looks good! 😄

Allow me to point out some stuff I'm used to after years of using NodeJS' semantic-release, all cosmetic stuff:

  • I like to have each of the commits that are inserted into the CHANGELOG.md file to have a link to the commit in the corresponding forge (github, gitlab, ...) for quick access to it when reading the change log in the web (* commit description ([deadbeef](https://gitlab.com/myteam/myrepo/commit/deadbeefacab657fcc228cc930a9aa8e7fb0b5d)))
  • As with the commits, the tags are also linked to the "compare" view of the website between the tag and the previous one (# [1.1.0](https://gitlab.com/myteam/myproject/compare/v1.0.7...v1.1.0) (2024-06-27))

Thanks for the work and apologizes for my so late review 🙏

marc0s added a commit to marc0s/expublish that referenced this pull request Jul 23, 2024
An intermediate change to fully support the commitizen spec where
commit types can be suffixed with `!` to indicate a breaking change.

Remove the invalid type `BREAKING CHANGE`.

See: tfiedlerdejanze#138 (review)
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.

Full release process support
3 participants