Skip to content

Commit

Permalink
Switch back to strfmt.DateTime in buildplanner structs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchell-as committed Dec 15, 2023
1 parent f53d161 commit 049d1aa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion internal/runbits/requirements/requirements.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/ActiveState/cli/pkg/platform/model"
"github.com/ActiveState/cli/pkg/platform/runtime/target"
"github.com/ActiveState/cli/pkg/project"
"github.com/go-openapi/strfmt"
)

type PackageVersion struct {
Expand Down Expand Up @@ -240,6 +241,7 @@ func (r *RequirementOperation) ExecuteRequirementOperation(
}
ts = &latest
}
timestamp := strfmt.DateTime(*ts)

// MUST ADDRESS: we're no longer passing bitwidth, but this needs it. Need to figure out why.
requirementBitWidth := -1
Expand All @@ -262,7 +264,7 @@ func (r *RequirementOperation) ExecuteRequirementOperation(
RequirementVersion: requirements,
RequirementNamespace: *ns,
Operation: operation,
TimeStamp: ts,
TimeStamp: &timestamp,
}

bp := model.NewBuildPlannerModel(r.Auth)
Expand Down
2 changes: 1 addition & 1 deletion internal/runners/initialize/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (r *Initialize) Run(params *RunParams) (rerr error) {
Language: lang.Requirement(),
Version: version,
Private: params.Private,
Timestamp: timestamp,
Timestamp: strfmt.DateTime(timestamp),
Description: locale.T("commit_message_add_initial"),
})
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/platform/model/buildplanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ type StageCommitParams struct {
RequirementVersion []bpModel.VersionRequirement
RequirementNamespace Namespace
Operation bpModel.Operation
TimeStamp *time.Time
TimeStamp *strfmt.DateTime
// ... or commits can have an expression (e.g. from pull). When pulling an expression, we do not
// compute its changes into a series of above operations. Instead, we just pass the new
// expression directly.
Expand Down Expand Up @@ -329,7 +329,7 @@ type CreateProjectParams struct {
Language string
Version string
Private bool
Timestamp time.Time
Timestamp strfmt.DateTime
Description string
Expr *buildexpression.BuildExpression
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/platform/runtime/buildexpression/buildexpression.go
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ func (e *BuildExpression) removePlatform(platformID strfmt.UUID) error {
return nil
}

func (e *BuildExpression) UpdateTimestamp(timestamp time.Time) error {
func (e *BuildExpression) UpdateTimestamp(timestamp strfmt.DateTime) error {
formatted, err := time.Parse(time.RFC3339, timestamp.String())
if err != nil {
return errs.Wrap(err, "Could not parse latest timestamp")
Expand Down

0 comments on commit 049d1aa

Please sign in to comment.