From 4c9bdb759b9f324ad4fae5178dbe2ce60d6682e0 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Wed, 16 Oct 2019 15:24:38 +0200 Subject: [PATCH 1/2] OPENEUROPA-0000: Allow to specify a release branch for the changelog generation command. --- src/Commands/ChangelogCommands.php | 9 +++++++-- tests/fixtures/simulation.yml | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/Commands/ChangelogCommands.php b/src/Commands/ChangelogCommands.php index 1b4abe95..3d5033e1 100644 --- a/src/Commands/ChangelogCommands.php +++ b/src/Commands/ChangelogCommands.php @@ -31,8 +31,9 @@ public function getConfigurationFile() * * @command changelog:generate * - * @option token GitHub personal access token, to generate one visit https://github.com/settings/tokens/new - * @option tag Upcoming tag you wish to generate a new changelog entry for. + * @option token GitHub personal access token, to generate one visit https://github.com/settings/tokens/new + * @option tag Upcoming tag you wish to generate a new changelog entry for. + * @option release-branch Limit pull requests to a specific branch. * * @aliases changelog:g,cg * @@ -43,6 +44,7 @@ public function getConfigurationFile() public function generateChangelog(array $options = [ 'token' => InputOption::VALUE_REQUIRED, 'tag' => InputOption::VALUE_OPTIONAL, + 'release-branch' => InputOption::VALUE_OPTIONAL, ]) { $projectName = $this->getComposer()->getName(); @@ -50,6 +52,9 @@ public function generateChangelog(array $options = [ if (!empty($options['tag'])) { $exec .= " --future-release={$options['tag']}"; } + if (!empty($options['release-branch'])) { + $exec .= " --release-branch={$options['release-branch']}"; + } $task = $this->taskDockerRun('muccg/github-changelog-generator') ->option('rm') diff --git a/tests/fixtures/simulation.yml b/tests/fixtures/simulation.yml index 0d60fb4a..2a2f93b7 100644 --- a/tests/fixtures/simulation.yml +++ b/tests/fixtures/simulation.yml @@ -124,7 +124,7 @@ contains: - "exec('foo/bar -t abc --future-release=1.2.3')" -- command: 'changelog:generate --token 123 --tag 1.2.3' +- command: 'changelog:generate --release-branch foo' configuration: github: token: "abc" @@ -133,7 +133,18 @@ "name": "foo/bar" } contains: - - "exec('foo/bar -t 123 --future-release=1.2.3')" + - "exec('foo/bar -t abc --release-branch=foo')" + +- command: 'changelog:generate --token 123 --tag 1.2.3 --release-branch foo' + configuration: + github: + token: "abc" + composer: > + { + "name": "foo/bar" + } + contains: + - "exec('foo/bar -t 123 --future-release=1.2.3 --release-branch=foo')" - command: 'drupal:site-post-install' configuration: From 1e2d1e6f856470a176f7397924688b8bf00554c1 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Wed, 16 Oct 2019 15:42:25 +0200 Subject: [PATCH 2/2] OPENEUROPA-0000: Improve parameter description. --- src/Commands/ChangelogCommands.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/ChangelogCommands.php b/src/Commands/ChangelogCommands.php index 3d5033e1..8bef6d07 100644 --- a/src/Commands/ChangelogCommands.php +++ b/src/Commands/ChangelogCommands.php @@ -33,7 +33,7 @@ public function getConfigurationFile() * * @option token GitHub personal access token, to generate one visit https://github.com/settings/tokens/new * @option tag Upcoming tag you wish to generate a new changelog entry for. - * @option release-branch Limit pull requests to a specific branch. + * @option release-branch Limit list of changes that went into a specific release branch. * * @aliases changelog:g,cg *