-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Use mill examples in init #3583
Conversation
@lihaoyi I have added some integration tests which tries to download examples from GitHub repo, |
CI should be able to access the internet, not sure why it's failing |
I have found the issue, I was relying on millVersion target to build download URLs. But nor millVersion, neither millLastTag targets returns valid versions when runned on CI. @lihaoyi |
@pawelsadlo I think for the purposes of this ticket, let's skip end-to-end tests that download from Github. Those are inherently non-hermetic and we don't have the infrastructure to stand up test github instances to make them hermetic. Smaller unit tests for the various pieces of logic, maybe an integration test with the download-zip-from-github logic overriden with a local file, and manually exercising the end to end workflow, should be enough for now |
@lihaoyi, could you review, please? |
@pawelsadlo could you update the PR description with a summary of the changes and anything worth taking note of? That would make the review easier |
@lihaoyi I have updated the description |
Thanks! will take a look tomorrow |
@lihaoyi do you have any better error msg in mind? will add test shortly. Ad3 - its working as expected, I just didnt update repo locally. |
@lihaoyi link to example is of the form: but <millLastTag()> is failing on CI so what is coded now is millVersion() instead of millLastTag() but this forms malformed links for current version instead of: Is this a big problem to have it wrong in RC version (assuming that in release it will be fixed)? if its a big problem we can always manually get tag from millVersion() by parsing the string - it should be quite easy to do (this would remove millLastTag() call, which is failing the CI) Edit: actually i think catching error on millLastTag , and emiting warning both to the console and writing it instead of exampleUrl would be the best if we can't detect running on CI, what do you think? |
@pawelsadlo I'd be OK parsing Mill on Github Actions should have the |
There is just a hard coded fallback to 0.0.0 on mill version targer.
I was trying this, but it didn't work. |
Thanks @pawelsadlo, give me some time to tinker around with the PR and I think we can merge it. |
Sure , take your time |
Looks good to me, i'll continue tinkering with it post-merge. @pawelsadlo will send the bank transfer using the same details as before |
was there a specific reason why the codesig object was moved to its own package.mill? |
implements #3548
Modifying init to fetch examples from releases page instead of using g8 template
This introduces new top-level module
initmodule
this module generates resource
exampleList.txt
containing json with array of pairs(exampleId,exampleUrl)
exampleId
andexampleUrl
are formed based on already presentexampleZips
target, andmillVersion()
.initmodule introduces external module
MillInitModule
calls to
mill init
are redirected toMillInitModule.init
(basically the same logic as it was withGiter8Module.init
)MillInitModule.init
called without parameters prints message containingexampleids
list based on generated exampleList.txt in the form of:When called with a parameter it validates if passed parameter is in the list, and if so, it downloads example from github releases page and unpacks it into the directory from where the command was run.