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

Error if network is defined but not exported #3771

Merged
merged 4 commits into from
Nov 16, 2023
Merged

Conversation

bitdivine
Copy link
Member

@bitdivine bitdivine commented Nov 16, 2023

Motivation

DFX_NETWORK is typically provided to dfx build commands as an exported environment variable. When checking that DFX_NETWORK is provided, we need to check specifically that it is exported as otherwise it is possible to get very confusing behaviour in which the network is defined in one part of the deployment but not another.

Changes

  • Check that DFX_NETWORK is exported.

Tests

  • Tests have been added that the error message specifically mentions DFX_NETWORK not being exported.

Todos

  • Add entry to changelog (if necessary).

@bitdivine bitdivine marked this pull request as ready for review November 16, 2023 04:31
@bitdivine bitdivine mentioned this pull request Nov 16, 2023
1 task
@bitdivine bitdivine force-pushed the deploy-error-message branch from 38c9d97 to 96ca3fc Compare November 16, 2023 05:08
Copy link
Contributor

@lmuntaner lmuntaner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bitdivine bitdivine added this pull request to the merge queue Nov 16, 2023
Merged via the queue into main with commit aff6669 Nov 16, 2023
@bitdivine bitdivine deleted the deploy-error-message branch November 16, 2023 07:36
github-merge-queue bot pushed a commit that referenced this pull request Nov 16, 2023
# Motivation
With dfx 0.15.1 this fails with a confusing error message:
```
./deploy.sh --nns-dapp local
```
This is due to the network being defined but not exported.

# Changes
- Export `DFX_NETWORK`.

# Tests
* Tested locally. CI tests are underway but I am unlikely to get them
finished this morning so this is to unblock developers.
* Fixes and tests for appropriate error messages are in #3771 

# Todos

- [x] Add entry to changelog (if necessary).
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