Skip to content
Snippets Groups Projects

feat: add new changelog command

All threads resolved!

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
Edited by Michael Mead

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Amy Qualls
  • Amy Qualls
  • Amy Qualls approved this merge request

    approved this merge request

  • Amy Qualls added tw-weight3 twfinished labels and removed twtriaged label

    added tw-weight3 twfinished labels and removed twtriaged label

  • Amy Qualls removed review request for @aqualls

    removed review request for @aqualls

  • Michael Mead added 1 commit

    added 1 commit

    • 2bc4def8 - fix: apply grammar suggestions from code review

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • cdc37033 - docs: regenerate changelog docs after grammar fixes

    Compare with previous version

  • Amy Qualls mentioned in merge request gitlab!117052 (merged)

    mentioned in merge request gitlab!117052 (merged)

  • Michael Mead added 1 commit

    added 1 commit

    • 646fac8a - fix: run gofumpt on changelog commands file

    Compare with previous version

  • Shekhar Patnaik
  • Shekhar Patnaik
  • Michael Mead added 1 commit

    added 1 commit

    • 0000d8a7 - docs: fix incorrect apostrophe in changelog generate docs

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 82e22a45 - fix: update invalid apostrophe in help messages

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 48aed2c5 - fix: changelog generate requires resolved repos

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 5351dac4 - chore: use `require` for test assertions

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 4655e792 - fix: list tags before trying to describe

    Compare with previous version

  • @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.

  • Michael Mead added 46 commits

    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

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 9bdfee79 - feat(commands): add unit-test for changelog errors

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 4a977fb9 - fix(commands): create one http mocker per test case

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 26809cc4 - fix(pkg): handle extra newlines in git tag parsing

    Compare with previous version

  • Oscar Tovar requested review from @hacks4oats

    requested review from @hacks4oats

  • Oscar Tovar
  • Oscar Tovar
    • Resolved by Oscar Tovar

      @michael-mead Thanks for working on this! Adding changelog generation to the CLI is exciting :tada:. 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!

  • Michael Mead added 1 commit

    added 1 commit

    • 73016ae7 - fix: apply suggestions from MR review

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • e023b440 - fix: add context to errors and make return type uniform

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 0924cc8e - fix: do not export test case structs

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • bbed7e0c - fix: use `require.Equal` for slice comparison

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 3f89100c - chore: replace for loop with string.Fields

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 35a71fd4 - fix: ensure error case http msg is as expected

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 2519ecda - fix: verify err is not nil before access

    Compare with previous version

  • 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 current availability (@jaime) (UTC+10) Oscar Tovar current availability (@hacks4oats) (UTC-6)

    Generated by :no_entry_sign: Danger

  • Michael Mead added 13 commits

    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

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 3d2bcabd - chore: shorten variable names for short-lived variables

    Compare with previous version

  • 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!

  • Oscar Tovar
  • Oscar Tovar
  • Michael Mead added 35 commits

    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

    Compare with previous version

  • Michael Mead added 1 commit

    added 1 commit

    • 7bbdb5f1 - fix: revert accidental change from bad merge

    Compare with previous version

  • mentioned in issue #1337 (closed)

  • Oscar Tovar resolved all threads

    resolved all threads

  • Oscar Tovar approved this merge request

    approved this merge request

  • Oscar Tovar started a merge train

    started a merge train

  • merged

  • Oscar Tovar mentioned in commit b4c5bba7

    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:

    1. React with a :thumbsup: or a :thumbsdown: on this comment to describe your experience.
    2. 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! :heart:

    This message was generated automatically. You're welcome to improve it.

  • Please register or sign in to reply
    Loading