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

pkg/tool/exec: handle default value references in exec.Run environment variables #2764

Closed
wants to merge 1 commit into from

Conversation

nickfiggins
Copy link
Contributor

Currently, environment variables used in exec.Run which contain references to default values results in an error when evaluating.

This fixes the handling of default values in exec.Run to ensure that environment variables which reference them are populated correctly.

Fixes #2572.

@nickfiggins nickfiggins requested a review from cueckoo as a code owner January 9, 2024 02:53
MESSAGE: #message
SENDER: *"John Doe" | string
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if there's any concerns with the testing here 🙂 . I noticed an issue with how lists are handled (I think) and opened #2763, so I didn't include a test here for the list variation of env currently.

@nickfiggins nickfiggins changed the title pkg/tool/exec: handle default value references environment variables pkg/tool/exec: handle default value references in environment variables Jan 9, 2024
…t variables

Currently, environment variables used in exec.Run which contain
references to default values results in an error when evaluating.

This fixes the handling of default values in exec.Run to ensure
that environment variables which reference them are populated
correctly.

Fixes cue-lang#2572.

Signed-off-by: Nick Figgins <[email protected]>
@nickfiggins nickfiggins changed the title pkg/tool/exec: handle default value references in environment variables pkg/tool/exec: handle default value references in exec.Run environment variables Jan 9, 2024
@mvdan
Copy link
Member

mvdan commented Jan 9, 2024

Thank you! This appears to be a duplicate of #1787, but you correctly spotted that this mistake appears on lists as well, and your tests are more extensive, so I think we should merge this PR :)

cueckoo pushed a commit that referenced this pull request Jan 9, 2024
Abandoned

It turns out that an issue was filed for this half a year ago (#2572) and #2764 was just sent as an alternative PR, which also fixes this for lists and has more tests, so I'll go with that one assuming it's okay with you. Thank you for contributing nonetheless!

Patch-set: 1
Status: abandoned
Tag: autogenerated:gerrit:abandon
Attention: {"person_ident":"Gerrit User 1017723 \u003c1017723@d5d70762-12d0-45a1-890d-524b12d3f735\u003e","operation":"REMOVE","reason":"Change was abandoned"}
Copy link
Member

@mvdan mvdan left a comment

Choose a reason for hiding this comment

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

Thank you! Imported to Gerrit as https://review.gerrithub.io/c/cue-lang/cue/+/1174339

If you want to make more contributions, I'd recommend doing so on Gerrit directly, so that we can avoid this indirection and extra steps :) https://github.com/cue-lang/cue/blob/master/CONTRIBUTING.md#preparing-for-gerrithub-cl-contributions

@mvdan
Copy link
Member

mvdan commented Jan 9, 2024

I also used a slightly shorter commit message title, but otherwise the commit is unchanged.

@nickfiggins
Copy link
Contributor Author

Thank you! Imported to Gerrit as https://review.gerrithub.io/c/cue-lang/cue/+/1174339

If you want to make more contributions, I'd recommend doing so on Gerrit directly, so that we can avoid this indirection and extra steps :) https://github.com/cue-lang/cue/blob/master/CONTRIBUTING.md#preparing-for-gerrithub-cl-contributions

Ah got it, thanks! I'll try and use Gerrit next time 🙂

@cueckoo cueckoo closed this in e7c2ede Jan 10, 2024
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.

cmd/cue: tool/exec.Run complains when environment variable values are set via a reference's default
2 participants