-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Motivation We would like to add API functions to the nns-dapp that are present only in test deployments. For this, we need a separate test build. This is not the first case of a wasm having build flavours. For example, [Internet Identity has production, test and dev flavours](https://github.com/dfinity/internet-identity/releases/tag/release-2023-07-21). # Changes * Add a feature flag called `test` to the nns-dapp crate. The feature flag will be used to gate API methods available only in test builds. * Build with `test` in the dockerfile. * Add the test build to the list of wasms published in releases. * For consistency, the `noassets` build, used for testnets, is also published. The `noassets` build could also be named the `tiny` build but that is outside the scope of this PR. * Note: This gives us three build flavours: `production`, `test` and `tiny` aka `noassets` * Note: For consistency, the wasms are named: `nns-dapp_${flavour}.wasm.gz` * Create a separate API method list for each build flavour. The API method list is used to check that the wasm API is as expected, and we expect the APIs to diverge. # Tests - See a toy release: https://github.com/dfinity/nns-dapp/releases/tag/dev-build-test-tag # Todos - [x] Add entry to changelog (if necessary). --------- Co-authored-by: Max Murphy-Skvorzov <[email protected]>
- Loading branch information
Showing
12 changed files
with
131 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../scripts/clap.bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
SOURCE_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" | ||
PATH="$SOURCE_DIR:$PATH" | ||
|
||
print_help() { | ||
cat <<-EOF | ||
Creates the text for GitHub releases. | ||
EOF | ||
} | ||
|
||
# Source the clap.bash file --------------------------------------------------- | ||
source "$SOURCE_DIR/clap.bash" | ||
# Define options | ||
clap.define short=t long=tag desc="The git tag of the release" variable=DFX_RELEASE_NAME default="${GITHUB_REF_NAME:-unnamed}" | ||
clap.define short=d long=dir desc="The asset dir" variable=DFX_ASSET_DIR default="out" | ||
# Source the output file ---------------------------------------------------------- | ||
source "$(clap.build)" | ||
|
||
GITHUB_REPOSITORY="${GITHUB_REPOSITORY:-dfinity/nns-dapp}" | ||
GITHUB_SHA="${GITHUB_SHA:-$(git rev-parse HEAD)}" | ||
|
||
cat <<EOF | ||
This is a release of the $(nns-dapp) and $(sns_aggregator) canisters. | ||
Release: [$DFX_RELEASE_NAME](https://github.com/$GITHUB_REPOSITORY/releases/tag/$DFX_RELEASE_NAME) | ||
Commit: [$GITHUB_SHA](https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA) | ||
| Filename | sha256 | | ||
|---|---| | ||
$( | ||
# Prints a row in the table describing a wasm, if it exists. | ||
file_row() { | ||
local filename sha | ||
filename="${canister}${flavor:+_}${flavor}.wasm.gz" | ||
if test -e "$DFX_ASSET_DIR/$filename"; then | ||
sha="$(sha256sum "$DFX_ASSET_DIR/$filename" | awk '{print $1}')" | ||
printf "| %s | %s |\n" "[$filename](https://github.com/$GITHUB_REPOSITORY/releases/download/$DFX_RELEASE_NAME/$filename)" "$sha" | ||
fi | ||
} | ||
for canister in nns-dapp sns_aggregator; do | ||
for flavor in "" production test dev noassets; do | ||
file_row | ||
done | ||
done | ||
) | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
canister_global_timer | ||
canister_heartbeat | ||
canister_init | ||
canister_post_upgrade | ||
canister_pre_upgrade | ||
canister_query get_account | ||
canister_query get_canisters | ||
canister_query get_stats | ||
canister_query get_transactions | ||
canister_query http_request | ||
canister_update <ic-cdk internal> timer_executor | ||
canister_update add_account | ||
canister_update add_assets_tar_xz | ||
canister_update add_pending_notify_swap | ||
canister_update add_stable_asset | ||
canister_update attach_canister | ||
canister_update create_sub_account | ||
canister_update detach_canister | ||
canister_update get_proposal_payload | ||
canister_update register_hardware_wallet | ||
canister_update rename_canister | ||
canister_update rename_sub_account | ||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# TODO: Add tiny/noassets to this list once it is built with a cargo feature flag. | ||
# shellcheck disable=SC2034 | ||
NNS_DAPP_BUILD_FLAVOURS=( production test ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters