Skip to content

gh extension to execute dep-doctor in monorepo for direct dipendencies.

Notifications You must be signed in to change notification settings

chaspy/gh-monorepo-dep-doctor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-monorepo-dep-doctor go Go Report Card

gh extension to execute dep-doctor in monorepo for direct dipendencies.

Motivation

  1. I want to run dep-doctor on monorepo for all target services at once.

  2. 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.

  3. 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.

  4. [Ruby] I wanted to check only official gems, and exclude forked gems and in-house gems from the diagnoses.

Requirement

Support Language

  • Ruby, bundle

Installation

gh extension install chaspy/gh-monorepo-dep-doctor

To upgrade,

gh extension upgrade chaspy/gh-monorepo-dep-doctor

Usage

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

Ignore File Format

The ignore.txt file allows you to specify which library to ignore for each application in your monorepo. The format is as follows:

# Ignore specific library for specific application
api/schema    # Ignore schema only in api
back-office/rails-deprecated  # Ignore rails-deprecated only in back-office

# Use wildcard (*) to ignore library in all applications
*/json_spec   # Ignore json_spec in all applications
*/rspec       # Ignore rspec in all applications

Format Description

  • Each line follows the format: application_name/library_name
  • Lines starting with # are treated as comments
  • Wildcard * can be used:
    • */library: Ignore this library in all applications
  • Empty lines are ignored

Notification to Slack

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

Environment Variables

Name Description
MAX_CONCURRENCY The maximum number of concurrentcy. Defaults to 10.

About

gh extension to execute dep-doctor in monorepo for direct dipendencies.

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •