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

Document how to configure what commit types are included in the changelog #511

Closed
jcornaz opened this issue Jul 31, 2020 · 4 comments · Fixed by #1162
Closed

Document how to configure what commit types are included in the changelog #511

jcornaz opened this issue Jul 31, 2020 · 4 comments · Fixed by #1162
Assignees
Labels
type: docs Improvement to the documentation for an API. type: process A process-related concern. May include testing, release, or the like.
Milestone

Comments

@jcornaz
Copy link

jcornaz commented Jul 31, 2020

This is a follow up on #459 which has been closed.

Yet, I still don't know how to configure release-please in order to include or exclude some commit types from the changelog generation.

@jcornaz jcornaz changed the title How to configure what commit types are included in the changelog Document how to configure what commit types are included in the changelog Jul 31, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Aug 1, 2020
@sofisl sofisl added type: docs Improvement to the documentation for an API. type: process A process-related concern. May include testing, release, or the like. labels Aug 3, 2020
@yoshi-automation yoshi-automation removed the triage me I really want to be triaged. label Aug 3, 2020
@jbottigliero
Copy link

I wanted to add a comment here based on implementing release-please in a few different repositories recently that may help with closing out this issue... or at the very least help someone finding this issue in the future!

It seems the configuration of changelogSections, at the moment, is heavily dependent on using the GitHub Action implementation. Using the action, you can simply configure changelog-types, which will map your configuration to the changelogSections option parsed by the factory.

When using release-please (via CLI) on its own, there doesn't appear to be a way to configure this value – this seems to be blocked by the usage of yargs.strict (and the missing option for changelogSections), in addition to the argument likely being too large for most default terminal sessions (see [1] below).

It is possible configure the value when using release-please programmatically:

Example
const ReleasePlease = require('release-please');
const chalk = require('chalk');

// @see https://github.com/googleapis/release-please/blob/master/src/bin/release-please.ts#L182
function handleError(err) {
  let status = '';
  const command = argv._.length === 0 ? '' : argv._[0];
  if (err.status) {
    status = '' + err.status;
  }
  console.error(chalk.red(`command ${command} failed${status ? ` with status ${status}` : ''}`));
  if (argv.debug) {
    console.error('---------');
    console.error(err.stack);
  }
  process.exitCode = 1;
}
const rp = ReleasePlease.ReleasePRFactory.build('node', {
  repoUrl: 'my-org/my-repository,
  packageName: 'my-package',
  defaultBranch: 'trunk',
  token: process.env.SENSATIVE_VALUE,
  changelogSections: [
    {type: 'feat', section: 'Features'},
    {type: 'fix', section: 'Bug Fixes'},
    {type: 'perf', section: 'Performance Improvements'},
    {type: 'deps', section: 'Dependencies'},
    {type: 'revert', section: 'Reverts'},
    {type: 'docs', section: 'Documentation'},
    {type: 'style', section: 'Styles'},
    {type: 'chore', section: 'Miscellaneous Chores'},
    {type: 'refactor', section: 'Code Refactoring'},
    {type: 'test', section: 'Tests'},
    {type: 'build', section: 'Build System'},
    {type: 'ci', section: 'Continuous Integration'}
  ]
});
rp.run().catch(handleError);

I'm currently using the above to trigger release-please with custom changelog sections using Google Cloud Build.


[1] In general, it seems like the release-please CLI might benefit from using yargs.pkgConf to support this feature from both the action and the CLI utility... but I'm not sure that is in line with the roadmap here.

I'd be happy to contribute toward documentation or potentially an update to the CLI with a little better understanding of planned changes. Regardless, I hope someone finds this information useful, and if I've misinterpreted any of the implementations do let me know and I'll update (or remove) this comment!

@bcoe
Copy link
Contributor

bcoe commented Oct 1, 2020

@jbottigliero would happily take your contributions 😄

It's not intentional that the CLI and the action have drifted apart, it was just that I wanted to get the feature shipped for someone who needed it in the action... you're probably right that we would do better to use an abstraction like pkgConf, it would be good to figure out a way to share as much code as possible between the CLI and action.

jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Oct 4, 2020
…ides option for using a configuration file for options.

- `changelog-sections` will now be parsed similar to the feature found in `release-please-action`
- Since this option is likely to be a bit unweildy in CLI contexts, the CLI now accepts a `--config` option to supply options from a JSON configuration file.

- A `--no-operation/--no-op` flag has been added to allow short-circuiting of Yargs `.command` handlers to apease tests (`nock`)

see: googleapis#511
jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Oct 4, 2020
…ides option for using a configuration file for options.

- `changelog-sections` will now be parsed similar to the feature found in `release-please-action`
- Since this option is likely to be a bit unwieldy in CLI contexts, the CLI now accepts a `--config` option to supply options from a JSON configuration file.

- A `--no-operation/--no-op` flag has been added to allow short-circuiting of Yargs `.command` handlers to appease tests (`nock`)

see: googleapis#511
jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Oct 4, 2020
- Moves Yargs command parser to an isolated file (for reuse and testing).
- Updates command handlers to use a shared "runner" module.
- Adds `changelog-types` option
- Adds ability to configure the CLI tool using a JSON file (via '--config' flag)

The intent of the runner is to introduce a new entrypoint to this package that can be used by consumers to centralize execution and configuration parsing (and mapping).

see googleapis#511
jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Oct 8, 2020
- Moves Yargs command parser to an isolated file (for reuse and testing).
- Updates command handlers to use a shared "runner" module.
- Adds `changelog-types` option
- Adds ability to configure the CLI tool using a JSON file (via '--config' flag)

The intent of the runner is to introduce a new entrypoint to this package that can be used by consumers to centralize execution and configuration parsing (and mapping).

see googleapis#511
jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Oct 8, 2020
- Moves Yargs command parser to an isolated file (for reuse and testing).
- Updates command handlers to use a shared "runner" module.
- Adds `changelog-types` option
- Adds ability to configure the CLI tool using a JSON file (via '--config' flag)

The intent of the runner is to introduce a new entrypoint to this package that can be used by consumers to centralize execution and configuration parsing (and mapping).

see googleapis#511
jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Oct 8, 2020
- Moves Yargs command parser to an isolated file (for reuse and testing).
- Updates command handlers to use a shared "runner" module.
- Adds `changelog-types` option
- Adds ability to configure the CLI tool using a JSON file (via '--config' flag)

The intent of the runner is to introduce a new entrypoint to this package that can be used by consumers to centralize execution and configuration parsing (and mapping).

see googleapis#511
jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Oct 8, 2020
- Moves Yargs command parser to an isolated file (for reuse and testing).
- Updates command handlers to use a shared "runner" module.
- Adds `changelog-types` option
- Adds ability to configure the CLI tool using a JSON file (via '--config' flag)

The intent of the runner is to introduce a new entrypoint to this package that can be used by consumers to centralize execution and configuration parsing (and mapping).

see googleapis#511
jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Nov 2, 2020
- Moves Yargs command parser to an isolated file (for reuse and testing).
- Updates command handlers to use a shared "runner" module.
- Adds `changelog-types` option
- Adds ability to configure the CLI tool using a JSON file (via '--config' flag)

The intent of the runner is to introduce a new entrypoint to this package that can be used by consumers to centralize execution and configuration parsing (and mapping).

see googleapis#511
jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Nov 11, 2020
- Moves Yargs command parser to an isolated file (for reuse and testing).
- Updates command handlers to use a shared "runner" module.
- Adds `changelog-types` option
- Adds ability to configure the CLI tool using a JSON file (via '--config' flag)

The intent of the runner is to introduce a new entrypoint to this package that can be used by consumers to centralize execution and configuration parsing (and mapping).

see googleapis#511
jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Nov 11, 2020
- Moves Yargs command parser to an isolated file (for reuse and testing).
- Updates command handlers to use a shared "runner" module in order to centralize execuation and configuration parsing.
- Adds `changelog-types` option
- Adds ability to configure the CLI tool using a JSON file (via '--config' flag)

see googleapis#511
@fhinkel fhinkel self-assigned this Dec 8, 2020
@fhinkel
Copy link
Contributor

fhinkel commented Dec 8, 2020

Greetings, we're closing this due to inactivity. Please let us know if the issue needs to be reopened.

@fhinkel fhinkel closed this as completed Dec 8, 2020
jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Dec 12, 2020
- Moves Yargs command parser to an isolated file (for reuse and testing).
- Updates command handlers to use a shared "runner" module in order to centralize execuation and configuration parsing.
- Adds `changelog-types` option
- Adds ability to configure the CLI tool using a JSON file (via '--config' flag)

see googleapis#511
jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Dec 30, 2020
- Moves Yargs command parser to an isolated file (for reuse and testing).
- Updates command handlers to use a shared "runner" module in order to centralize execuation and configuration parsing.
- Adds `changelog-types` option
- Adds ability to configure the CLI tool using a JSON file (via '--config' flag)

see googleapis#511
jbottigliero pushed a commit to jbottigliero/release-please that referenced this issue Jan 6, 2021
- Moves Yargs command parser to an isolated file (for reuse and testing).
- Updates command handlers to use a shared "runner" module in order to centralize execuation and configuration parsing.
- Adds `changelog-types` option
- Adds ability to configure the CLI tool using a JSON file (via '--config' flag)

see googleapis#511
@tswast tswast reopened this Dec 1, 2021
@tswast
Copy link

tswast commented Dec 1, 2021

Now that this has been refactored, I know even less about where the default changelog sections are (nor how to override them) #1104 (review)

@fhinkel fhinkel removed their assignment Dec 2, 2021
@chingor13 chingor13 added this to the v13 milestone Dec 22, 2021
@chingor13 chingor13 self-assigned this Dec 22, 2021
gcf-merge-on-green bot pushed a commit that referenced this issue Dec 22, 2021
🤖 I have created a release \*beep\* \*boop\*
---
## [13.0.0](https://www.github.com/googleapis/release-please/compare/v12.6.0...v13.0.0) (2021-12-22)


### ⚠ BREAKING CHANGES

* releasers are now "strategies", more logic moved into base classes
* Node 12 is now required
* manifest is now main entrypoint for release please, and logic is shared between mono-repo/split-repo flow
* versioning straregy now handled by VersionStrategies rather than regexes
* merge Manifest and standard PR paths (#1104)

### Features

* add `includeComponentInTag` option for strategies and hook up to `--monorepo-tags` ([#1119](https://www.github.com/googleapis/release-please/issues/1119)) ([bf9aacd](https://www.github.com/googleapis/release-please/commit/bf9aacdde3a97c453f6e3280035607c97c7dffcd))
* add ability to override merged commit message ([#1161](https://www.github.com/googleapis/release-please/issues/1161)) ([c568b57](https://www.github.com/googleapis/release-please/commit/c568b57280f2048f6dabbb716cdb4174c3386b91)), closes [#967](https://www.github.com/googleapis/release-please/issues/967)
* add GitHub changelog notes generator ([#1120](https://www.github.com/googleapis/release-please/issues/1120)) ([1470661](https://www.github.com/googleapis/release-please/commit/1470661bd76a1e731585ed3fbf7363224c7a7a3e))
* enable specifying changelog section headings in the CLI ([#1162](https://www.github.com/googleapis/release-please/issues/1162)) ([aaa8342](https://www.github.com/googleapis/release-please/commit/aaa8342cd48062c56fe87b3296904274b7fb9dbe)), closes [#511](https://www.github.com/googleapis/release-please/issues/511)
* **go:** add support for bumping a Go version file ([#1112](https://www.github.com/googleapis/release-please/issues/1112)) ([8f6e52b](https://www.github.com/googleapis/release-please/commit/8f6e52b27811e6838800c7152be74e13201eb9e1))
* reimplement custom pull request title ([#1122](https://www.github.com/googleapis/release-please/issues/1122)) ([2f3e84c](https://www.github.com/googleapis/release-please/commit/2f3e84c8c51f367cad8baae44c8d9f0727aa02a5))
* reimplement Java 1.0.0 special version bumping ([#1126](https://www.github.com/googleapis/release-please/issues/1126)) ([28bc76b](https://www.github.com/googleapis/release-please/commit/28bc76b35d9e1eff218a5be1b9b8cebb4b1e6f9d))
* return path along with created release ([#1114](https://www.github.com/googleapis/release-please/issues/1114)) ([81fc0f4](https://www.github.com/googleapis/release-please/commit/81fc0f49d75ec66ef1915be26330734abddd11d7))


### Bug Fixes

* add back version/major/minor/patch ([#1118](https://www.github.com/googleapis/release-please/issues/1118)) ([4b6ae50](https://www.github.com/googleapis/release-please/commit/4b6ae5049e39e6f5bca10b514256090ea76ef5bd))
* allow setting release-type at root of manifest config ([#1159](https://www.github.com/googleapis/release-please/issues/1159)) ([fc73b6d](https://www.github.com/googleapis/release-please/commit/fc73b6dd3f5f7ed449b9d304e53bada911e3190f))
* backfill commit files ([#1110](https://www.github.com/googleapis/release-please/issues/1110)) ([173ce70](https://www.github.com/googleapis/release-please/commit/173ce704c9413d7f0da820fdd2961166a5ff0b73))
* backfill latest release with version found in manifest ([#1131](https://www.github.com/googleapis/release-please/issues/1131)) ([94859a0](https://www.github.com/googleapis/release-please/commit/94859a0cfbc58724016daaefaca03f34a43e0473))
* **cli:** pass pull-request-title-pattern ([#1128](https://www.github.com/googleapis/release-please/issues/1128)) ([28d7727](https://www.github.com/googleapis/release-please/commit/28d7727bc827612b02a8fde58d13cd87f962a399))
* combined manifest PR should include labels ([#1137](https://www.github.com/googleapis/release-please/issues/1137)) ([d8bb7ca](https://www.github.com/googleapis/release-please/commit/d8bb7caddfa14aabd3bfa19008c10ed911638a66))
* fallback to look at releases when looking for latest release ([#1146](https://www.github.com/googleapis/release-please/issues/1146)) ([76ed1a7](https://www.github.com/googleapis/release-please/commit/76ed1a77e64f28b0af7d8125dce457b885f80e52))
* fallback to look at tags when looking for latest release ([#1160](https://www.github.com/googleapis/release-please/issues/1160)) ([e06c6ba](https://www.github.com/googleapis/release-please/commit/e06c6ba5c3ce29689275e495934d4a6785962d5b))
* GitHub#findFilesByExtension should treat prefix as a directory ([#1165](https://www.github.com/googleapis/release-please/issues/1165)) ([b48ec5b](https://www.github.com/googleapis/release-please/commit/b48ec5bc285233436d7cb1b367326a3c6dd555a9))
* **github:** correctly return maxResults releases ([#1134](https://www.github.com/googleapis/release-please/issues/1134)) ([25f6811](https://www.github.com/googleapis/release-please/commit/25f68113d0e0bfa5a181d616c11bfd5e573cfaf5))
* make PullRequest, ReleasePullRequest, Version fields readonly ([#1150](https://www.github.com/googleapis/release-please/issues/1150)) ([9659c1c](https://www.github.com/googleapis/release-please/commit/9659c1c868395394a40ff8f6caf9aaa7998fb8b8))
* Manifest.fromConfig can find latest release version without component ([#1123](https://www.github.com/googleapis/release-please/issues/1123)) ([0aeb67b](https://www.github.com/googleapis/release-please/commit/0aeb67b4c4a497b5570bdec10f5ab15e620b235d))
* merge manifest release PRs unless separatePullRequests is configured ([#1129](https://www.github.com/googleapis/release-please/issues/1129)) ([328009d](https://www.github.com/googleapis/release-please/commit/328009d10b4609441a6f8432fa0d2aa9df1f5ff0))
* only backfill files if requested ([#1151](https://www.github.com/googleapis/release-please/issues/1151)) ([ae007fe](https://www.github.com/googleapis/release-please/commit/ae007feb430e97f2995d6fd431f2825512651e3a))
* reimplement draft releases ([#1111](https://www.github.com/googleapis/release-please/issues/1111)) ([6f38b4a](https://www.github.com/googleapis/release-please/commit/6f38b4aa5a206b358468e623a020ef715257ddfe))
* **rust:** Don't update dev-dependencies lacking a version key ([#1095](https://www.github.com/googleapis/release-please/issues/1095)) ([#1152](https://www.github.com/googleapis/release-please/issues/1152)) ([56f37d9](https://www.github.com/googleapis/release-please/commit/56f37d997c75ec5bcc330b08b0e9e25c68329b7a)), closes [#1094](https://www.github.com/googleapis/release-please/issues/1094)
* switch branch delimiter to `--` ([#1127](https://www.github.com/googleapis/release-please/issues/1127)) ([26442f1](https://www.github.com/googleapis/release-please/commit/26442f14356c387c9117f5d660b532185c8084c4))


### Code Refactoring

* manifest is now main entrypoint for release please, and logic is shared between mono-repo/split-repo flow ([fd8f9fc](https://www.github.com/googleapis/release-please/commit/fd8f9fc82838f3a3a05470dfe4dab4d3b47c6fa1))
* merge Manifest and standard PR paths ([#1104](https://www.github.com/googleapis/release-please/issues/1104)) ([fd8f9fc](https://www.github.com/googleapis/release-please/commit/fd8f9fc82838f3a3a05470dfe4dab4d3b47c6fa1))
* Node 12 is now required ([fd8f9fc](https://www.github.com/googleapis/release-please/commit/fd8f9fc82838f3a3a05470dfe4dab4d3b47c6fa1))
* releasers are now "strategies", more logic moved into base classes ([fd8f9fc](https://www.github.com/googleapis/release-please/commit/fd8f9fc82838f3a3a05470dfe4dab4d3b47c6fa1))
* versioning straregy now handled by VersionStrategies rather than regexes ([fd8f9fc](https://www.github.com/googleapis/release-please/commit/fd8f9fc82838f3a3a05470dfe4dab4d3b47c6fa1))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: docs Improvement to the documentation for an API. type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants