feat: add new changelog command
Description
This MR adds a new changelog
command. The changelog
command is intended to interact with the GitLab changelog endpoint under the repository API. The only supported subcommand is changelog generate
, which in turn can optionally take all the optional attributes that can be specified in the REST call. The only attribute that is required by the endpoint is the "version" attribute, which is now inferred from the output of running git describe
.
Looking for suggestions on what additional tests should be added.
Related Issues
Resolves #1292 (closed)
How has this been tested?
- Added a unit test that calls
glab changelog generate
with--version
specified. - Added a unit test for the new
git.DescribeByTags
function. - Tested manually by running
glab changelog generate
with:-
--version
unspecified -
--version
specified -
--date
specified as an invalid date -
--date
specified as a valid date -
--trailer
specified as a non-default trailer (i.e.Signed-off-by
).
-
Screenshots (if appropriate):
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap
Merge request reports
Activity
Hey @michael-mead!
Thank you for your contribution to GitLab. Please refer to the contribution flow documentation for a quick overview of the process, and the merge request (MR) guidelines for the detailed process.
Did you know about our community forks? Working from there will make your contribution process easier. Please check it out!
Welcome to our community! We're excited to have you here, and can't wait to review this first MR with you!
When you're ready for a first review, post
@gitlab-bot ready
. If you know a relevant reviewer(s) (for example, someone that was involved in a related issue), you can also assign them directly with@gitlab-bot ready @user1 @user2
.At any time, if you need help, feel free to post
@gitlab-bot help
or initiate a mentor session on Discord. Read more on how to get help.This message was generated automatically. You're welcome to improve it.
added Community contribution workflowin dev labels
assigned to @michael-mead
added 1st contribution label
- Resolved by Oscar Tovar
@michael-mead Thanks for taking this on! WDYT about separating the dependency upgrade from the new feature? It'll make it easier to handle the changes for a review here.
Edited by Kai Armstrong
Implemented the
go-gitlab
dependency upgrade in !1224 (merged)Edited by Michael Meadadded 3 commits
-
97565082...f4a4590a - 2 commits from branch
gitlab-org:main
- b39e6938 - feat: add new changelog command
-
97565082...f4a4590a - 2 commits from branch
added 5 commits
-
b39e6938...af7cd633 - 4 commits from branch
gitlab-org:main
- f15f7320 - feat: add new changelog command
-
b39e6938...af7cd633 - 4 commits from branch
@gitlab-bot ready
added workflowready for review label and removed workflowin dev label
Hi
@aqualls
! Please review this documentation merge request. This message was generated automatically. You're welcome to improve it.added documentation twtriaged labels
requested review from @aqualls
@aqualls
, this Community contribution is ready for review.- Do you have capacity and domain expertise to review this? We are mindful of your time, so if you are not able to take this on, please re-assign to one or more other reviewers.
- Add the workflowin dev label if the merge request needs action from the author. This message was generated automatically. You're welcome to improve it.
Reviewer roulette
Changes that require review have been detected! A merge request is normally reviewed by both a reviewer and a maintainer in its primary category and by a maintainer in all other categories.
To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, mention them as you normally would! Danger does not automatically notify them for you.
Reviewer Maintainer Shekhar Patnaik (
@shekharpatnaik
) (UTC+1)Oscar Tovar (
@hacks4oats
) (UTC-4)Generated by
Danger@shekharpatnaik can you do the initial review on this?
requested review from @shekharpatnaik
added Technical Writing Unplanned labels
added docsfeature label
- Resolved by Oscar Tovar
@michael-mead When this work is ready to merge, please spin this comment off into a new follow-up issue with some extra information. I'd like to add information to https://docs.gitlab.com/ee/user/project/changelogs.html explaining how to use
glab
to generate a changelog.Please show me what the command and output look like - both when you supply a version number and when you don't? That info will help my writeup be more helpful to users.
(Creating as thread so it's not skipped over as part of the merge process.
- Resolved by Michael Mead
- Resolved by Michael Mead
- Resolved by Michael Mead
- Resolved by Oscar Tovar
@michael-mead I've left some grammar fixes for you to apply. I'm approving and unassigning myself; I don't need to see this work again before it merges.
added tw-weight3 twfinished labels and removed twtriaged label
removed review request for @aqualls
added 1 commit
- 2bc4def8 - fix: apply grammar suggestions from code review
added 1 commit
- cdc37033 - docs: regenerate changelog docs after grammar fixes
mentioned in merge request gitlab!117052 (merged)
- Resolved by Michael Mead
- Resolved by Michael Mead
- Resolved by Shekhar Patnaik
- Resolved by Shekhar Patnaik
- Resolved by Shekhar Patnaik
- Resolved by Shekhar Patnaik
- Resolved by Shekhar Patnaik
- Resolved by Shekhar Patnaik
Thank you. This looks really good @michael-mead! Left some non-blocking comments. Let me know once you're got a chance to have a look and I'll then send it for maintainer review.
added 1 commit
- 0000d8a7 - docs: fix incorrect apostrophe in changelog generate docs
added 1 commit
- 82e22a45 - fix: update invalid apostrophe in help messages
added 1 commit
- 48aed2c5 - fix: changelog generate requires resolved repos
@shekharpatnaik, this Community contribution was recently assigned to you for review.
- Do you still have capacity to review this? We are mindful of your time, so if you are not able to take this on, please re-assign to one or more other reviewers.
- Add the workflowin dev label if the merge request needs action from the author.
This message was generated automatically. You're welcome to improve it.
added automation:reviewers-reminded label
removed workflowready for review label
added workflowin dev label
removed automation:reviewers-reminded label
added 46 commits
-
4655e792...cd5931c0 - 44 commits from branch
gitlab-org:main
- 26f13425 - chore(pkg): add unit-tests for ListTags
- 01084c5a - Merge remote-tracking branch 'upstream/main' into feat/mmead/1292/add-changelog-commands
-
4655e792...cd5931c0 - 44 commits from branch
added linked-issue label
added 1 commit
- 9bdfee79 - feat(commands): add unit-test for changelog errors
added 1 commit
- 4a977fb9 - fix(commands): create one http mocker per test case
added 1 commit
- 26809cc4 - fix(pkg): handle extra newlines in git tag parsing
requested review from @hacks4oats
- Resolved by Oscar Tovar
- Resolved by Oscar Tovar
- Resolved by Michael Mead
- Resolved by Oscar Tovar
- Resolved by Michael Mead
- Resolved by Michael Mead
- Resolved by Oscar Tovar
- Resolved by Oscar Tovar
- Resolved by Michael Mead
- Resolved by Oscar Tovar
- Resolved by Michael Mead
- Resolved by Oscar Tovar
- Resolved by Oscar Tovar
- Resolved by Oscar Tovar
@michael-mead Thanks for working on this! Adding changelog generation to the CLI is exciting
. I've left some questions and suggestions for your consideration. Please feel free to@
me as well if I can be of any assistance on something specific. Thanks again!
added 1 commit
- e023b440 - fix: add context to errors and make return type uniform
added 1 commit
- bbed7e0c - fix: use `require.Equal` for slice comparison
added 1 commit
- 35a71fd4 - fix: ensure error case http msg is as expected
Reviewer roulette
Changes that require review have been detected! A merge request is normally reviewed by both a reviewer and a maintainer in its primary category and by a maintainer in all other categories.
To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, mention them as you normally would! Danger does not automatically notify them for you.
Reviewer Maintainer Jaime Martínez (
@jaime
) (UTC+10)Oscar Tovar (
@hacks4oats
) (UTC-6)Generated by
Danger- Resolved by Michael Mead
- Resolved by Oscar Tovar
@michael-mead Could you regenerate the docs? I re-ran the pipeline, but it's currently not passing due to docs mismatch.
added 13 commits
-
2519ecda...3f2e9109 - 11 commits from branch
gitlab-org:main
- 532fa08c - Merge remote-tracking branch 'upstream/main' into feat/mmead/1292/add-changelog-commands
- 526656ac - docs: regenerate changelog docs
-
2519ecda...3f2e9109 - 11 commits from branch
added 1 commit
- 3d2bcabd - chore: shorten variable names for short-lived variables
- Resolved by Oscar Tovar
- Resolved by Oscar Tovar
- Resolved by Oscar Tovar
- Resolved by Oscar Tovar
@michael-mead Apologies for the delay in my review. I've left some comments on the structure of the tests. Please take a look at the comments I left. The pipeline seems to be failing when it runs in a fork, so I'll trigger a new one once the changes are made. Thanks again for your perseverance, and hard work on this feature!
- Resolved by Oscar Tovar
- Resolved by Oscar Tovar
- Resolved by Oscar Tovar
- Resolved by Oscar Tovar
added 35 commits
-
3d2bcabd...654ae7c1 - 33 commits from branch
gitlab-org:main
- bd413b50 - Merge remote-tracking branch 'upstream/main' into feat/mmead/1292/add-changelog-commands
- 799a1d9f - chore: refactor unit-tests to be more idiomatic
-
3d2bcabd...654ae7c1 - 33 commits from branch
added 1 commit
- 7bbdb5f1 - fix: revert accidental change from bad merge
mentioned in issue #1337 (closed)
mentioned in commit b4c5bba7
@michael-mead, how was your code review experience with this merge request? Please tell us how we can continue to iterate and improve:
- React with a
or a on this comment to describe your experience. - Create a new comment starting with
@gitlab-bot feedback
below, and leave any additional feedback you have for us in the comment.
Interested in learning more tips and tricks to solve your next challenge faster? Subscribe to the GitLab Community Newsletter for contributor-focused content and opportunities to level up.
Thanks for your help!
This message was generated automatically. You're welcome to improve it.
- React with a
mentioned in merge request gitlab-com/www-gitlab-com!124983 (merged)