Skip to content

Commit 37545fc

Browse files
committed
Merge branch 'version/0-46-0-RC1' into mitchell/dx-2921
2 parents 3e6cbfb + e93bdae commit 37545fc

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

internal/runners/initialize/init.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ func (r *Initialize) Run(params *RunParams) (rerr error) {
302302
}
303303
solveSpinner.Stop(locale.T("progress_success"))
304304

305-
dependencies.OutputSummary(r.out, commit.BuildPlan().RequestedArtifacts())
305+
// When running `state init` we want to show all of the dependencies that will be installed.
306+
dependencies.OutputSummary(r.out, commit.BuildPlan().Artifacts())
306307
rti, err := runtime_runbit.Update(r.prime, trigger.TriggerInit, runtime_runbit.WithCommit(commit))
307308
if err != nil {
308309
return errs.Wrap(err, "Could not setup runtime after init")

internal/runners/packages/import.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,20 @@ func (i *Import) Run(params *ImportRunParams) (rerr error) {
134134
Description: msg,
135135
Script: bs,
136136
})
137+
// Always update the local commit ID even if the commit fails to build
138+
if stagedCommit != nil && stagedCommit.Commit != nil && stagedCommit.Commit.CommitID != "" {
139+
if err := localcommit.Set(proj.Dir(), stagedCommit.CommitID.String()); err != nil {
140+
solveSpinner.Stop(locale.T("progress_fail"))
141+
return locale.WrapError(err, "err_package_update_commit_id")
142+
}
143+
pg.Stop(locale.T("progress_success"))
144+
pg = nil
145+
}
137146
if err != nil {
138147
solveSpinner.Stop(locale.T("progress_fail"))
139148
return locale.WrapError(err, "err_commit_changeset", "Could not commit import changes")
140149
}
141150

142-
pg.Stop(locale.T("progress_success"))
143-
pg = nil
144-
145-
if err := localcommit.Set(proj.Dir(), stagedCommit.CommitID.String()); err != nil {
146-
solveSpinner.Stop(locale.T("progress_fail"))
147-
return locale.WrapError(err, "err_package_update_commit_id")
148-
}
149-
150151
// Output change summary.
151152
previousCommit, err := bp.FetchCommit(localCommitId, proj.Owner(), proj.Name(), nil)
152153
if err != nil {

pkg/platform/model/buildplanner/commit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (b *BuildPlanner) StageCommit(params StageCommitParams) (*Commit, error) {
6464
}
6565

6666
if response.IsErrorResponse(resp.Commit.Build.Type) {
67-
return nil, response.ProcessBuildError(resp.Commit.Build, "Could not process error response from stage commit")
67+
return &Commit{resp.Commit, nil, nil}, response.ProcessBuildError(resp.Commit.Build, "Could not process error response from stage commit")
6868
}
6969

7070
// The BuildPlanner will return a build plan with a status of

test/integration/init_int_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,7 @@ func (suite *InitIntegrationTestSuite) TestInit_ChangeSummary() {
242242
cp.Expect("Done")
243243
ts.NotifyProjectCreated(e2e.PersistentUsername, project)
244244
cp.Expect("Setting up the following dependencies:")
245-
cp.Expect("└─ [email protected]")
246-
suite.Assert().NotContains(cp.Snapshot(), "├─", "more than one dependency was printed")
245+
cp.Expect("├─ [email protected]")
247246
cp.ExpectExitCode(0)
248247
}
249248

0 commit comments

Comments
 (0)