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

fix: do not replace '.' in floating point numbers #904

Closed
wants to merge 1 commit into from

Conversation

ZauberNerd
Copy link
Contributor

No description provided.

Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
@ZauberNerd ZauberNerd requested a review from a team as a code owner November 25, 2021 15:35
@codecov
Copy link

codecov bot commented Nov 25, 2021

Codecov Report

Merging #904 (f868b86) into master (0f04942) will increase coverage by 7.17%.
The diff coverage is 61.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #904      +/-   ##
==========================================
+ Coverage   49.27%   56.45%   +7.17%     
==========================================
  Files          23       25       +2     
  Lines        2401     3961    +1560     
==========================================
+ Hits         1183     2236    +1053     
- Misses       1090     1525     +435     
- Partials      128      200      +72     
Impacted Files Coverage Δ
pkg/common/outbound_ip.go 0.00% <0.00%> (ø)
pkg/container/docker_volume.go 0.00% <0.00%> (ø)
pkg/model/action.go 0.00% <ø> (ø)
pkg/container/docker_run.go 5.53% <14.54%> (+3.60%) ⬆️
pkg/common/git.go 49.82% <31.81%> (-9.97%) ⬇️
pkg/model/planner.go 49.78% <42.50%> (+16.70%) ⬆️
pkg/container/docker_build.go 58.97% <50.00%> (+58.97%) ⬆️
pkg/container/docker_pull.go 28.35% <58.06%> (+10.17%) ⬆️
pkg/model/workflow.go 52.14% <63.63%> (+26.42%) ⬆️
pkg/artifacts/server.go 67.32% <67.32%> (ø)
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ebcac3...f868b86. Read the comment docs.

@ChristopherHX
Copy link
Contributor

FYI Such a fix is included in https://github.com/nektos/act/pull/792/files#diff-1b1bd72cb2c57bae52ca138d34eafb6521db6556f94db086dfb2b6efdb83613b and much more. I supended this and let it to be closed, because I was to lazy to test it and merge it into my fork.

However I come to the conclusion it would be better to translate the c# interpreter to golang instead of using the otto engine and hacking javascript to match github.

The official interpreter is here https://github.com/actions/runner/tree/main/src/Sdk/DTExpressions2/Expressions2. I use it in my own local c# github actions runner, it works a lot of better than the act equivalent.

@ZauberNerd
Copy link
Contributor Author

@ChristopherHX we've found more issues with the current otto expression parser and were looking for a different way.
We've now found https://github.com/rhysd/actionlint which has a golang API: https://pkg.go.dev/github.com/rhysd/actionlint and we are trying to implement an interpreter using it. You can see our progress here on this branch: https://github.com/ZauberNerd/act/tree/exprparser (not sure, if we'll finish that though - for now it is simple, but later on it will get more complex).

@ZauberNerd
Copy link
Contributor Author

Btw, that actionlint package has a few other goodies which would make great additions to act
/cc @cplee @catthehacker

@ZauberNerd ZauberNerd marked this pull request as draft November 25, 2021 17:02
@catthehacker
Copy link
Member

I'm aware of actionlint but it's not something I looked into for various reasons.

@ChristopherHX
Copy link
Contributor

Actionslint seems to have a far more conforming parser than act and haven't found any problem during my first test.

@ZauberNerd
I like your approach much more than what act does today, on top of that better error messages. Not shure what would speak against using it.

@ZauberNerd
Copy link
Contributor Author

Closing this in favor of: #908

@ZauberNerd ZauberNerd closed this Nov 29, 2021
@ZauberNerd ZauberNerd deleted the fix-float-evaluation branch November 29, 2021 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants