Commit bfee33bf authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'single-codebase-changelogs' into 'master'

Fix changelog generation for the single codebase

Closes #32040

See merge request gitlab-org/gitlab!16826
parents 016b4f81 9e163787
......@@ -15,7 +15,8 @@ Options = Struct.new(
:force,
:merge_request,
:title,
:type
:type,
:ee
)
INVALID_TYPE = -1
......@@ -85,6 +86,10 @@ class ChangelogOptionParser
options.type = parse_type(value)
end
opts.on('-e', '--ee', 'Generate a changelog entry for GitLab EE') do |value|
options.ee = value
end
opts.on('-h', '--help', 'Print help message') do
$stdout.puts opts
raise Done.new
......@@ -249,7 +254,7 @@ class ChangelogEntry
end
def ee?
@ee ||= File.exist?(File.expand_path('../CHANGELOG-EE.md', __dir__))
options.ee
end
def branch_name
......
......@@ -12,6 +12,12 @@ You can create one with:
bin/changelog -m %<mr_iid>s "%<mr_title>s"
```
If you want to create a changelog entry for GitLab EE, run the following instead:
```
bin/changelog --ee -m %<mr_iid>s "%<mr_title>s"
```
Note: Merge requests with %<labels>s do not trigger this check.
MSG
......
......@@ -102,6 +102,13 @@ Its simplest usage is to provide the value for `title`:
bin/changelog 'Hey DZ, I added a feature to GitLab!'
```
If you want to generate a changelog entry for GitLab EE, you will need to pass
the `--ee` option:
```text
bin/changelog --ee 'Hey DZ, I added a feature to GitLab!'
```
At this point the script would ask you to select the category of the change (mapped to the `type` field in the entry):
```text
......@@ -131,9 +138,6 @@ author:
type:
```
If you're working on the GitLab EE repository, the entry will be added to
`ee/changelogs/unreleased/` instead.
### Arguments
| Argument | Shorthand | Purpose |
......
......@@ -69,6 +69,14 @@ describe 'bin/changelog' do
end
end
it 'parses --ee and -e' do
%w[--ee -e].each do |flag|
options = described_class.parse(%W[foo #{flag} security])
expect(options.ee).to eq true
end
end
it 'parses -h' do
expect do
expect { described_class.parse(%w[foo -h bar]) }.to output.to_stdout
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment