Skip to content

Commit

Permalink
Temporarily disable buildscripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchell-as committed Oct 30, 2023
1 parent 9ceab6e commit f09a2a3
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cmd/state/internal/cmdtree/cmdtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
11 changes: 6 additions & 5 deletions internal/runbits/refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down
20 changes: 11 additions & 9 deletions internal/runbits/requirements/requirements.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions internal/runners/pull/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions pkg/platform/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 5 additions & 4 deletions pkg/platform/runtime/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/integration/commit_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions test/integration/pull_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit f09a2a3

Please sign in to comment.