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

remove cuego.Complete from cuecfg.Marshal #1349

Merged
merged 1 commit into from
Aug 7, 2023
Merged

Conversation

savil
Copy link
Collaborator

@savil savil commented Aug 7, 2023

Summary

cuego.Complete leads to non-trivial complexity when dealing with custom json
marshalling. In particular, it does a round-trip JSON marshal/unmarshal and fields
that are not handled by golang's json-framework can be lost. This interferes
with custom marshalling/unmarshalling.

cuego.Complete is only needed if we rely on the cue: annotations to autocomplete some fields (I mean, assign default values respecting cue constraints). We don't rely on this, so, right now it is superfluous.

I also remove the cue: annotations in a couple of structs since we do not
rely on them.

How was it tested?

  • devbox init should produce the expected output
  • devbox add
  • devbox rm

testscript unit tests must pass

Copy link
Collaborator Author

savil commented Aug 7, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@savil savil requested review from mikeland73 and ipince August 7, 2023 18:13
@savil savil marked this pull request as ready for review August 7, 2023 18:13
Copy link
Contributor

@mikeland73 mikeland73 left a comment

Choose a reason for hiding this comment

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

I had no idea what this was for, thanks for description cc: @loreto

@loreto
Copy link
Contributor

loreto commented Aug 7, 2023

LGTM

I don't know if there's other places where cue is handling the config, but at this point, you might as well remove the dependency completely.

cuecfg is a misnomer now, you might want to rename the package.

@savil savil merged commit 7988140 into main Aug 7, 2023
15 checks passed
@savil savil deleted the savil/rm-cuego-complete branch August 7, 2023 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants