-
Notifications
You must be signed in to change notification settings - Fork 8
Merge Request ID for GitLab #29
Comments
what's your |
The commit object in my initial comment is based on calling the parser without any custom configuration. I then modified the I then, based on your suggestion, modified the |
Why don't you use If you treat it as a reference it should still work. Can you set a break point at https://github.com/conventional-changelog/conventional-commits-parser/blob/master/lib/parser.js#L99-L127 and see what you've got? |
@stevemao thanks for the pointer! I'll give that a try next. I haven't had an opportunity to look into |
Provided custom values for the suggested arguments as shown below: {
mergePattern: /^Merge branch '(.*)' into '(.*)'$/,
mergeCorrespondence: ['source', 'destination'],
} With that I received the following commit object for the merge commit: { type: null,
scope: null,
subject: null,
source: 'docs/readme',
destination: 'master',
merge: 'Merge branch \'docs/readme\' into \'master\'',
header: 'Docs/readme',
body: 'See merge request !1',
footer: null,
notes: [],
references: [],
mentions: [],
revert: null } So it's now successfully detecting the merge header. That still doesn't give me access to the merge request ID. Therefore I extended the custom options: {
mergePattern: /^Merge branch '(.*)' into '(.*)'$/,
mergeCorrespondence: ['source', 'destination'],
issuePrefixes: ['#', '!'],
referenceActions: [ 'close', 'closes', 'closed', 'fix', 'fixes', 'fixed', 'resolve', 'resolves', 'resolved', 'See merge request' ] By specifying the { type: null,
scope: null,
subject: null,
source: 'docs/readme',
destination: 'master',
merge: 'Merge branch \'docs/readme\' into \'master\'',
header: 'Docs/readme',
body: null,
footer: 'See merge request !1',
notes: [],
references:
[ { action: 'See merge request',
owner: null,
repository: null,
issue: '1',
raw: '!1',
prefix: '!' } ],
mentions: [],
revert: null } So as you noted, that gives me access to the ID number, and I can tell it's a merge request because of the prefix. Oddly, now, if I just set the I must have made a mistake somewhere then. I'll be able to move forward with my own project now that I can get at the merge ID. Thank you for your help with tackling my issue. |
I created a merge request on GitLab, leaving the title of the merge request as the default (the header line of my commit). Therefore it was
Docs/readme
.Upon accepting the merge request I ended up with a merge commit in my history that looks like:
When running the commit through
conventional-commits-parser
I end up with the following commit object:It seems the line containing
!1
is not parsed out.I changed
issuePrefix
to include!
, but since the merge request ID is not part of the footer, I can't get the merge request ID as an issue reference.The text was updated successfully, but these errors were encountered: