Make `name` optional parameter of Release entity
Problem
During the discussion in https://gitlab.com/gitlab-org/gitlab-ee/issues/27856, we've realized that name
parameter should be optional rather than required fileds.
In GitHub, it's actually optional parameter for overriding tag names (See https://developer.github.com/v3/repos/releases/#create-a-release). Most of the cases, users set a tag name directly as the release name e.g. https://gitlab.com/gitlab-org/gitlab-runner/-/releases.
We can allow name
to be nil
, thus validates :name, presence: true, on: :create
can be removed which rescues 90k invalid records on gitlab.com (See https://gitlab.com/gitlab-org/gitlab-ee/issues/27856#note_215725969)
Here is the technical/feature proposal (copied from https://gitlab.com/gitlab-org/gitlab-ee/issues/27856#note_215726036)
@sean_carroll Thanks. Actually, I'm thinking that @krasio's point is valid and we'd want to rethink what the
name
represents. If we align with the GitHub's feature, we'd want to iron out our implementation as:
name
is optional. Users do not need to specify otherwise tag name is used.- If
name
is specified, the name overrides git-tag-name and it is shown in UI.- If guest users access Releases page, we show alternative identifier instead of showing git-tag name for security reason.
- Therefore, we don't need to backfill
name
bytag
.- We don't need AR validation nor DB constraint for
name
. It can beNULL
.Can you create an issue for the further discussion with PM and UX? This seems improving usability and security concerns.
Solution
We will remove the validation
/cc @darbyfrey @krasio @sean_carroll @ogolowinski @rverissimo @stanhu