Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

feat: add new release commands to manage GitLab releases #445

Merged
merged 15 commits into from
May 27, 2021

Conversation

profclems
Copy link
Owner

@profclems profclems commented Dec 29, 2020

New commands:

  • glab release create <tag> [<files>...]
  • glab release upload <tag> <files>...
  • glab release view <tag>
  • glab release download <tag> [<pattern>]
  • glab release delete <tag>

Example output:

image

Example help:

$ glab release create -h

Create a new or update a GitLab Release for a repository.

If the release already exists, glab updates the release with the new info provided.

If a git tag specified does not yet exist, the release will automatically get created
from the latest state of the default branch and tagged with the specified tag name.
Use `--ref` to override this.
The `ref` can be a commit SHA, another tag name, or a branch name.
To fetch the new tag locally after the release, do `git fetch --tags origin`.

To create a release from an annotated git tag, first create one locally with
git, push the tag to GitLab, then run this command.

NB: Developer level access to the project is required to create a release.

USAGE
  glab release create <tag> [<files>...] [flags]

FLAGS
  -a, --assets JSON         JSON string representation of assets links (e.g. `--assets='[{"name": "Asset1", "url":"https://<domain>/some/location/1", "link_type": "other", "filepath": "path/to/file"}]')`
  -m, --milestone strings   The title of each milestone the release is associated with
  -n, --name string         The release name or title
  -N, --notes string        The release notes/description. You can use Markdown
  -F, --notes-file file     Read release notes file. Specify `-` as value to read from stdin
  -r, --ref string          If a tag specified doesn't exist, the release is created from ref and tagged with the specified tag name. It can be a commit SHA, another tag name, or a branch name.
  -D, --released-at date    The date when the release is/was ready. Defaults to the current datetime. Expected in ISO 8601 format (2019-03-15T08:00:00Z)

TODO:

  • view: add metadata to rendered output
  • view: add ability to view latest release for a repository
  • create: add flags for metadata
  • create: enable interactive flow
  • create: accept a list of files for upload
  • create: offer options to pre-populate release notes
    • Use commit messages as a template
    • Use merge request titles as a template
    • Use annotated git tag as template
  • glab release upload command
  • glab release download command
  • glab release delete command

Fixes #366

@profclems profclems marked this pull request as draft December 29, 2020 22:48
@profclems profclems added cmd: release Related to release command enhancement New feature or request labels Dec 29, 2020
@profclems profclems self-assigned this Dec 29, 2020
@codecov
Copy link

codecov bot commented Dec 29, 2020

Codecov Report

Merging #445 (f7a7342) into trunk (dbb7f2d) will decrease coverage by 0.32%.
The diff coverage is 39.17%.

Impacted file tree graph

@@            Coverage Diff             @@
##            trunk     #445      +/-   ##
==========================================
- Coverage   58.97%   58.65%   -0.33%     
==========================================
  Files          92       93       +1     
  Lines        6626     6687      +61     
==========================================
+ Hits         3908     3922      +14     
- Misses       2339     2384      +45     
- Partials      379      381       +2     
Impacted Files Coverage Δ
commands/cmdutils/errors.go 0.00% <0.00%> (ø)
internal/glrepo/remote.go 97.29% <0.00%> (-2.71%) ⬇️
internal/glrepo/repo.go 85.29% <0.00%> (-9.28%) ⬇️
pkg/iostreams/icons.go 0.00% <0.00%> (ø)
pkg/iostreams/logger.go 0.00% <0.00%> (ø)
pkg/utils/utils.go 35.61% <0.00%> (-4.39%) ⬇️
cmd/glab/main.go 43.13% <62.06%> (+3.13%) ⬆️
pkg/iostreams/iostreams.go 38.54% <62.50%> (-0.83%) ⬇️
commands/release/list/release_list.go 73.07% <69.23%> (-3.12%) ⬇️
commands/api/http.go 81.08% <100.00%> (+3.53%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbb7f2d...f7a7342. Read the comment docs.

@profclems profclems mentioned this pull request Dec 29, 2020
8 tasks
@profclems profclems force-pushed the feat-release-create branch 2 times, most recently from 72965ec to ba48dc9 Compare December 30, 2020 18:15
@profclems
Copy link
Owner Author

This is getting tougher than I expected esp with the upload of artifacts.

https://docs.gitlab.com/ce/api/releases/links.html#create-a-link

@clemsbot clemsbot added the stale label Mar 10, 2021
@profclems profclems removed the stale label Mar 10, 2021
Repository owner deleted a comment from clemsbot Mar 10, 2021
@clemsbot
Copy link
Collaborator

This PR has been automatically marked as stale because it has not had recent activity. This message is just a reminder for the author, reviewers and assignees.

@profclems profclems changed the title feat: add release create command feat: add new release commands to manage GitLab releases May 23, 2021
@profclems profclems removed the stale label May 24, 2021
@profclems profclems marked this pull request as ready for review May 25, 2021 02:19
@profclems profclems merged commit a18cc9f into trunk May 27, 2021
@profclems profclems deleted the feat-release-create branch May 27, 2021 12:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cmd: release Related to release command enhancement New feature or request size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tracker] release commands
2 participants