Skip to content

Conversation

mathieu-benoit
Copy link
Contributor

@mathieu-benoit mathieu-benoit commented Jun 17, 2025

Just grabbed latest Spec file version, and ran:

make generate

Unit tests now failing:

go test -v ./...
...
# github.com/score-spec/score-go/loader [github.com/score-spec/score-go/loader.test]
loader/normalize.go:32:9: f.Source undefined (type interface{} has no field or method Source)
loader/normalize.go:33:38: f.Source undefined (type interface{} has no field or method Source)
loader/normalize.go:35:73: f.Source undefined (type interface{} has no field or method Source)
loader/normalize.go:37:7: f.Source undefined (type interface{} has no field or method Source)
loader/normalize.go:40:8: f.Content undefined (type interface{} has no field or method Content)
loader/normalize.go:43:8: f.BinaryContent undefined (type interface{} has no field or method BinaryContent)
loader/loader_test.go:168:14: cannot use map[string]types.ContainerFile{…} (value of type map[string]types.ContainerFile) as types.ContainerFiles value in struct literal
loader/loader_test.go:178:16: cannot use map[string]types.ContainerVolume{…} (value of type map[string]types.ContainerVolume) as types.ContainerVolumes value in struct literal
loader/normalize_test.go:44:14: cannot use map[string]types.ContainerFile{…} (value of type map[string]types.ContainerFile) as types.ContainerFiles value in struct literal
loader/normalize_test.go:64:14: cannot use map[string]types.ContainerFile{…} (value of type map[string]types.ContainerFile) as types.ContainerFiles value in struct literal
loader/normalize_test.go:64:14: too many errors
...
FAIL    github.com/score-spec/score-go/loader [build failed]
...
FAIL

@astromechza, did we miss anything last time with #103?

Signed-off-by: Mathieu Benoit <mathieu-benoit@hotmail.fr>
@astromechza
Copy link
Member

@mathieu-benoit I must have missed a change in the last PR for the Makefile. Change the first jq line to be jq '. as $$a | ."$$defs".container.properties.files |= $$a."$$defs".container.properties.files.oneOf[1] | ."$$defs".container.properties.files.additionalProperties |= $$a."$$defs".container.properties.files.oneOf[1].additionalProperties.allOf[1] | ."$$defs".container.properties.volumes |= $$a."$$defs".container.properties.volumes.oneOf[1] | ."$$defs".container.properties.volumes.additionalProperties |= $$a."$$defs".container.properties.volumes.oneOf[1].additionalProperties.allOf[1] | del(."$$defs".containerFile.properties.target) | del(."$$defs".containerVolume.properties.target)' schema/files/score-v1b1.json > schema/files/score-v1b1.json.for-validation. That seems to work for me :)

Signed-off-by: Mathieu Benoit <mathieu-benoit@hotmail.fr>
@mathieu-benoit mathieu-benoit self-assigned this Jun 23, 2025
@mathieu-benoit
Copy link
Contributor Author

Thanks @astromechza, that did it indeed!

Ready for your review, thanks!

@mathieu-benoit mathieu-benoit changed the title make generate make generate refresh Jun 24, 2025
@mathieu-benoit
Copy link
Contributor Author

mathieu-benoit commented Jun 24, 2025

Also, I was able to successfully test this new score-go version from this branch in both score-compose and score-k8s, just to make sure that there is no changes there nor breaking changes:

git clone https://github.com/score-spec/score-compose
cd score-compose
go get -u github.com/score-spec/score-go@spec-generate
make build
make test
git clone https://github.com/score-spec/score-k8s
cd score-k8s
go get -u github.com/score-spec/score-go@spec-generate
make build
make test

I also double checked that the 2 Score files (with array and map) illustrated here are still successfully working as expected.

@astromechza, ready for your final approval please, thanks!

Copy link
Member

@astromechza astromechza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, go go

@mathieu-benoit mathieu-benoit merged commit 583e699 into main Jun 27, 2025
6 checks passed
@mathieu-benoit mathieu-benoit deleted the spec-generate branch June 27, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants