Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

valueToStarlark support for enumKind #99

Merged
merged 4 commits into from
Sep 7, 2021
Merged

Conversation

seena-stripe
Copy link
Collaborator

Summary

valueToStarlark was missing support for enumKind so this PR:

  • Return an error if a NewMessage fails to assign a value, updating the type signature in skycfg.go
  • Adds a test for msg == AsProtoMessage(NewMessage(msg)) which catches the issue
  • Add missing support in valueToStarlark

Tests

Added tests which should cover issues like this in the future

func NewProtoMessage(msg proto.Message) starlark.Value {
v, _ := protomodule.NewMessage(msg)
return v
func NewProtoMessage(msg proto.Message) (starlark.Value, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is a backwards-incompatible change, are you going to release these changes as a new (major?) version for skycfg?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, as I understand the current state is Skycfg has a single release tagged 0.1.0 and there have been a number of other API changes. Also as we learned in #95 API changes are easier to deal with than implementation changing untested behavior

@seena-stripe seena-stripe merged commit 7027988 into trunk Sep 7, 2021
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