tools: add inspector_protocol updater · nodejs/node@f419ba7 · GitHub
Skip to content

Commit f419ba7

Browse files
legendecasaduh95
authored andcommitted
tools: add inspector_protocol updater
PR-URL: #60245 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent 73fe9d2 commit f419ba7

3 files changed

Lines changed: 74 additions & 6 deletions

File tree

.github/workflows/tools.yml

Lines changed: 12 additions & 1 deletion
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/sh
2+
set -e
3+
# Shell script to update inspector_protocol in the source tree to the version same with V8's.
4+
5+
BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd)
6+
DEPS_DIR="$BASE_DIR/deps"
7+
8+
# shellcheck disable=SC1091
9+
. "$BASE_DIR/tools/dep_updaters/utils.sh"
10+
11+
echo "Making temporary workspace..."
12+
13+
WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp')
14+
15+
cd "$WORKSPACE"
16+
17+
git clone https://chromium.googlesource.com/deps/inspector_protocol.git
18+
19+
INSPECTOR_PROTOCOL_DIR="$WORKSPACE/inspector_protocol"
20+
21+
echo "Comparing latest upstream with current revision"
22+
23+
set +e
24+
python "$BASE_DIR/tools/inspector_protocol/roll.py" \
25+
--ip_src_upstream "$INSPECTOR_PROTOCOL_DIR" \
26+
--node_src_downstream "$BASE_DIR"
27+
STATUS="$?"
28+
set -e
29+
30+
if [ "$STATUS" = "0" ]; then
31+
echo "Skipped because inspector_protocol is on the latest version."
32+
exit 0
33+
fi
34+
35+
python "$BASE_DIR/tools/inspector_protocol/roll.py" \
36+
--ip_src_upstream "$INSPECTOR_PROTOCOL_DIR" \
37+
--node_src_downstream "$BASE_DIR" \
38+
--force
39+
40+
NEW_VERSION=$(grep "Revision:" "$DEPS_DIR/inspector_protocol/README.node" | sed -n "s/^Revision: \(\\w*\)/\1/p")
41+
42+
# Update the version number on maintaining-dependencies.md
43+
# and print the new version as the last line of the script as we need
44+
# to add it to $GITHUB_ENV variable
45+
finalize_version_update "inspector_protocol" "$NEW_VERSION"

tools/inspector_protocol/roll.py

Lines changed: 17 additions & 5 deletions

0 commit comments

Comments
 (0)