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

Unexpected number conversion of command line args #26889

Closed
2 of 4 tasks
czycha opened this issue Jul 10, 2024 · 1 comment · Fixed by #27515
Closed
2 of 4 tasks

Unexpected number conversion of command line args #26889

czycha opened this issue Jul 10, 2024 · 1 comment · Fixed by #27515
Assignees
Labels

Comments

@czycha
Copy link

czycha commented Jul 10, 2024

Current Behavior

When passing in something number-like as an arg to a task, it seems that Nx converts it to a number. For example:

GIT_COMMIT="81919e4"
echo "Building with tag $GIT_COMMIT"
nx run app:docker-build --tag $GIT_COMMIT --repo org/repo

I get the following results:

Building with tag 81919e4

 NX   Running target docker-build for project app and 20 tasks it depends on:

> nx run dep1:build  [local cache]
...
> nx run app:docker-build --tag 819190000 --repo org/repo

Note that Nx interpreted the git commit as numeric and then expanded the e4 to add 0000 at the end.

Expected Behavior

Even if the values are numeric, they should not be modified when passing them to the task. So above...

Building with tag 81919e4

 NX   Running target docker-build for project app and 20 tasks it depends on:

> nx run dep1:build  [local cache]
...
> nx run app:docker-build --tag 81919e4 --repo org/repo

GitHub Repo

https://github.com/czycha/nx-number-conversion-bug

Steps to Reproduce

  1. Install deps.
  2. Run nx build app --tag 81919e4 in your command line.
    • Bad behavior: echos "819190000"
    • Expected behavior: echos "81919e4"

Nx Report

Node   : 21.7.2
OS     : darwin-arm64
npm    : 10.5.0

nx (global)    : 19.4.2
nx             : 19.4.2
@nx/js         : 19.4.2
@nx/workspace  : 19.4.2
@nx/devkit     : 19.4.2
@nrwl/tao      : 19.4.2

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@FrozenPandaz FrozenPandaz added the scope: core core nx functionality label Jul 16, 2024
FrozenPandaz pushed a commit that referenced this issue Aug 23, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26889
FrozenPandaz pushed a commit that referenced this issue Aug 26, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26889

(cherry picked from commit ec53f31)
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants