-
Notifications
You must be signed in to change notification settings - Fork 346
Open
Labels
NeedsFixbisectedRegression which has been bisected to one changeRegression which has been bisected to one change
Description
Hi there!
What version of CUE are you using (cue version)?
Tried on:
v0.16.0-alpha.1
v0.15.4
v0.15.3
v0.14.1
v0.13.2 <- in this version, the following bug does not reproduce
Does this issue reproduce with the latest stable release?
Yes
What did you do?
The following input YAML
components:
- id: urn:dmb:cmp:testdomain:system:0:component:subcomponent
id: urn:dmb:cmp:testdomain:system:0:componentrun against this CUE script:
import "strings"
let splits = strings.Split(id, ":")
let domain = splits[3]
let majorVersion = splits[5]
let componentIdPattern = "^urn:dmb:cmp:\(domain):[a-zA-Z0-9_\\-]+:\(majorVersion):[a-zA-Z0-9_\\-]+$"
let subcomponentIdPattern = "^urn:dmb:cmp:\(domain):[a-zA-Z0-9_\\-]+:\(majorVersion):[a-zA-Z0-9_\\-]+:subcomponent$"
#Id: string & =~"^[a-zA-Z0-9:._\\-]+$"
#ComponentId: #Id & =~componentIdPattern
#SubcomponentId: #Id & =~subcomponentIdPattern
#Workload: {
id: #SubcomponentId
...
}
id!: #ComponentId
components: [#Workload]with the following command:
$ cue vet file.yaml validator.cuereturns:
$ cue vet file.yaml validator.cue
components.0.id: invalid value "urn:dmb:cmp:testdomain:system:0:component:subcomponent" (out of bound =~"^urn:dmb:cmp::[a-zA-Z0-9_\\-]+:0:[a-zA-Z0-9_\\-]+:subcomponent$"):
./not-working.cue:12:25
./descriptor.yaml:2:9
./not-working.cue:15:29While instead, if I now switch the order of the id field in the file.yaml like this:
id: urn:dmb:cmp:testdomain:system:0:component
components:
- id: urn:dmb:cmp:testdomain:system:0:component:subcomponentand run again the same command, I get:
$ cue vet file.yaml validator.cue
$ no output, meaning validation went through.
What did you expect to see?
Same behavior, independently of the order of input fields.
The expected behavior was happening in v0.13.2
What did you see instead?
Different behavior
Thank you
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
NeedsFixbisectedRegression which has been bisected to one changeRegression which has been bisected to one change