saitho / semantic-release-backmerge

:twisted_rightwards_arrows: semantic-release plugin to back-merge a release into a develop branch
https://saitho.github.io/semantic-release-backmerge/
56 stars 11 forks source link

Improve logging #30

Closed kaerbr closed 2 years ago

kaerbr commented 2 years ago

Is there an existing issue for this?

Current Behavior

I ran into an issue where the backmerge was aborted due to:

[1:08:30 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ  Fetching all remotes.
[1:08:30 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ  Fetching latest commits from repository at "XXXXXXX".
[1:08:30 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ  Performing back-merge into branch "prerelease".
[1:08:30 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ  Branch is detached. Checking out master branch.
[1:08:30 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ  Checking out develop branch.
[1:08:30 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ℹ  Performing backmerge with "rebase" strategy.
[1:08:30 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ✖  Process aborted due to an error while backmerging a branch.
[1:08:30 PM] [semantic-release] [@saithodev/semantic-release-backmerge] › ✖  Error: Command failed with exit code 1: git rebase origin/main 
error: cannot rebase: You have unstaged changes.
error: Please commit or stash them.
    at makeError (/usr/lib/node/lib/node_modules/@saithodev/semantic-release-backmerge/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/usr/lib/node/lib/node_modules/@saithodev/semantic-release-backmerge/node_modules/execa/index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

I fixed the cause but the logging gave me a bit of a headache. :D

We use the branches main and prerelease. Even though in the logs there are some lines which indicate that semantic-release-backmerge might use master or develop (lines: 4, 5 in the logs above).

Expected Behavior

If the branch names in the lines / the logging (see lines: 25, 27, 36, 55... in perform-backmerge.ts) would by dynamic this would have saved me a lot / a little bit of trouble. (:

In addition it would be really nice to list the unstaged changes. But I'm not totally sure if this is even possible. :D

Steps To Reproduce

  1. create a new project
  2. dont use/commit/update .gitignore
  3. see backmerge failing

Environment

- **semantic-release/semantic-release** version: 18.0.1 
- **@saithodev/semantic-release-backmerge** version: 2.1.0

Anything else?

My "Steps To Reproduce" are not that great but I think in this case the current and expected behavior is description enough. (:
If any help / pull-requests are desired I would be please to help! (:

saitho commented 2 years ago

Ah yes, I see. I'll add the actual branch names to the log messages.

kaerbr commented 2 years ago

Do you think its possible to add the unstaged changes to the logging? (:

saitho commented 2 years ago

:tada: This issue has been resolved in version 2.1.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: