From 8714d03fc5f399584a9b46926a6f33a743ecff6e Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Thu, 17 Oct 2024 08:34:24 -0400 Subject: [PATCH] Create 2024-09-18-node-cli-api.md (#486) * Update download-prs.sh to only download PRs that have been merged in the given date range Make date more precise in the scripts by zeroing UTC time * Update scripts/README.md * Update scripts/create-slug.sh with new arguments and parameter changes * Create 2024-09-18-node-cli-api.md --- blog/2024-09-18-node-cli-api.md | 55 ++++++++++++++++++++++++++++++++ scripts/README.md | 12 ++++--- scripts/create-slug.sh | 6 ++-- scripts/distribute-merged-prs.sh | 9 ++++-- scripts/download-prs.sh | 32 +++++++++---------- scripts/summarise-merged-prs.sh | 7 ++-- 6 files changed, 93 insertions(+), 28 deletions(-) create mode 100644 blog/2024-09-18-node-cli-api.md diff --git a/blog/2024-09-18-node-cli-api.md b/blog/2024-09-18-node-cli-api.md new file mode 100644 index 0000000000..6a359a286d --- /dev/null +++ b/blog/2024-09-18-node-cli-api.md @@ -0,0 +1,55 @@ +--- +title: Node API & CLI Team Update +slug: 2024-09-18-node-cli-api +authors: Jimbo4350 +tags: [cli-api] +hide_table_of_contents: false +--- + +# Node-Api-Cli Update +# 2024-09-04 - 2024-09-18 + +## High level summary + +In line with our ongoing refactoring work, we began propagating the [experimental api](https://github.com/input-output-hk/cardano-node-wiki/wiki/ADR-4-Support-only-for-mainnet-and-upcoming-eras) in `cardano-cli`. This will continue for several sprints as we remove eras prior to mainnet in order to reduce the unnecessary complexity of `cardano-api`'s and `cardano-cli`'s codebases. Other work: +- New functionality has been added to cardano-cli and cardano-ping +- Collateral balancing bug has been fixed in cardano-cli +- `optparse-applicative-fork` dependency has been removed +- Various refactors and improvements to cardano-testnet + +### cardano-cli +- [Add support for fetching tip through cardano-ping](https://github.com/IntersectMBO/cardano-cli/pull/888) +- [add support for script based drep on update certificate](https://github.com/IntersectMBO/cardano-cli/pull/884) +- [cardano-ping: report user friendly error on misconfiguration](https://github.com/IntersectMBO/cardano-cli/pull/893) +- [Move parsing helpers from API](https://github.com/IntersectMBO/cardano-cli/pull/894) +- [Options: avoid code duplication](https://github.com/IntersectMBO/cardano-cli/pull/890) +- [Propagate experimental api](https://github.com/IntersectMBO/cardano-cli/pull/853) +- [Release cardano-cli-9.4.0.0](https://github.com/IntersectMBO/cardano-cli/pull/885) +- [Release cardano-cli-9.4.1.0](https://github.com/IntersectMBO/cardano-cli/pull/889) +- [Remove deprecation message when invoking a command in deprecated era](https://github.com/IntersectMBO/cardano-cli/pull/887) + +### cardano-api +- [Add `fromLedgerUTxO` export](https://github.com/IntersectMBO/cardano-api/pull/627) +- [Add new types to CDDL list and test forward compatibility of `deserialiseTxLedgerCddl`](https://github.com/IntersectMBO/cardano-api/pull/634) +- [Bump CHaP](https://github.com/IntersectMBO/cardano-api/pull/610) +- [Experimental API: remove redundant type families and functions](https://github.com/IntersectMBO/cardano-api/pull/625) +- [Fix collateral balancing when building transaction](https://github.com/IntersectMBO/cardano-api/pull/631) +- [Release cardano-api-9.3.0.0 cardano-api-gen-9.0.0.0 ](https://github.com/IntersectMBO/cardano-api/pull/628) +- [Remove optparse-applicative-fork dependency, and functions depending on it](https://github.com/IntersectMBO/cardano-api/pull/635) + +### cardano-node +- [Add more context to invalid snapshot events](https://github.com/IntersectMBO/cardano-node/pull/5933) +- [Names of metrics in the new tracing system](https://github.com/IntersectMBO/cardano-node/pull/5905) +- [Update dependencies](https://github.com/IntersectMBO/cardano-node/pull/5979) + +### cardano-testnet +- [Add test for `query spo-stake-distribution`](https://github.com/IntersectMBO/cardano-node/pull/5932) +- [cardano-testnet | Add plutus V3 cost model, set minFeeRefScriptCostPerByte=15 in Conway genesis](https://github.com/IntersectMBO/cardano-node/pull/5977) +- [cardano-testnet-test: small improvements](https://github.com/IntersectMBO/cardano-node/pull/5962) +- [cardano-testnet: make call to query stake-address-info a golden test](https://github.com/IntersectMBO/cardano-node/pull/5970) +- [cardano-testnet: separate in types the options encoded in genesis files, from other options](https://github.com/IntersectMBO/cardano-node/pull/5976) +- [cardano-testnet: test value delegated to dreps in test of drep-stake-distribution](https://github.com/IntersectMBO/cardano-node/pull/5961) + +### docs + +### CI & project maintenance diff --git a/scripts/README.md b/scripts/README.md index 0cc9257efc..1d41dfd80e 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -26,18 +26,22 @@ The following scripts are included in this repository: ### PR Summary Scripts +NB: When specifying date ranges be sure the end date is the _start date of the following sprint_. If not you risk losing work done on the last day of a sprint. + +NB: Dates are converted to UTC time and are automatically zeroed: YYYY-MM-DD:00:00:00Z + To use these scripts, follow the instructions below: -1. Run the `download-prs.sh` script providing a "repository" and a "start-date" (YYYY-MM-DD) as arguments. The script will download all PRs created after the start date. For example: +1. Run the `download-prs.sh` script providing a "repository", "start-date" (YYYY-MM-DD) and "end-date" (YYYY-DD-DD) as arguments. The script will download all PRs merged in the date range. For example: ```bash -./scripts/download-prs.sh input-output-hk/cardano-node 2023-06-30 +./scripts/download-prs.sh https://github.com/IntersectMBO/cardano-node.git 2023-06-30 2023-07-30 ``` 2. Execute the `distribute-merged-prs.sh` script using the following command: ```bash -./scripts/distribute-merged-prs.sh input-output-hk/cardano-node $dir 2022-06-25 2023-04-18 +./scripts/distribute-merged-prs.sh input-output-hk/cardano-node $dir 2023-06-30 2023-07-30 ``` This script will distribute the downloaded PRs based on the files they have touched in the the directory $dir. @@ -57,7 +61,7 @@ Execute the create-slug.sh script with the following command: ```bash ./create-slug.sh ``` -This script will create a markdown file named blog/-node-cli-api.md, authored by "", with sections for updates from "" to "". It automatically runs the PR summary scripts as defined above so you can cherry pick the PRs as necessary. +This script will create a markdown file named blog/-node-cli-api.md, authored by "", with sections for updates from "" to "". It automatically runs the PR summary scripts as defined above so you can cherry pick the PRs as necessary. ## Additional Information diff --git a/scripts/create-slug.sh b/scripts/create-slug.sh index ced70ee988..27383d8448 100755 --- a/scripts/create-slug.sh +++ b/scripts/create-slug.sh @@ -48,9 +48,9 @@ hide_table_of_contents: false ### CI & project maintenance EOF -source scripts/download-prs.sh https://github.com/IntersectMBO/cardano-node.git $DATE -source scripts/download-prs.sh https://github.com/IntersectMBO/cardano-cli.git $DATE -source scripts/download-prs.sh https://github.com/IntersectMBO/cardano-api.git $DATE +source scripts/download-prs.sh https://github.com/IntersectMBO/cardano-node.git $DATE $END_DATE +source scripts/download-prs.sh https://github.com/IntersectMBO/cardano-cli.git $DATE $END_DATE +source scripts/download-prs.sh https://github.com/IntersectMBO/cardano-api.git $DATE $END_DATE source scripts/distribute-merged-prs.sh https://github.com/IntersectMBO/cardano-node.git current $DATE $END_DATE source scripts/distribute-merged-prs.sh https://github.com/IntersectMBO/cardano-cli.git current $DATE $END_DATE diff --git a/scripts/distribute-merged-prs.sh b/scripts/distribute-merged-prs.sh index 3f2b9993be..003138c963 100755 --- a/scripts/distribute-merged-prs.sh +++ b/scripts/distribute-merged-prs.sh @@ -19,12 +19,17 @@ else date_cmd=date fi -repository="$1" +repository_url="$1" subdir="$2" start_date="$("$date_cmd" -u -d "$3" +"%Y-%m-%dT%H:%M:%SZ")" end_date="$("$date_cmd" -u -d "$4" +"%Y-%m-%dT%H:%M:%SZ")" +repository_name="$(basename "$repository_url" ".git")" -work_dir="gen/$repository" +echo "Start date: $start_date" +echo "End date: $end_date" + + +work_dir="gen/$repository_name" work_subdir="$work_dir/$subdir" download_file="$work_dir/download.yaml" filtered_file="$work_subdir/filtered.yaml" diff --git a/scripts/download-prs.sh b/scripts/download-prs.sh index 886eb8157d..fd7d788798 100755 --- a/scripts/download-prs.sh +++ b/scripts/download-prs.sh @@ -7,9 +7,9 @@ set -euo pipefail exit 1 } -if [ "$#" -ne 2 ]; then - echo "Usage: $0 repository" >&2 - echo "Example: $0 IntersectMBO/cardano-node" >&2 +if [ "$#" -ne 3 ]; then + echo "Usage: $0 repository_url start_date end_date" >&2 + echo "Example: $0 IntersectMBO/cardano-node 2024-09-04 2024-09-17" >&2 exit 1 fi @@ -19,27 +19,27 @@ else date_cmd=date fi -repository="$1" -date="$2" +repository_url="$1" +repository_name="$(basename "$repository_url" ".git")" -out_dir="gen/$repository" +start_date="$("$date_cmd" -u -d "$2" +"%Y-%m-%dT%H:%M:%SZ")" +end_date="$("$date_cmd" -u -d "$3" +"%Y-%m-%dT%H:%M:%SZ")" + +out_dir="gen/$repository_name" mkdir -p "$out_dir" temp_json_file="$(mktemp).json" -# Find a reasonable number for -L -max_pr_number="$(gh pr list --repo "$repository" --state all --search "created:>=$date" -L 1000 --json number | jq length)" +max_pr_number="$(gh pr list --repo "$repository_url" --state merged --search "merged:$start_date..$end_date" -L 1000 --json number | jq length)" +gh pr list --repo "$repository_url" --state merged --search "merged:$start_date..$end_date" -L "$max_pr_number" \ + --json number,title,author,createdAt,closedAt,files,mergedAt,baseRefName,url,body > "$temp_json_file" -echo "Repository: $repository" -echo "Date: $date" -echo "Downloading up to $max_pr_number PRs" -gh pr list --repo "$repository" \ - -L "$max_pr_number" \ - --state all \ - --json number,title,author,createdAt,closedAt,files,mergedAt,baseRefName,url,body \ - > "$temp_json_file" +echo "Repository: $repository_url" +echo "Start Date: $start_date" +echo "End Date: $end_date" +echo "Downloading up to $max_pr_number PRs" cat "$temp_json_file" | yq -P > "$out_dir/download.yaml" diff --git a/scripts/summarise-merged-prs.sh b/scripts/summarise-merged-prs.sh index 0f76f04241..8424187870 100755 --- a/scripts/summarise-merged-prs.sh +++ b/scripts/summarise-merged-prs.sh @@ -8,15 +8,16 @@ set -euo pipefail } if [ "$#" -ne 2 ]; then - echo "Usage: $0 repository output_subdir" >&2 + echo "Usage: $0 repository_url output_subdir" >&2 echo "Example: $0 IntersectMBO/cardano-node v8.0.0" >&2 exit 1 fi -repository="$1" +repository_url="$1" +repository_name="$(basename "$repository_url" ".git")" subdir="$2" -work_dir="gen/$repository" +work_dir="gen/$repository_name" work_subdir="$work_dir/$subdir" detail_dir="$work_subdir/detail" summary_dir="$work_subdir/summary"