-
Notifications
You must be signed in to change notification settings - Fork 9
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
properly convert env interactions into context #271
Conversation
We require contributors to sign our Contributor License Agreement and we don't have one on file for @AaronOpfer. In order for us to review and merge your code, please e-sign the Contributor License Agreement PDF. We then need to manually verify your signature, merge the PR (conda/infrastructure#1077), and ping the bot to refresh the PR. |
@conda-bot check |
This input: ```yaml {% set a = environ["a"] %} {% set b = environ.get("b", "0") %} package: name: abc version: 0 ``` on `main` emits this recipe that needs manual correction: ```yaml schema_version: 1 context: a: "\"env.get(\"a\")\"" b: "\"environ | get(\"b\", \"0\")\"" package: name: abc version: 0 ``` but after this PR, it will instead emit: ```yaml schema_version: 1 context: a: ${{env.get("a")}} b: ${{env.get("b", default="0")}} package: name: abc version: 0 ``` which does not need any further editing.
CLA is sorted now. It looks like CI is blocked on that. |
Apologies for the delay, I was OOO late last week for medical reasons. I'll try to take a look at this today. I think this is the first outside contribution to the Python code for this project. I'll ask for some patience as we work out process issues, but I am super excited to see a community contribution! |
It looks like the code formatter, linter, and static analyzer checks failed. Let me know if you need assistance setting that up locally. Any feedback on the README or other documentation is very welcome. It would be nice to know if there is room for improvement! |
These are my notes in no particular order:
I think I got local dev working regardless but it wasn't painless. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't worry about this being "hacky". The V0 recipe format is a mess, and to some extent, this library pays the price to be inherently messy so others don't have to be :)
You touched on it in a few places in your review so I will address it here: The main problem that caused me to introduce all of these Ideally, we would instead make the recipe's context values a I am not sure how much appetite you have for this though. |
If you could give more details on which version(s) of I suppose one could argue that we should edit the
That's a stop-gap for waiting on packages to be made available. IMO that shouldn't have to be an issue, or at least conda should throw a fit if that is unsupported behavior. I'll have to have a think if we should prefer
That's upsetting to hear, but not surprising with being a trailblazer with this PR. I'm not super familiar with such configurations. I personally maintain the Thanks for the feedback! |
If I had infinite time and money, we could. But realistically, I am very resource constrained and have a lot on my plate.
We should add at least one unit test though for regression detection. I know you've had issues running this locally, so let me know if you have time to add the tests yourself or if you'd prefer for me to throw it on this PR/make a follow-up. The file of interest should be |
I added test cases and I resolved your comments by adding breadcrumbs and making all references to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an aside: it looks like we reduced our error count in the rattler-build
conversion integration testing by 4. Nice.
Thanks for the contribution!
This input:
on
main
emits this recipe that needs manual correction:but after this PR, it will instead emit:
which does not need any further editing.
This patch feels a little hacky, and I would especially like to immortalize my test case. I'm happy to accept feedback on how to go about making this patchset less hacky and immortalize my test case.
Thanks for your time.