From f09a2a362440e9d143c748e7a7bbcc450a4cc7d6 Mon Sep 17 00:00:00 2001 From: mitchell Date: Mon, 30 Oct 2023 14:01:32 -0400 Subject: [PATCH] Temporarily disable buildscripts. --- cmd/state/internal/cmdtree/cmdtree.go | 2 +- internal/runbits/refresh.go | 11 +++++----- internal/runbits/requirements/requirements.go | 20 ++++++++++--------- internal/runners/pull/pull.go | 9 +++++---- pkg/platform/runtime/runtime.go | 2 ++ pkg/platform/runtime/setup/setup.go | 9 +++++---- test/integration/commit_int_test.go | 1 + test/integration/pull_int_test.go | 1 + 8 files changed, 32 insertions(+), 23 deletions(-) diff --git a/cmd/state/internal/cmdtree/cmdtree.go b/cmd/state/internal/cmdtree/cmdtree.go index 2a26337532..2abab6d5df 100644 --- a/cmd/state/internal/cmdtree/cmdtree.go +++ b/cmd/state/internal/cmdtree/cmdtree.go @@ -204,7 +204,7 @@ func New(prime *primer.Values, args ...string) *CmdTree { refreshCmd, newSwitchCommand(prime), newTestCommand(prime), - newCommitCommand(prime), + //newCommitCommand(prime), // re-enable in DX-2307 ) return &CmdTree{ diff --git a/internal/runbits/refresh.go b/internal/runbits/refresh.go index b7d569b4a4..6bc5d6386a 100644 --- a/internal/runbits/refresh.go +++ b/internal/runbits/refresh.go @@ -5,7 +5,7 @@ import ( "github.com/ActiveState/cli/internal/locale" "github.com/ActiveState/cli/internal/output" "github.com/ActiveState/cli/internal/rtutils" - "github.com/ActiveState/cli/internal/runbits/buildscript" + //"github.com/ActiveState/cli/internal/runbits/buildscript" // re-enable in DX-2307 "github.com/ActiveState/cli/pkg/platform/authentication" "github.com/ActiveState/cli/pkg/platform/model" "github.com/ActiveState/cli/pkg/platform/runtime" @@ -25,10 +25,11 @@ func RefreshRuntime( trigger target.Trigger, svcm *model.SvcModel, ) (rerr error) { - _, err := buildscript.Sync(proj, &commitID, out, auth) - if err != nil { - return locale.WrapError(err, "err_update_build_script") - } + // Re-enable in DX-2307. + //_, err := buildscript.Sync(proj, &commitID, out, auth) + //if err != nil { + // return locale.WrapError(err, "err_update_build_script") + //} target := target.NewProjectTarget(proj, nil, trigger) isCached := true rt, err := runtime.New(target, an, svcm, auth) diff --git a/internal/runbits/requirements/requirements.go b/internal/runbits/requirements/requirements.go index 8f90d429c4..9576eab0e0 100644 --- a/internal/runbits/requirements/requirements.go +++ b/internal/runbits/requirements/requirements.go @@ -26,7 +26,7 @@ import ( medmodel "github.com/ActiveState/cli/pkg/platform/api/mediator/model" "github.com/ActiveState/cli/pkg/platform/authentication" "github.com/ActiveState/cli/pkg/platform/model" - "github.com/ActiveState/cli/pkg/platform/runtime/buildscript" + //"github.com/ActiveState/cli/pkg/platform/runtime/buildscript" // re-enable in DX-2307 "github.com/ActiveState/cli/pkg/platform/runtime/target" "github.com/ActiveState/cli/pkg/project" "github.com/thoas/go-funk" @@ -270,20 +270,22 @@ func (r *RequirementOperation) ExecuteRequirementOperation(requirementName, requ return errs.Wrap(err, "Unsupported namespace type: %s", ns.Type().String()) } - expr, err := bp.GetBuildExpression(r.Project.Owner(), r.Project.Name(), commitID.String()) - if err != nil { - return errs.Wrap(err, "Could not get remote build expr") - } + // Re-enable in DX-2307. + //expr, err := bp.GetBuildExpression(r.Project.Owner(), r.Project.Name(), commitID.String()) + //if err != nil { + // return errs.Wrap(err, "Could not get remote build expr") + //} if err := commitmediator.Set(r.Project, commitID.String()); err != nil { return locale.WrapError(err, "err_package_update_commit_id") } // Note: a commit ID file needs to exist at this point. - err = buildscript.Update(r.Project, expr, r.Auth) - if err != nil { - return locale.WrapError(err, "err_update_build_script") - } + // Re-enable in DX-2307. + //err = buildscript.Update(r.Project, expr, r.Auth) + //if err != nil { + // return locale.WrapError(err, "err_update_build_script") + //} // refresh or install runtime err = runbits.RefreshRuntime(r.Auth, r.Output, r.Analytics, r.Project, commitID, true, trigger, r.SvcModel) diff --git a/internal/runners/pull/pull.go b/internal/runners/pull/pull.go index 4bd6903f19..4c0284a679 100644 --- a/internal/runners/pull/pull.go +++ b/internal/runners/pull/pull.go @@ -182,10 +182,11 @@ func (p *Pull) Run(params *PullParams) error { } func (p *Pull) performMerge(strategies *mono_models.MergeStrategies, remoteCommit strfmt.UUID, localCommit strfmt.UUID, namespace *project.Namespaced, branchName string) (strfmt.UUID, error) { - err := p.mergeBuildScript(strategies, remoteCommit) - if err != nil { - return "", errs.Wrap(err, "Could not merge local build script with remote changes") - } + // Re-enable in DX-2307. + //err := p.mergeBuildScript(strategies, remoteCommit) + //if err != nil { + // return "", errs.Wrap(err, "Could not merge local build script with remote changes") + //} p.out.Notice(output.Title(locale.Tl("pull_diverged", "Merging history"))) p.out.Notice(locale.Tr( diff --git a/pkg/platform/runtime/runtime.go b/pkg/platform/runtime/runtime.go index 806ea0e22e..e3441f5b72 100644 --- a/pkg/platform/runtime/runtime.go +++ b/pkg/platform/runtime/runtime.go @@ -116,6 +116,8 @@ func (r *Runtime) validateCache() error { return nil } + return nil // remove in DX-2307 to re-enable buildscripts below + // Check if local build script has changes that should be committed. script, err := buildscript.NewScriptFromProject(r.target, r.auth) if err != nil { diff --git a/pkg/platform/runtime/setup/setup.go b/pkg/platform/runtime/setup/setup.go index 252aa45cbd..e03062567f 100644 --- a/pkg/platform/runtime/setup/setup.go +++ b/pkg/platform/runtime/setup/setup.go @@ -36,7 +36,7 @@ import ( "github.com/ActiveState/cli/pkg/platform/runtime/artifact" "github.com/ActiveState/cli/pkg/platform/runtime/artifactcache" "github.com/ActiveState/cli/pkg/platform/runtime/buildplan" - "github.com/ActiveState/cli/pkg/platform/runtime/buildscript" + //"github.com/ActiveState/cli/pkg/platform/runtime/buildscript" // re-enable in DX-2307 "github.com/ActiveState/cli/pkg/platform/runtime/envdef" "github.com/ActiveState/cli/pkg/platform/runtime/executors" "github.com/ActiveState/cli/pkg/platform/runtime/setup/buildlog" @@ -582,9 +582,10 @@ func (s *Setup) fetchAndInstallArtifactsFromBuildPlan(installFunc artifactInstal } if s.target.ProjectDir() != "" { - if err := buildscript.Update(s.target, buildResult.BuildExpression, s.auth); err != nil { - return nil, nil, errs.Wrap(err, "Could not save build script.") - } + // Re-enable in DX-2307 + //if err := buildscript.Update(s.target, buildResult.BuildExpression, s.auth); err != nil { + // return nil, nil, errs.Wrap(err, "Could not save build script.") + //} } return buildResult.OrderedArtifacts(), uninstallArtifacts, nil diff --git a/test/integration/commit_int_test.go b/test/integration/commit_int_test.go index 4f4693eee0..d88a27b373 100644 --- a/test/integration/commit_int_test.go +++ b/test/integration/commit_int_test.go @@ -20,6 +20,7 @@ type CommitIntegrationTestSuite struct { func (suite *CommitIntegrationTestSuite) TestCommitManualBuildScriptMod() { suite.OnlyRunForTags(tagsuite.Commit) + suite.T().Skip("Temporarily disable buildscripts until DX-2307") // remove in DX-2307 ts := e2e.New(suite.T(), false) defer ts.Close() diff --git a/test/integration/pull_int_test.go b/test/integration/pull_int_test.go index 0f024b620a..cdc2851a10 100644 --- a/test/integration/pull_int_test.go +++ b/test/integration/pull_int_test.go @@ -141,6 +141,7 @@ func (suite *PullIntegrationTestSuite) TestPull_RestoreNamespace() { func (suite *PullIntegrationTestSuite) TestMergeBuildScript() { suite.OnlyRunForTags(tagsuite.Pull) + suite.T().Skip("Temporarily disable buildscripts until DX-2307") // remove in DX-2307 ts := e2e.New(suite.T(), false) defer ts.Close()