Skip to content

Commit 1c5c0c2

Browse files
committed
chore: split comment and add one todo for adding a workaround
Should be in c02dc39 commit. Relate to #1610
1 parent 11fdfda commit 1c5c0c2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/main/scripts/ci/connect-todos-to-issues.sh

+9-7
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,19 @@ while IFS=$'\t' read -r PUZZLE_ID UNUSED_TICKET TITLE UNUSED_REST; do
124124
ISSUES_BY_BODY_COUNT="$(echo "$SEARCH_BY_BODY" | jq '. | length')"
125125
debug "$PUZZLE_ID: found $ISSUES_BY_BODY_COUNT issue(s) by body"
126126

127+
# KNOWN ISSUE:
128+
# As there is no way to search in title with exact match, it's possible to find more than one issue if their titles are similar.
129+
# For example, when lookup for "Add validation", it finds an issue with a title "Add validation" and "Add validation for e-mail".
130+
# In this case, we let a user to choose which one is needed.
131+
# @todo #1060 Add a workaround for GitHub search by filtering out issues with titles that don't match exactly
127132
SEARCH_BY_TITLE="$(gh search issues --repo "$GITHUB_REPOSITORY" --json number,state,url,title,body --match title "$TITLE")"
128133
ISSUES_BY_TITLE_COUNT="$(echo "$SEARCH_BY_TITLE" | jq '. | length')"
129134
debug "$PUZZLE_ID: found $ISSUES_BY_TITLE_COUNT issue(s) by title"
130135

131-
# KNOWN ISSUES:
132-
# 1) As there is no way to search in title with exact match, it's possible to find more than one issue if their titles are similar.
133-
# For example, when lookup for "Add validation", it finds an issue with a title "Add validation" and "Add validation for e-mail".
134-
# In this case, we let a user to choose which one is needed.
135-
# 2) For each puzzle id we have to make 2 search requests instead of one because there is no possibility to use logical OR
136-
# (body contains OR title equals) in a search query. As result, we might get "HTTP 403: API rate limit exceeded" error more often
137-
# if we have a lot of issues to process or we re-run the script frequently.
136+
# KNOWN ISSUE:
137+
# For each puzzle id we have to make 2 search requests instead of one because there is no possibility to use logical OR
138+
# (body contains OR title equals) in a search query. As result, we might get "HTTP 403: API rate limit exceeded" error more often
139+
# if we have a lot of issues to process or we re-run the script frequently.
138140
JSON="$(echo "$SEARCH_BY_BODY$SEARCH_BY_TITLE" | sed -e 's|\\n| |g' -e 's|\\r||g' -e 's|`||g' | jq --slurp 'add | unique_by(.number)')"
139141
ISSUES_COUNT="$(echo "$JSON" | jq '. | length')"
140142
debug "$PUZZLE_ID: found $ISSUES_COUNT issue(s) overall"

0 commit comments

Comments
 (0)