Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/assignment-history.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
5i2urom
Ayush7614
HumanBot000
acoliver
e2720pjk
minmax-algo
renecannao
22 changes: 22 additions & 0 deletions .github/scripts/assign-constants.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Shared constants for assignment automation scripts.
#
# Source-only — do NOT execute this file directly.
# Sourced by assign-issue.sh and record-assignment-history.sh to eliminate
# production drift for history-label policy values.
#
# Must remain shellcheck-clean (enable=all, severity=style).
# shellcheck disable=SC2034

HISTORY_PREFIX='asnhist--'
HISTORY_COLOR='0E8A16'
HISTORY_DESC='Issue assignment history index'

# Validate a GitHub login: nonempty, alphanumeric + hyphen, max 39 chars.
# Returns 0 on valid; nonzero on invalid.
validate_github_login() {
local login="$1"
[[ -n "${login}" ]] || return 1
[[ "${#login}" -le 39 ]] || return 1
[[ "${login}" =~ ^[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?$ ]] || return 1
}
Comment on lines +17 to +22

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex in validate_github_login allows consecutive hyphens (e.g., user--name). GitHub usernames require each hyphen to be surrounded by alphanumeric characters. Consider updating the pattern to ^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$, which enforces non-empty segments separated by single hyphens and naturally prevents leading, trailing, or consecutive hyphens.

Comment on lines +17 to +22

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No test coverage was added for the new validate_github_login function. This validation logic contains subtle boundary conditions (empty input, max length, single-character names, leading/trailing/consecutive hyphens) that should be covered by unit tests to prevent regressions.

Loading
Loading