Skip to content

Commit

Permalink
Pretty-simple "find dependency updates" helper
Browse files Browse the repository at this point in the history
While building github.com/cadence-workflow/cadence-go-client/pull/1060, I realized I kinda missed the out-of-date warnings.
So here's something kinda similar.

It may be worth adding e.g. a "nothing > 100 days" check to `make lint` and/or CI?
Otherwise I tend to see dependencies go un-upgraded for huge lengths of time.
  • Loading branch information
Groxx committed Feb 18, 2021
1 parent 2f822ee commit 76e0f6b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,16 @@ start-mysql: bins
start-postgres: bins
./cadence-server --zone postgres start

deps: ## Check for dependency updates, for things that are directly imported
@# filter things that do not contain 'indirect:true'
@make --no-print-directory DEPS_FILTER=' | select(has("Indirect") | not) ' deps-all

deps-all: ## Check for all dependency updates
@# list all updates, compute seconds -> days between current version and latest version dates, format for display and sort
@go list -u -m -json all \
| jq 'select(.Update) $(DEPS_FILTER) | . + {Age:(((.Update.Time | fromdate) - (.Time | fromdate))/60/60/24 | floor)} | (.Age | tostring) + " days: " + .Path' --raw-output \
| sort -n

help:
@# print help first, so it's visible
@printf "\033[36m%-20s\033[0m %s\n" 'help' 'Prints a help message showing any specially-commented targets'
Expand Down

0 comments on commit 76e0f6b

Please sign in to comment.