You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Motivation
For years we've had problems with not being able to run certain `dfx`
commands from the nns-dapp repo directory because `dfx` is confused by
the `.networks.local` entry in our `dfx.json` which will isolate a `dfx`
instance running in that directory from one running from another
directory.
This is, for example, why we `cd $HOME`
[here](https://github.com/dfinity/nns-dapp/blob/acb99323c33d849b969c1e181ad6a6c4b987545a/scripts/dfx-snapshot-start#L59-L60).
This is extra confusing because it's not enforced strictly so only some
commands fail because of this.
For historical reasons we have a lot of configuration in our `dfx.json`
which is not read by `dfx` itself and only by our scripts.
By moving this configuration to a separate file, we can finally remove
the `.networks.local` entry and run all `dfx` commands from the same
directory.
# Changes
1. Split `config.json` from `dfx.json`.
2. Update scripts to read config from `config.json` instead of
`dfx.json`.
3. Stop `cd`ing to another directory before invoking `dfx`.
4. Format `config.json` in `scripts/fmt-json`.
# Tests
1. Manually ran `dfx-snapshot-start` and verified that it works without
`cd`'ing away.
2. Manually ran `scripts/update_ic_commit --crate sns_aggregator
--ic_commit "release-2024-10-11_14-35-overload"`.
3. Manually ran `scripts/update-snsdemo --dir ../../snsdemo/tree2
--release release-2025-02-05`.
4. Manually ran `scripts/setup`.
5. Manually ran `scripts/install-didc`.
6. Manually ran `scripts/ensure-required-didc-version`.
Although there is quite some coverage on CI and I try to test as much as
possible, it's quite possible that one of the periodic workflows will
fail and will have to be fixed. So we should be on the lookout for that.
# Todos
- [ ] Add entry to changelog (if necessary).
not necessary
# Note: Please be careful when updating the add-paths field. We have had the snsdemo committed by accident, with a pattern that matches nothing seemingly committing everything.
68
68
add-paths: |
69
-
dfx.json
69
+
config.json
70
70
declarations/*/*.did
71
71
rs/sns_aggregator/src/types/*
72
72
branch: bot-aggregator-update
@@ -80,7 +80,7 @@ jobs:
80
80
Even with no changes, just updating the reference is good practice.
81
81
82
82
# Changes
83
-
* Update the version of `IC_COMMIT_FOR_SNS_AGGREGATOR` specified in `dfx.json`.
83
+
* Update the version of `IC_COMMIT_FOR_SNS_AGGREGATOR` specified in `config.json`.
84
84
* Updated the `sns_aggregator` candid files to the versions in that commit.
85
85
* Updated the Rust code derived from `.did` files in the aggregator.
# Note: Please be careful when updating the add-paths field. We have had the snsdemo committed by accident, with a pattern that matches nothing seemingly committing everything.
# Note: Please be careful when updating the add-paths field. We have had the snsdemo committed by accident, with a pattern that matches nothing seemingly committing everything.
75
75
add-paths: |
76
-
dfx.json
76
+
config.json
77
77
declarations/*/*.did
78
78
rs/proposals/src/canisters/*/api.rs
79
79
delete-branch: true
80
80
title: 'bot: Update proposals candid bindings'
81
-
# Note: It is _likely_ but not guaranteed that the .did files match the `IC_COMMIT` in `dfx.json`. The files in the PR have a header that give this information reliably.
81
+
# Note: It is _likely_ but not guaranteed that the .did files match the `IC_COMMIT` in `config.json`. The files in the PR have a header that give this information reliably.
82
82
# We do _not_ put a commit in the PR title as it could be misleading.
83
83
body: |
84
84
# Motivation
85
85
We would like to render all the latest proposal types.
86
86
Even with no changes, just updating the reference is good practice.
87
87
88
88
# Changes
89
-
* Update the version of `IC_COMMIT_FOR_PROPOSALS` specified in `dfx.json`.
89
+
* Update the version of `IC_COMMIT_FOR_PROPOSALS` specified in `config.json`.
90
90
* Updated the `proposals` candid files to the versions in that commit.
91
91
* Updated the Rust code derived from `.did` files in the proposals payload rendering crate.
# Note: Please be careful when updating the add-paths field. We have had the snsdemo committed by accident, with a pattern that matches nothing seemingly committing everything.
75
-
add-paths: dfx.json
75
+
add-paths: |
76
+
config.json
77
+
dfx.json
76
78
delete-branch: true
77
79
title: 'bot: Update snsdemo to ${{ steps.update.outputs.release }}'
78
80
body: |
79
81
# Motivation
80
82
We would like to keep the testing environment, provided by snsdemo, up to date.
81
83
82
84
# Changes
83
-
* Updated `snsdemo` version in `dfx.json`.
85
+
* Updated `snsdemo` version in `config.json`.
84
86
* Ensured that the `dfx` version in `dfx.json` matches `snsdemo`.
0 commit comments