Skip to content

Fix test release file and update `create-from-file` test to check values

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do and why?

This MR fixes two errors in the example file used to test create-from-file, specifically:

  • released_at should be renamed released-at
  • milestones should be renamed milestone

The TestCreateFromFile test was updated to check the actual values from the release as sent to the GitLab API. One behavior that was seen, but was not expected, is that the values that have environment variable defaults (ref and tag-name) will use the value given in the file only if the environment variable is not specified, otherwise the environment variable is used. That appears to be the default cli behavior, but their docs were not explicit (at least that I could find). The test was updated to reflect this behavior. I only ever create releases where those values match (or default to the env values), so I never noticed this before.

The following cleanup changes were also made:

  • Updated the documentation to clarify the release file contents and point to the example file (closes #189 (closed)).
  • Added comments to the example file for the env behavior noted above.
  • Removed log message "file does not exist, using string value for --description" that is not applicable (likely leftover from the TestCreate function).

Closes #191 (closed)

Checklist

  • I added tests
  • Green pipeline (no, but lint warning was pre-existing)
  • Assign to reviewer
Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading