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

Expose calcVcsState publicly for external usage #165

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Conversation

lihaoyi
Copy link
Collaborator

@lihaoyi lihaoyi commented Dec 11, 2024

This is necessary in order to make it conditionally used (e.g. only enabled based on an environment variable), so Mill's own code can take advantage of com-lihaoyi/mill#4091

As an Task.Input, it always is present in the task graph even when the value is ignored due to an if conditional, meaning it always triggers downstream tasks and tests during selective execution. Whereas as a helper method I can guard against its usage in an if statement (e.g. checking a sys.env variable), and if it isn't used it never ends up in the build graph at all

@lihaoyi lihaoyi requested a review from lefou December 11, 2024 06:46
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.56%. Comparing base (03259dc) to head (1ff0032).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #165   +/-   ##
=======================================
  Coverage   97.56%   97.56%           
=======================================
  Files           3        3           
  Lines          41       41           
  Branches        6        6           
=======================================
  Hits           40       40           
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lefou lefou merged commit 3478bae into main Dec 11, 2024
10 checks passed
@lefou lefou deleted the lihaoyi-patch-1 branch December 11, 2024 08:07
@lefou lefou added this to the after 0.4.0 milestone Dec 11, 2024
@lihaoyi
Copy link
Collaborator Author

lihaoyi commented Dec 11, 2024

Thanks for merging @lefou. Could you help me cut a tag? I'd like to begin using this in the Mill codebase once the linked PR lands

@lefou
Copy link
Owner

lefou commented Dec 11, 2024

There should be a automatic snapshot release published. I also started the release process for 0.4.1.

lihaoyi added a commit to com-lihaoyi/mill that referenced this pull request Dec 12, 2024
Not enough to turn on selective execution in Mill's CI yet, but it's
steps in that direction.

* Make `BuildInfo#resources` a cached task, which is more correct (since
it doesn't add any source files) and seems to remove some noise in
changed `inputTaskHashes`
* Fix handling of `defaultCommandName` in `selective.resolve` and add a
unit test
* Nicely format `mill-selective-execution.json` for easy debugging
* Bump mill-vcs-version to pull in
lefou/mill-vcs-version#165, so we can stabilize
`build.millVersion`
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.

2 participants