gh extension to execute dep-doctor in monorepo for direct dipendencies.
-
I want to run dep-doctor on monorepo for all target services at once.
-
I want to detect only direct dependencies. dep-doctor's feature is that it detects the maintenance state of dependencies of dependencies, but I noticed that the detected ones are not controllable for me.
-
I want to notify Slack of the output results of dep-doctor. For this purpose, output in a format that can be handled programmatically is preferred. (dep-doctor is output in text.) In this tool, we implemented it in csv.
-
[Ruby] I wanted to check only official gems, and exclude forked gems and in-house gems from the diagnoses.
- dep-doctor v1.2.1 or later
- Ruby, bundle
gh extension install chaspy/gh-monorepo-dep-doctor
To upgrade,
gh extension upgrade chaspy/gh-monorepo-dep-doctor
gh monorepo-dep-doctor
Output is like below.
api/Gemfile,grape-cache_control,not-maintained,https://github.com/karlfreeman/grape-cache_control
api/Gemfile,http_accept_language,not-maintained,https://github.com/iain/http_accept_language
back-office/Gemfile,sass,archived,https://github.com/sass/ruby-sass
A CSV file of the form depenedency file, library, status, url
will be output
Note
As it is executed asynchronously, the order of output is not guaranteed
To ignore a specific library, you can create a .gh-monorepo-dep-doctor-ignore
file in the root of the repository.
The format of the file is as follows.
# This file allow a comment with "#"
# Lines beginning with # and blank lines are ignored
# Also, files beginning with "#" are ignored.
library-name
another-library-name # You can leave a comment here
If you want to notify the result of gh-monorepo-dep-doctor to Slack, use Incoming Webhook.
gh monorepo-dep-doctor >> result.csv
SLACK_WEBHOOK_URL="please-add-webhook-url"
while IFS=, read -r file_path package_name maintenance_status url
do
app=$(echo $file_path | cut -d'/' -f1)
group_handle="group-handle-to-notify"
group_id="group-id-to-notify"
message=$(cat <<EOF
<!subteam^${group_id}|${group_handle}> The package *${package_name}* used by ${app} is in *${maintenance_status}*. Details: ${url}
EOF
)
echo $message
curl -X POST -H 'Content-type: application/json' \
--data "{\"text\": \"$message\"}" \
$SLACK_WEBHOOK_URL
done < result.csv
Name | Description |
---|---|
MAX_CONCURRENCY |
The maximum number of concurrentcy. Defaults to 10. |