-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'list-new-commits-daniel-wong' into 'master'
Added list-new-commits.sh to testnet/tools/nns-tools. This is useful for figure out which canisters we want to upgrade. This is super easy to run. No arguments are required. (There are no optional arguments either, but we could add that later, if desired.) This supersedes diff-latest-nns-from-deployed.sh, whose contents has now been replaced with a redirect. This is better version of that, because this does ALL (NNS) canisters, not just the one that you name on the command line. Other than that, they are very similar (hence, this supersedes). See merge request dfinity-lab/public/ic!13485
- Loading branch information
Showing
2 changed files
with
47 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,5 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
NNS_TOOLS_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) | ||
source "$NNS_TOOLS_DIR/lib/include.sh" | ||
|
||
help() { | ||
print_green " | ||
Usage: $0 <NNS_CANISTER_NAME> (<NETWORK>) | ||
This script will give you a git diff between the latest version with assets available in S3 against the latest version | ||
deployed. It can be used to determine if an upgrade proposal should be created. | ||
NNS_CANISTER_NAME: The human readable canister name (governance, cycles-minting, ledger, root, sns-wasm, registry, | ||
lifeline, and genesis-token supported) | ||
NETWORK: The URL of the replica to hit, or 'ic'. Defaults to 'ic' | ||
" | ||
} | ||
|
||
if [ $# -lt 1 ]; then | ||
help | ||
exit 1 | ||
fi | ||
|
||
NNS_CANISTER_NAME=$1 | ||
NETWORK=${2:-ic} | ||
|
||
LAST_DEPLOYED_COMMIT=$(nns_canister_git_version "$NETWORK" "$NNS_CANISTER_NAME") | ||
echo >&2 "Deployed version: $LAST_DEPLOYED_COMMIT" | ||
|
||
echo >&2 "Finding latest version with assets..." | ||
NEXT_COMMIT_TO_DEPLOY=$(latest_commit_with_prebuilt_artifacts 2>/dev/null) | ||
echo >&2 "Latest with assets: $NEXT_COMMIT_TO_DEPLOY" | ||
|
||
CANISTER_CODE_LOCATION=$(get_nns_canister_code_location "$NNS_CANISTER_NAME") | ||
|
||
echo >&2 "Commits that could be deployed: " | ||
set -x | ||
git log --format="%C(auto) %h %s" "$LAST_DEPLOYED_COMMIT".."$NEXT_COMMIT_TO_DEPLOY" -- $CANISTER_CODE_LOCATION | ||
echo "This has been superseded by ./list-new-commits.sh." | ||
exit 1 |
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,45 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
NNS_TOOLS_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) | ||
source "$NNS_TOOLS_DIR/lib/include.sh" | ||
|
||
help() { | ||
print_green " | ||
Usage: $0 | ||
Prints unreleased canister git logs. This indicates which canisters should be | ||
released. | ||
TODO: Add support for SNS canisters. | ||
" | ||
exit 1 | ||
} | ||
|
||
if [ $# -ne 0 ]; then | ||
help | ||
fi | ||
|
||
# TODO: Let caller override this from the command line. | ||
RELEASE_CANDIDATE_COMMIT_ID=$(latest_commit_with_prebuilt_artifacts 2>/dev/null) | ||
echo "Tip of master:" "$RELEASE_CANDIDATE_COMMIT_ID" | ||
|
||
# TODO: Some entries are commented out, because they are not in rs/nns/canister_ids.json. | ||
NNS_CANISTERS=( | ||
cycles-minting | ||
governance | ||
genesis-token | ||
lifeline | ||
registry | ||
root | ||
sns-wasm | ||
) | ||
|
||
for canister_name in "${NNS_CANISTERS[@]}"; do | ||
echo | ||
echo Canister: "$canister_name" | ||
|
||
network=ic | ||
released_commit_id=$(nns_canister_git_version "$network" "$canister_name" 2>/dev/null) | ||
root=$(get_nns_canister_code_location "$canister_name") | ||
git log --format="%C(auto) %h %s" "$released_commit_id".."$RELEASE_CANDIDATE_COMMIT_ID" -- $root | ||
done |