diff --git a/justfile b/justfile index 42f062c1..a969d71d 100644 --- a/justfile +++ b/justfile @@ -22,8 +22,15 @@ clean: rm -rf .venv +_env: + #!/usr/bin/env bash + set -euo pipefail + + test -f .env || cp dotenv-sample .env + + # ensure valid virtualenv -virtualenv: +virtualenv: _env #!/usr/bin/env bash set -euo pipefail @@ -134,15 +141,12 @@ metrics *args: devenv $BIN/python -m metrics {{ args }} -docker-build env="dev": +docker-build env="dev": _env #!/usr/bin/env bash set -euo pipefail test -z "${SKIP_BUILD:-}" || { echo "SKIP_BUILD set"; exit 0; } - # ensure env file exists - test -f .env || cp dotenv-sample .env - # set build args for prod builds export BUILD_DATE=$(date -u +'%y-%m-%dT%H:%M:%SZ') export GITREF=$(git rev-parse --short HEAD) @@ -152,6 +156,6 @@ docker-build env="dev": # run command in dev|prod container -docker-run env="dev" *args="bash": +docker-run env="dev" *args="bash": _env {{ just_executable() }} docker-build {{ env }} docker compose run --rm metrics-{{ env }} {{ args }} diff --git a/metrics/github/api.py b/metrics/github/api.py index eceebeb6..df1e6440 100644 --- a/metrics/github/api.py +++ b/metrics/github/api.py @@ -104,6 +104,7 @@ def _iter_pull_requests(org, date_range): # we can't seem to interpolate graphql variables into a string, so doing it # here search_query = f"is:pr draft:false org:{org} {date_range}" + log.debug(f"GitHub search query: {search_query}") query = """ query getPRs($cursor: String, $searchQuery: String!){