Skip to content

Commit 262562e

Browse files
authored
use cargo metadata to identify crates rather than find (#1174)
1 parent 5a1bc77 commit 262562e

File tree

2 files changed

+10
-24
lines changed

2 files changed

+10
-24
lines changed

eng/scripts/verify-owners.sh

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,19 @@
22
#
33
# simple script to check that github team for publishing crates has been added
44
# for all of the crates.
5-
#
5+
#
66

77
set -e
88

99
cd $(dirname ${BASH_SOURCE[0]})/../../
1010

1111
OWNER=github:azure:azure-sdk-publish-rust
12+
SDK=$(cargo metadata --format-version=1 --no-deps | jq -r -c '.packages | .[] | select(.publish == null) | .name')
13+
SERVICES=$(cd services; cargo metadata --format-version=1 --no-deps | jq -r -c '.packages | .[] | select(.publish == null) | .name')
1214

13-
for i in sdk/*/Cargo.toml ; do
14-
(
15-
CRATE_DIR=$(dirname $i)
16-
cd ${CRATE_DIR}
17-
if ! grep -qi 'publish = false' Cargo.toml; then
18-
if ! cargo owner -q --list 2>/dev/null | grep -qi ${OWNER}; then
19-
echo SDK publish team is missing on crates.io for $i
20-
echo "(cd ${CRATE_DIR}; cargo owner --add ${OWNER})"
21-
fi
22-
fi
23-
)
24-
done
25-
26-
for i in services/svc/*/Cargo.toml services/mgmt/*/Cargo.toml; do
27-
(
28-
CRATE_DIR=$(dirname $i)
29-
cd ${CRATE_DIR}
30-
if ! cargo owner -q --list 2>/dev/null | grep -qi ${OWNER}; then
31-
echo SDK publish team is missing on crates.io for $i
32-
echo "(cd ${CRATE_DIR}; cargo owner --add ${OWNER})"
33-
fi
34-
)
15+
for i in ${SDK} ${SERVICES}; do
16+
if ! cargo owner -q --list $i 2>/dev/null | grep -qi ${OWNER}; then
17+
echo SDK publish team is missing on crates.io for $i
18+
echo "cargo owner --add ${OWNER} $i"
19+
fi
3520
done

eng/test/mock_transport/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "mock_transport"
33
version = "0.1.0"
44
edition = "2021"
5+
publish = false
56

67
[dependencies]
78
azure_core = { path = "../../../sdk/core" }
@@ -11,4 +12,4 @@ serde_json = "1.0"
1112
url = "2.2"
1213
base64 = "0.13"
1314
bytes = "1.0"
14-
async-trait = "0.1"
15+
async-trait = "0.1"

0 commit comments

Comments
 (0)