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

Backticks in commit message results in missing text in the github release #870

Closed
rchl opened this issue Mar 2, 2022 · 12 comments · Fixed by #987
Closed

Backticks in commit message results in missing text in the github release #870

rchl opened this issue Mar 2, 2022 · 12 comments · Fixed by #987
Labels

Comments

@rchl
Copy link
Contributor

rchl commented Mar 2, 2022

I have included backticks in my commit message, for example here in the body of the commit:

refactor(options)!: remove deprecated "webpackConfig" (#394)

BREAKING CHANGE: Configure through the `publishRelease` object instead.

Then I've proceeded to release a new version which included this text properly in the CHANGELOG.md as:

### ⚠ BREAKING CHANGES

* **options:** Configure through the `publishRelease` object instead.

But the text included in the Github release was missing the text in the backticks entirely and looked something like this (I've now manually fixed it):

### ⚠ BREAKING CHANGES

* **options:** Configure through the  object instead.

(Ignore the fact that I have failed to include the commit summary in the "BREAKING CHANGE" section which makes this changelog somewhat confusing).

Repro steps:

  1. Check out the nuxt-community/sentry-module@9922247 commit
  2. Run yarn && yarn release major --preRelease=beta

The --preRelease stuff is likely not relevant but that's what I've used.
Also note that I haven't provided the GITHUB_TOKEN token so the github release was done manually through the browser. That's probably where it went wrong although I haven't noticed at first.

@webpro
Copy link
Collaborator

webpro commented Mar 21, 2022

Could you try with a GITHUB_TOKEN (and use the API instead of web url and UI) so we can pinpoint the issue a lot better, please?

@rchl
Copy link
Contributor Author

rchl commented Mar 24, 2022

So the text is missing already on running release script in the command line. This is even before the github page is opened. I've tried both with and without the GITHUB_TOKEN and the result is the same.

$ release-it major --preRelease=beta                                                                                                                                                                                                                                              
WARNING Environment variable "GITHUB_TOKEN" is required for automated GitHub Releases.
WARNING Falling back to web-based GitHub Release.
WARNING The recommended bump is "major", but is overridden with "major".

🚀 Let's release @nuxtjs/sentry (5.1.7...6.0.0-beta.0)


Changelog:
## [6.0.0-beta.0](https://github.com/nuxt-community/sentry-module/compare/v5.1.7...v6.0.0-beta.0) (2022-03-24)

### ⚠ BREAKING CHANGES
* **options:** Configure through the `publishRelease` object instead.
* **options:** The removed attachCommits and repo options can be
set through the publishRelease object.
* **deps:** To use the "publishRelease" option, it's now necessary
to manually install the `@sentry/webpack-plugin` package as a dev
dependency.
### Bug Fixes
* **deps:** make @sentry/webpack-plugin a peer dependency ([#390](https://github.com/nuxt-community/sentry-module/issues/390)) ([6b5e594](https://github.com/nuxt-community/sentry-module/commit/6b5e5946450420479ce642cdb7464f9ba2e3acf5))
* **deps:** update dependency @sentry/webpack-plugin to ^1.18.7 ([#392](https://github.com/nuxt-community/sentry-module/issues/392)) ([f72147f](https://github.com/nuxt-community/sentry-module/commit/f72147f4ce22836580e6bcac72a5314bd38c24e2))
* **deps:** update sentry dependencies ([#388](https://github.com/nuxt-community/sentry-module/issues/388)) ([5251cb6](https://github.com/nuxt-community/sentry-module/commit/5251cb64985c84dbed9841ea70bf5e6cf39ab5e9))

### Code Refactoring
* **options:** remove deprecated "attachCommits" and "repo" ([#393](https://github.com/nuxt-community/sentry-module/issues/393)) ([12b320c](https://github.com/nuxt-community/sentry-module/commit/12b320c1d30a90b5e21b99f2cf771244c95b23e7))
* **options:** remove deprecated "webpackConfig" ([#394](https://github.com/nuxt-community/sentry-module/issues/394)) ([6152957](https://github.com/nuxt-community/sentry-module/commit/6152957d0f1572d630fb119e4baa0d43a7ad568b))


Changeset:
 M CHANGELOG.md
 M package.json


Release notes:

### ⚠ BREAKING CHANGES
* **options:** Configure through the  object instead.
* **options:** The removed attachCommits and repo options can be
set through the publishRelease object.
* **deps:** To use the publishRelease option, it's now necessary
to manually install the  package as a dev
dependency.
### Bug Fixes
* **deps:** make @sentry/webpack-plugin a peer dependency ([#390](https://github.com/nuxt-community/sentry-module/issues/390)) ([6b5e594](https://github.com/nuxt-community/sentry-module/commit/6b5e5946450420479ce642cdb7464f9ba2e3acf5))
* **deps:** update dependency @sentry/webpack-plugin to ^1.18.7 ([#392](https://github.com/nuxt-community/sentry-module/issues/392)) ([f72147f](https://github.com/nuxt-community/sentry-module/commit/f72147f4ce22836580e6bcac72a5314bd38c24e2))
* **deps:** update sentry dependencies ([#388](https://github.com/nuxt-community/sentry-module/issues/388)) ([5251cb6](https://github.com/nuxt-community/sentry-module/commit/5251cb64985c84dbed9841ea70bf5e6cf39ab5e9))

### Code Refactoring
* **options:** remove deprecated attachCommits and repo ([#393](https://github.com/nuxt-community/sentry-module/issues/393)) ([12b320c](https://github.com/nuxt-community/sentry-module/commit/12b320c1d30a90b5e21b99f2cf771244c95b23e7))
* **options:** remove deprecated webpackConfig ([#394](https://github.com/nuxt-community/sentry-module/issues/394)) ([6152957](https://github.com/nuxt-community/sentry-module/commit/6152957d0f1572d630fb119e4baa0d43a7ad568b))

? Commit (chore: release 6.0.0-beta.0)? (Y/n) 

Notice that the Configure through the object instead line is missing content in the Release notes: section.

@rchl
Copy link
Contributor Author

rchl commented Mar 24, 2022

@webpro
Copy link
Collaborator

webpro commented Mar 25, 2022

Alright, thanks for clearing that up. Will investigate soon.

@webpro webpro added the bug label Mar 25, 2022
@stale
Copy link

stale bot commented Jun 19, 2022

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Jun 19, 2022
@rchl
Copy link
Contributor Author

rchl commented Jun 19, 2022

Still an issue. I'm short on time but might look at it myself if the resources are short on your side also.

@stale stale bot removed the wontfix label Jun 19, 2022
@stale
Copy link

stale bot commented Oct 16, 2022

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Oct 16, 2022
@rchl
Copy link
Contributor Author

rchl commented Oct 16, 2022

I've debugged it and figured out that this is due to using echo (per suggestion from #658) to process the github changelog before release:

  github: {
    release: true,
    releaseName: '${version}',
    releaseNotes: 'echo "${changelog}" | sed 1,2d'
  },

echo doesn't like backticks:

> echo "through the `publishRelease` object"
zsh: command not found: publishRelease
through the  object

So I guess I need to find some other command that will do the same job.

@rchl
Copy link
Contributor Author

rchl commented Oct 16, 2022

Using single quotes around ${changelog} would produce expected results if changelog would have single quotes escaped. Otherwise it will just cause errors if changelog has single quotes in it.

@stale stale bot removed the wontfix label Oct 16, 2022
@rchl
Copy link
Contributor Author

rchl commented Oct 16, 2022

I have been experimenting with supporting a JS function for releaseNotes:

  github: {
    release: true,
    releaseName: '${version}',
    releaseNotes (ctx) {
      // Remove first, redundant line with version and date.
      return ctx.changelog.split('\n').slice(1).join('\n')
    }
  },

I like this solution because it allows me to avoid slow shell scripts and is much simpler to deal with when it comes to weird escaping needed for shell scripts. And avoids dealing with horrible bash syntax (personal take).

That said, one wouldn't be able to use functions in json config so not sure if you are open to it and also, for consistency, we might have to (or want to) support the same in other options that currently run shell scripts...

@stale
Copy link

stale bot commented Jan 7, 2023

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Jan 7, 2023
@webpro
Copy link
Collaborator

webpro commented Mar 9, 2023

@rchl Sorry for the late reply. A function for releaseNotes would be great actually. You up for a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants