Skip to content

Commit

Permalink
rename rotationOnly -> rotateOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
nyobe committed Jan 29, 2025
1 parent a6327fa commit 7753126
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ast/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ func (d *MapDecl[T]) parse(name string, node syntax.Node) syntax.Diagnostics {
type ImportMetaDecl struct {
declNode

Merge *BooleanExpr
RotationOnly *BooleanExpr
Merge *BooleanExpr
RotateOnly *BooleanExpr
}

func (d *ImportMetaDecl) recordSyntax() *syntax.Node {
Expand Down
10 changes: 5 additions & 5 deletions eval/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ func (e *evalContext) evaluateImport(myImports map[string]*value, decl *ast.Impo
if decl.Meta != nil && decl.Meta.Merge != nil {
merge = decl.Meta.Merge.Value
}
rotationOnly := false
if decl.Meta != nil && decl.Meta.RotationOnly != nil {
rotationOnly = decl.Meta.RotationOnly.Value
rotateOnly := false
if decl.Meta != nil && decl.Meta.RotateOnly != nil {
rotateOnly = decl.Meta.RotateOnly.Value
}

var val *value
Expand All @@ -493,7 +493,7 @@ func (e *evalContext) evaluateImport(myImports map[string]*value, decl *ast.Impo
return
}
val = imported.value
} else if rotationOnly && !e.rotating {
} else if rotateOnly && !e.rotating {
// this import should only be evaluated during rotation, and we're not rotating, so resolve it as unknown
val = &value{def: newMissingExpr("", nil), schema: schema.Always(), unknown: true}
} else {
Expand Down Expand Up @@ -1089,7 +1089,7 @@ func (e *evalContext) evaluateBuiltinJoin(x *expr, repr *joinExpr) *value {
}

func (e *evalContext) evaluateBuiltinInlineImport(x *expr, repr *inlineImportExpr) {

}

// evaluateBuiltinFromBase64 evaluates a call from the fn::fromBase64 builtin.
Expand Down
1 change: 1 addition & 0 deletions eval/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ type exprRepr interface {
// missingExpr represents a missing value.
type missingExpr struct {
node ast.Expr
// reason
}

func (x *missingExpr) syntax() ast.Expr {
Expand Down
2 changes: 1 addition & 1 deletion eval/testdata/eval/import-rotate/env.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
imports:
- a: {merge: false, rotationOnly: true}
- a: {rotateOnly: true, merge: false}

values:
# expectation: example is unknown during open, but resolves during rotate
Expand Down

0 comments on commit 7753126

Please sign in to comment.