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

feat(cmd-version): changelog available to bundle #779

Conversation

codejedi365
Copy link
Contributor

@codejedi365 codejedi365 commented Dec 21, 2023

Purpose

Adjust order of operations during semantic-release version command to build changelog prior to build_command execution.

Rationale

I desire to have the ability to generate the changelog and mark versions without creating a commit or tag, and also the ability to bundle the changelog into the bundle. This is currently unavailable due to the order of execution. This modification moves changelog generation up before the build command which allows the build_command to bundle it in. The commits don't change either but instead this consolidates adding to the index into one git command prior to the commit.

How did I test?

Successful refactor is captured by:

  • tests/command_line/test_version.py::test_version_only_update_files_no_git_actions() - where the CHANGELOG is now a part of the commit of changed files along with the other version modifications
  • tests/command_line/test_version.py::test_version_no_push_force_level() - where changelog is now a part of the commit of changed files along with the version modifications

How to verify

git fetch origin pull/779/head:pr-779

# checkout the PR as a detached HEAD state with only the unit tests
git checkout pr-779~1 --detach

# execute tests, # should fail
pytest tests/command_line/test_version.py

# update to the HEAD of the PR (with fixes)
git merge --ff-only pr-779

# run pytest again to see success
pytest tests/command_line/test_version.py

Review entire test suite to validate no regressions occurred (see CI pipeline results)

@codejedi365 codejedi365 force-pushed the feat/changelog-available-to-bundle branch 7 times, most recently from f90c616 to e10e2cb Compare December 23, 2023 15:05
@codejedi365 codejedi365 force-pushed the feat/changelog-available-to-bundle branch from 45ff8ff to 7f8ede7 Compare January 4, 2024 01:37
@codejedi365 codejedi365 force-pushed the feat/changelog-available-to-bundle branch 3 times, most recently from ccbde77 to 6cf00d0 Compare February 13, 2024 02:23
@codejedi365 codejedi365 force-pushed the feat/changelog-available-to-bundle branch 2 times, most recently from e981d11 to bf50c58 Compare March 2, 2024 03:50
@codejedi365 codejedi365 force-pushed the feat/changelog-available-to-bundle branch from bf50c58 to 8b1119b Compare March 19, 2024 02:04
@codejedi365 codejedi365 marked this pull request as ready for review March 19, 2024 02:11
@codejedi365 codejedi365 force-pushed the feat/changelog-available-to-bundle branch from 8b1119b to e476df9 Compare March 21, 2024 04:05
Removes the temporary release_notes hack to prevent CHANGELOG generation on
execution of version command.  Now that it is implemented we can remove the
fixture to properly pass the tests.
@codejedi365 codejedi365 force-pushed the feat/changelog-available-to-bundle branch from e476df9 to a5656c3 Compare March 21, 2024 04:07
@codejedi365 codejedi365 merged commit 37fdb28 into python-semantic-release:master Mar 21, 2024
7 checks passed
@codejedi365 codejedi365 deleted the feat/changelog-available-to-bundle branch March 21, 2024 04:15
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.

None yet

1 participant