Commit f86ccc83 authored by smartcontracts's avatar smartcontracts Committed by GitHub

fix(ci): do not check closed issues in main job (#12066)

Updates the todo-checker to not check for closed issues in the
main job. Will still check for closed issues in the scheduled job.
Prevents CI from randomly failing when stuff gets closed.
parent d204c1f1
......@@ -714,6 +714,10 @@ jobs:
working_directory: packages/contracts-bedrock
todo-issues:
parameters:
check_closed:
type: boolean
default: true
machine:
image: <<pipeline.parameters.base_image>>
steps:
......@@ -723,7 +727,7 @@ jobs:
command: sudo apt-get install -y ripgrep
- run:
name: Check TODO issues
command: ./ops/scripts/todo-checker.sh --verbose
command: ./ops/scripts/todo-checker.sh --verbose <<#parameters.check_closed>> --check-closed <</parameters.check_closed>>
- notify-failures-on-develop
fuzz-golang:
......@@ -1709,6 +1713,7 @@ workflows:
- cannon-build-test-vectors
- todo-issues:
name: todo-issues-check
check_closed: false
- shellcheck/check:
name: shell-check
# We don't need the `exclude` key as the orb detects the `.shellcheckrc`
......
......@@ -5,6 +5,7 @@ set -uo pipefail
# Flags
FAIL_INVALID_FMT=false
VERBOSE=false
CHECK_CLOSED=false
# Github API access token (Optional - necessary for private repositories.)
GH_API_TOKEN="${CI_TODO_CHECKER_PAT:-""}"
......@@ -36,6 +37,7 @@ NC='\033[0m' # No Color
#
# `--strict`: Toggle strict mode; Will fail if any TODOs are found that don't match the expected
# `--verbose`: Toggle verbose mode; Will print out details about each TODO
# `--check-closed`: Check for closed issues and error out if found
for arg in "$@"; do
case $arg in
--strict)
......@@ -46,6 +48,10 @@ for arg in "$@"; do
VERBOSE=true
shift
;;
--check-closed)
CHECK_CLOSED=true
shift
;;
esac
done
......@@ -104,14 +110,16 @@ for todo in $todos; do
# Check issue state
STATE=$(echo "$RESPONSE" | jq -r .state)
if [[ "$STATE" == "closed" ]]; then
if [[ "$STATE" == "closed" ]] && $CHECK_CLOSED; then
echo -e "${RED}[Error]:${NC} Issue #$ISSUE_NUM is closed. Please remove the TODO in ${GREEN}$FILE:$LINE_NUM${NC} referencing ${YELLOW}$ISSUE_REFERENCE${NC} (${CYAN}https://github.com/$GH_URL_PATH${NC})"
exit 1
fi
if [[ "$STATE" == "open" ]]; then
((OPEN_COUNT++))
TITLE=$(echo "$RESPONSE" | jq -r .title)
OPEN_ISSUES+=("$REPO_FULL/issues/$ISSUE_NUM|$TITLE|$FILE:$LINE_NUM")
fi
done
# Print summary
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment