Skip to content

Commit

Permalink
chore: release 0.15.2 beta.2 (#3449)
Browse files Browse the repository at this point in the history
* feat: Read install arg from file (#3431)

# Description
This PR adds support for providing install arguments from a file.

This is motivated by these issues:

* It is impossible to pass a large canister init arg as the length of shell arguments is limited by the terminal (which in turn may be limited by the operating system).
* For shorter arguments, it is more convenient to write `--argument-file somefile.hex` than `--argument "$(cat somefile.hex)"`.
* The `dfx canister call` method supports `--argument-file` for similar reasons.  It would be nice to be consistent.

* fix: output .env file is now relative to project root, not cwd (#3435)

dfx.json can specify `output_env_file` (the default for new projects is `".env"`), and some commands accept `--output-env-file .env` on the command line.

If `dfx deploy`, `dfx build`, or `dfx canister install` were executed in a subdirectory of a project, they would create/read this file in that subdirectory, rather than the same directory as dfx.json (the project root).

With this change, the location of the env file is taken to be relative to the project root, and furthermore must be contained within the project directory.

Also fixed three places that could output "No such file or directory (OS error 2)" without telling which path wasn't found.

Fixes: https://dfinity.atlassian.net/browse/SDK-1028

* fix: dfx extension install will no longer create a corrupt cache directory (#3436)

Running `dfx extension install <extension>` immediately after installing a new dfx version, or after `dfx cache delete`, would result in a cache directory that contained only an `extensions` subdirectory.

Later, dfx would see that the cache directory exists and therefore not install it.  Then, commands like `dfx start` or `dfx build` would fail due to missing files.

Fixes: https://dfinity.atlassian.net/browse/SDK-1240

* ci: add workflow to update bitcoin canister sources (#3438)

* chore: Update Bitcoin Canister to release/2023-10-13 (#3439)

Co-authored-by: github-actions <[email protected]>

* chore: update Motoko version to 0.10.2 (#3441)

## Suggested [CHANGELOG.md](https://github.com/dfinity/sdk/edit/chore-update-motoko-0.10.2/CHANGELOG.md) changes
```
## Dependencies

### Motoko

Updated Motoko to [0.10.2](https://github.com/dfinity/motoko/releases/tag/0.10.2)

* fix: deleting project canister by id will clean up canister id store. (#3442)

`dfx canister delete <by id>` would leave entries (canister name -> canister id) in the canister id store.  A subsequent `dfx deploy` would then fail because it would try to install to the deleted canister rather than creating a new one.

Fixes https://dfinity.atlassian.net/browse/SDK-1143

* chore: Update to new ic-agent version (#3445)

* Update to new ic-agent version

* .

* fix some tests, add env var for disabling query cert

* per command

* fix other tests

* 0.30.2

* chore: Release 0.15.2-beta.2

Signed-off-by: Marcin Nowak-Liebiediew <[email protected]>

---------

Signed-off-by: Marcin Nowak-Liebiediew <[email protected]>
Co-authored-by: Max <[email protected]>
Co-authored-by: Eric Swanson <[email protected]>
Co-authored-by: DFINITY bot <[email protected]>
Co-authored-by: github-actions <[email protected]>
Co-authored-by: Adam Spofford <[email protected]>
  • Loading branch information
6 people authored Nov 17, 2023
1 parent 8230fe1 commit d9f2c98
Show file tree
Hide file tree
Showing 37 changed files with 445 additions and 96 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/bitcoin-canister-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Check Bitcoin Canister Release Update

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Runs at UTC midnight every day

jobs:
check-update:
runs-on: ubuntu-latest

steps:
- name: Checkout dfx repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Fetch Bitcoin Canister latest release tag
env:
GH_TOKEN: "${{ secrets.NIV_UPDATER_TOKEN }}"
run: |
LATEST_TAG=$(gh release view --repo dfinity/bitcoin-canister --json tagName -q .tagName)
echo "Latest tag is $LATEST_TAG"
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
- name: Check if the latest release tag has been updated
run: |
URL_ENCODED_CURRENT_TAG=$(jq -r '.["ic-btc-canister"].version' nix/sources.json)
CURRENT_TAG=$(python -c "import sys, urllib.parse as ul; print(ul.unquote_plus(sys.argv[1]))" "$URL_ENCODED_CURRENT_TAG")
echo "Current tag is $CURRENT_TAG"
if [[ "$CURRENT_TAG" == "$LATEST_TAG" ]]; then
echo "No update is required."
exit 1
else
echo "An update is required."
fi
- name: install Nix
uses: cachix/install-nix-action@v21
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: install niv (dependency manager for Nix projects)
run: nix-env -i niv -f '<nixpkgs>'

- name: install packages from nix/sources.json
run: niv update

- name: update sources
run: |
URL_ENCODED_LATEST_TAG=$(echo -n "$LATEST_TAG" | python -c 'import sys, urllib.parse; print(urllib.parse.quote(sys.stdin.read().strip(), safe=""))')
niv update ic-btc-canister -a version=$URL_ENCODED_LATEST_TAG
./scripts/write-dfx-asset-sources.sh
- name: Update dfx to use the latest Bitcoin Canister version
env:
GH_TOKEN: "${{ secrets.NIV_UPDATER_TOKEN }}"
run: |
git config user.name github-actions
git config user.email [email protected]
git checkout -b bot/update-bitcoin-canister/$LATEST_TAG
git add .
git commit -m "Update Bitcoin Canister to $LATEST_TAG"
git push --set-upstream origin bot/update-bitcoin-canister/$LATEST_TAG
PR_TITLE="chore: Update Bitcoin Canister Version to $LATEST_TAG"
PR_BODY="This PR updates the Bitcoin Canister version to the latest tag: $LATEST_TAG"
gh pr create --title "$PR_TITLE" --body "$PR_BODY" --base master --head $(git branch --show-current)
4 changes: 4 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ jobs:
path: /usr/local/bin
- name: Setup dfx binary
run: chmod +x /usr/local/bin/dfx
- name: Disable query verification in ic-ref
if: ${{ matrix.backend == 'ic-ref' }}
run: |
echo DFX_DISABLE_QUERY_VERIFICATION=1 >> $GITHUB_ENV
- name: start and deploy
run: |
pwd
Expand Down
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

# UNRELEASED

=== fix: `dfx canister delete <canister id>` removes the related entry from the canister id store

Previously, deleting a canister in the project by id rather than by name
would leave the canister id in the canister id store. This would cause
`dfx deploy` to fail.

=== fix: dfx extension install can no longer create a corrupt cache directory

Running `dfx cache delete && dfx extension install nns` would previously
create a cache directory containing only an `extensions` subdirectory.
dfx only looks for the existence of a cache version subdirectory to
determine whether it has been installed. The end result was that later
commands would fail when the cache did not contain expected files.

=== fix: output_env_file is now considered relative to project root

The .env file location, whether specified as `output_env_file` in dfx.json
or `--output-env-file <file>` on the commandline, is now considered relative
to the project root, rather than relative to the current working directory.

=== feat: Read dfx canister install argument from a file

Enables passing large arguments that cannot be passed directly in the command line using the `--argument-file` flag. For example `dfx canister install --argument-file ./my/argument/file.txt my_canister_name`.


### feat: change `list_permitted` and `list_authorized` to an update call.

This requires the `list_authorized` and `list_permitted` methods to be called as an update and disables the ability to
Expand All @@ -24,7 +49,7 @@ Added the following subcommands:

### Motoko

Updated Motoko to [0.10.1](https://github.com/dfinity/motoko/releases/tag/0.10.1)
Updated Motoko to [0.10.2](https://github.com/dfinity/motoko/releases/tag/0.10.2)

### Frontend canister

Expand All @@ -51,6 +76,10 @@ This incorporates the following executed proposals:
- [124858](https://dashboard.internetcomputer.org/proposal/124858)
- [124857](https://dashboard.internetcomputer.org/proposal/124857)

### Bitcoin canister

Updated Bitcoin canister to [release/2023-10-13](https://github.com/dfinity/bitcoin-canister/releases/tag/release%2F2023-10-13)

# 0.15.1

### feat: Added support for reserved_cycles and reserved_cycles_limit
Expand Down
94 changes: 80 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d9f2c98

Please sign in to comment.