Skip to content

Commit 0007402

Browse files
authored
Merge pull request #1926 from input-output-hk/djo/enhance-upgrade-dep-run-book
Enhance upgrade dependency runbook
2 parents c6726e8 + ac379b1 commit 0007402

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

docs/runbook/upgrade-repository-dependencies/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ This runbook provides step-by-step instructions to upgrade the dependencies in t
66

77
## Update dependencies tool
88

9-
The `update_dependencies.sh` script allows you to to update dependencies performing all the steps described in the next chapter.
9+
The `update_dependencies.sh` script allows you to update dependencies performing all the steps described in the next chapter.
1010

1111
It requires having `cargo-edit` installed, which can be done with the following command:
1212

1313
```
1414
cargo install cargo-edit
1515
```
1616

17-
To start the update, execute the command:
17+
To start the update, execute the command below from the root of the repository:
1818

1919
```
20-
. ../docs/runbook/upgrade-repository-dependencies/upgrade-dependencies.sh
20+
. ./docs/runbook/upgrade-repository-dependencies/upgrade_dependencies.sh
2121
```
2222

2323
By default, Rust dependencies are updated to the latest version. If you want to only update to the latest compatible versions, add the `--incompatible` option to the command.
@@ -28,7 +28,7 @@ By default, Rust dependencies are updated to the latest version. If you want to
2828

2929
### Upgrade Rust outdated dependencies
3030

31-
We recommand using [Dependi](https://dependi.io/) VS Code extension to identify and update outdated dependencies.
31+
We recommend using [Dependi](https://dependi.io/) VS Code extension to identify and update outdated dependencies.
3232

3333
To do this, verify the dependencies in the `Cargo.toml` file for each Rust crate in the repository.
3434

@@ -37,6 +37,12 @@ To do this, verify the dependencies in the `Cargo.toml` file for each Rust crate
3737

3838
![Run dependi](./img/run-dependi.png)
3939

40+
After the version upgrade, upgrade the dependencies in the `Cargo.lock` file that are not directly listed in any `Cargo.toml` (ie dependencies of dependencies) by running:
41+
42+
```bash
43+
cargo update
44+
```
45+
4046
Create a dedicated commit, e.g.:
4147

4248
```bash

docs/runbook/upgrade-repository-dependencies/upgrade_dependencies.sh

100644100755
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ CARGO_UPGRADE_OPTIONS=${*:-"--incompatible"}
88
# Need to install `cargo-edit` to execute `cargo upgrade` and `cargo set-version` commands
99

1010
# Upgrade Rust outdated dependencies
11-
cargo upgrade "${CARGO_UPGRADE_OPTIONS}" --verbose
12-
# cargo upgrade -i allow --verbose
11+
cargo upgrade "${CARGO_UPGRADE_OPTIONS}" --verbose
12+
cargo update
1313
# Let the CI run the tests at the end of the script
1414
# cargo test --all-features
1515
git commit -am "chore: update Rust dependencies"
@@ -82,11 +82,10 @@ mkdir -p "$TMP_SCRIPT_DIR"
8282
echo "git config --global --add safe.directory '*'
8383
nix --extra-experimental-features 'nix-command flakes' flake update" > "$TMP_SCRIPT_DIR/$FLAKE_UPDATE_SCRIPT"
8484

85-
# The nix update is deactivated while waiting to be compatible with the latest version
86-
# # Upgrade Nix Flake dependencies
87-
# docker run -v "$(pwd)":/mithril -v "$TMP_SCRIPT_DIR":/scripts/mithril -w /mithril nixos/nix /bin/sh -c ". /scripts/mithril/$FLAKE_UPDATE_SCRIPT"
88-
# rm "$TMP_SCRIPT_DIR/$FLAKE_UPDATE_SCRIPT"
89-
#
90-
# git commit -am "chore: update nix flake dependencies
91-
# 
92-
# By running 'nix flake update' command."
85+
# Upgrade Nix Flake dependencies
86+
docker run -v "$(pwd)":/mithril -v "$TMP_SCRIPT_DIR":/scripts/mithril -w /mithril nixos/nix /bin/sh -c ". /scripts/mithril/$FLAKE_UPDATE_SCRIPT"
87+
rm "$TMP_SCRIPT_DIR/$FLAKE_UPDATE_SCRIPT"
88+
89+
git commit -am "chore: update nix flake dependencies
90+
91+
By running 'nix flake update' command."

0 commit comments

Comments
 (0)