-
Notifications
You must be signed in to change notification settings - Fork 0
Default to use poetry on push and PR #51
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
Conversation
This is necessary because input parameters only exist for workflow_call and workflow_dispatch, so it's not really possible to set a default value when the action is triggered by a push or pull request. However, since the sample project also uses poetry, those triggers should use it as well. This should solve that.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 7 7
=========================================
Hits 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4ad0a80 to
b70c1d4
Compare
14b4a4d to
a90c37d
Compare
|
Alright, this was a lot of work, although simple in concept. Understanding how exactly GitHub actions interprets various things is hard, and so is the syntax in these workflow files. But I think I now tested all possible cases and it seems to do what it should. That is, use the input flag when called from elsewhere or manually and default to using poetry when triggered internally from a PR or push. The admittedly hacky |
|
Once this is reviewed, I'm going to squash merge this. There's no reason to keep all the debug commits in here, but I found it impossible to test this locally... |
|
OK, let's try to break this down, because I don't understand at all what we're trying to do and how we are accomplishing it. I do understand the total clusterduck github actions is. So I fully trust you, and am trying to learn. Just thinking out loud here, so I can check whether I understand this.
Sounds good! Now I'm wondering why we don't use poetry all the time though. I understand some projects don't use poetry, but those never use it, and the rest can always use it. At least that is what I naively would think.
I'm not sure, but I think this is referring to the
Ah, OK, so the
I fully appreciate this frustration. You are way more patient than I am. I got too frustrated. E.g. AstarVienna/METIS_Pipeline#104 is technically incorrect because it uses github parameters that are not always set, but it kinda works. Now onto I don't know what 'triggered from outside' or 'external' means. I guess that Now Aaaaaah, too many braces! Let's break this down: So poetry is used in two cases:
Let's see whether I can rephrase that to when poetry is not used, to verify I understand correctly. Poetry is not used when both these conditions hold:
I'm still not sure that I fully understand this though... But I must stop here. Maybe you can use my confusion above to improve documenting what is going on a bit more? Not sure whether I would be able to properly maintain this if you would win the lottery, but I'll take that chance. |
I feel your pain. To commemorate it and let your grandchildren witness this horror from before their time, I'm going to share this screenshot: (And now let's hope that my grandchildren look back with embarrassment that I'm still using gmail.) |
Almost. It's actually referring to the So in the case that the workflow is triggered by a "non-parameterable event",
Right. I wasn't sure how well the workflow file would handle line breaks here, so I just avoided them. I think I tried a line-by-line version already at the beginning somewhere (feel free to look through the commits...), but that didn't work, potentially for other reasons. Error messages in here are often not the most helpful. On this I suppose another way to approach this could have been to "normalize" the workflows such that the actual workflow is only triggered by
It occurred to me halfway through all of this, that we don't have many repos left that use these workflows (IRDB doesn't) that don't use poetry. After all, it most likely would have been quicker to just convert those to poetry and ditch the non-poetry part and by extension the whole input parameter. But hey, if we ever run into a case like this again, we now know how to solve it! I should write it down somewhere... |
I disabled those emails long ago 😆 |
|
I didn't mean to imply that we should split up the conditional over multiple lines in the code, I just did that in the comment to figure out how it worked. I still don't fully understand, but I trust you |
Yeah no, I would be nice to do that, but in the end I don't think we'll look at this piece of code too often. There were just too many other things going on during the conference that kept me from merging this... |

This is necessary because input parameters only exist for workflow_call and workflow_dispatch, so it's not really possible to set a default value when the action is triggered by a push or pull request. However, since the sample project also uses poetry, those triggers should use it as well. This should solve that.