From d36b0073a2444ddf6486c046c53dcbe81fa108ff Mon Sep 17 00:00:00 2001 From: mitchell Date: Mon, 16 Sep 2024 14:20:47 -0400 Subject: [PATCH] Do not validate commit ID from within projectfile. Doing so prevents `state reset` to fix a bad ID. Any runners that need a commit ID get it from localcommit, which raises an invalid commit ID error. --- pkg/projectfile/projectfile.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pkg/projectfile/projectfile.go b/pkg/projectfile/projectfile.go index 6221cbcda2..9761cbb17b 100644 --- a/pkg/projectfile/projectfile.go +++ b/pkg/projectfile/projectfile.go @@ -31,7 +31,6 @@ import ( "github.com/ActiveState/cli/internal/sliceutils" "github.com/ActiveState/cli/internal/strutils" "github.com/ActiveState/cli/pkg/sysinfo" - "github.com/go-openapi/strfmt" "github.com/google/uuid" "github.com/imdario/mergo" "github.com/spf13/cast" @@ -660,19 +659,6 @@ func (p *Project) parseURL() (projectURL, error) { return parseURL(p.Project) } -func validateUUID(uuidStr string) error { - if ok := strfmt.Default.Validates("uuid", uuidStr); !ok { - return locale.NewError("err_commit_id_invalid", "", uuidStr) - } - - var uuid strfmt.UUID - if err := uuid.UnmarshalText([]byte(uuidStr)); err != nil { - return locale.WrapError(err, "err_commit_id_unmarshal", "Failed to unmarshal the commit id {{.V0}} read from activestate.yaml.", uuidStr) - } - - return nil -} - func parseURL(rawURL string) (projectURL, error) { p := projectURL{} @@ -701,12 +687,6 @@ func parseURL(rawURL string) (projectURL, error) { p.LegacyCommitID = c } - if p.LegacyCommitID != "" { - if err := validateUUID(p.LegacyCommitID); err != nil { - return p, err - } - } - if b := q.Get("branch"); b != "" { p.BranchName = b }