Skip to content

create-from-file test file incorrect "milestones" value

Summary

While the documentation does not explicitly state the proper fields for the file used by create-from-file, it was assumed the test file at internal/testdata/release.yml was correct. This file, however, incorrectly specifies the release milestones:

---
name: Release for test
description: This is a release for testing only.
tag-name: v1.2.3
released_at: 2019-01-03T01:55:18.203Z
ref: abcdefgh12345678
milestones:
  - 'v2.0'
  - 'v3.0'
assets-link:
  - '{"name":"asset1", "url":"https://gitlab.com/gitlab-org/release-cli", "type":"other", "direct_asset_path":"/bin/binary_file"}'
  - '{"name":"asset2", "url":"https://gitlab.com/"}'

This file shows the property as milestones, but testing has confirmed that the correct property is actually milestone (singular, matching the CLI argument). When milestones is used, it is simply ignored.

Steps to reproduce

Run release-cli create-from-file -file release.yml with milestones specified.

Example Project

An example can be seen here:

What is the current bug behavior?

Example file has incorrect fields (and neither of the the two tests checks all the values, just release created and no error).

What is the expected correct behavior?

Example file or documentation should identify correct file fields.

Possible fixes

Update test file to:

---
 name: Release for test
 description: This is a release for testing only.
 tag-name: v1.2.3
 released_at: 2019-01-03T01:55:18.203Z
 ref: abcdefgh12345678
-milestones:
+milestone:
   - 'v2.0'
   - 'v3.0'
 assets-link:
   - '{"name":"asset1", "url":"https://gitlab.com/gitlab-org/release-cli", "type":"other", "direct_asset_path":"/bin/binary_file"}'
   - '{"name":"asset2", "url":"https://gitlab.com/"}'

~"devops::release" ~"group::release" GitLab Release CLI Category:Release Orchestration

Edited by Aaron Goldenthal