Skip to content

Bug: Handle errors when releases are immutable #83

@jmeridth

Description

@jmeridth

Describe the bug

There are two scenarios that can happen when a repository has checked the box for Enable release immutability.

  1. Unable to create a new release on a tag if that tag was previously releases as immutable. Example failure (at bottom)
Validation Failed: {"resource":"Release","code":"custom","field":"pre_receive","message":"pre_receive Repository rule violations found\n\nCannot create ref due to creations being restricted.\n\n"}, {"resource":"Release","code":"custom","field":"tag_name","message":"tag_name was used by an immutable release"}, {"resource":"Release","code":"custom","message":"Published releases must have a valid tag"} 
  1. Unable to attach assets to an immutable published release. Example failure

422 Cannot upload assets to an immutable release

To Reproduce

  1. Tag already associated to immutable release

  2. Delete tag, try to release again, it tries to create new tag with old one and can't because it was associated to an immutable release

  3. The error is currently pretty informational

  4. Do an immutable release that attaches assets after the release is published

  5. It fails on the attach because the release is immutable

Expected behavior

  1. Maybe check if the tag is already associated to an immutable release or the current error is good enough? 🤔

  2. Create a draft release first, allow assets attach, then publish. Going to think through how we expose this to the end user.

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingkeep

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions