-
Notifications
You must be signed in to change notification settings - Fork 287
Refactor: beginner, intermediate, advanced labels #2170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
exploreriii
merged 3 commits into
hiero-ledger:main
from
DeathGun44:refactor/skill-labels
May 2, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /** | ||
| * Centralized label configuration — single source of truth for difficulty labels. | ||
| * | ||
| * All JavaScript scripts that reference difficulty labels should import | ||
| * constants from this module instead of hardcoding strings. | ||
| * | ||
| * To rename labels in the future, update the defaults below and the | ||
| * corresponding workflow YAML `if:` conditions (which cannot import JS). | ||
| * | ||
| * Environment variable overrides are supported for per-workflow customization: | ||
| * GOOD_FIRST_ISSUE_LABEL, GOOD_FIRST_ISSUE_CANDIDATE_LABEL, | ||
| * BEGINNER_LABEL, INTERMEDIATE_LABEL, ADVANCED_LABEL | ||
| */ | ||
|
|
||
| const GOOD_FIRST_ISSUE_LABEL = process.env.GOOD_FIRST_ISSUE_LABEL?.trim() || 'Good First Issue'; | ||
| const GOOD_FIRST_ISSUE_CANDIDATE_LABEL = process.env.GOOD_FIRST_ISSUE_CANDIDATE_LABEL?.trim() || 'Good First Issue Candidate'; | ||
| const BEGINNER_LABEL = process.env.BEGINNER_LABEL?.trim() || 'skill: beginner'; | ||
| const INTERMEDIATE_LABEL = process.env.INTERMEDIATE_LABEL?.trim() || 'skill: intermediate'; | ||
| const ADVANCED_LABEL = process.env.ADVANCED_LABEL?.trim() || 'skill: advanced'; | ||
|
|
||
| /** | ||
| * All difficulty labels as an array, ordered by ascending difficulty. | ||
| * | ||
| * Scripts that need to check whether an issue has *any* difficulty label | ||
| * (e.g. coderabbit_plan_trigger) should test against this array. | ||
| */ | ||
| const DIFFICULTY_LABELS = [ | ||
| GOOD_FIRST_ISSUE_LABEL, | ||
| BEGINNER_LABEL, | ||
| INTERMEDIATE_LABEL, | ||
| ADVANCED_LABEL, | ||
| ]; | ||
|
|
||
| /** | ||
| * Validates a label string for safe use in API queries. | ||
| * | ||
| * Allows letters, digits, and the characters: . _ / : space - | ||
| * This is intentionally looser than `isSafeSearchToken` (which rejects | ||
| * colons and spaces) because labels like "skill: beginner" are valid. | ||
| * | ||
| * The hyphen is escaped (\-) to prevent accidental ASCII range creation | ||
| * if a future developer appends characters to the character class. | ||
| * | ||
| * @param {string} value - The label string to validate. | ||
| * @returns {boolean} True if the value is safe for use in queries. | ||
| */ | ||
| function isSafeLabel(value) { | ||
| return typeof value === 'string' && value.trim().length > 0 && /^[a-zA-Z0-9._/: \-]+$/.test(value); | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| module.exports = { | ||
| GOOD_FIRST_ISSUE_LABEL, | ||
| GOOD_FIRST_ISSUE_CANDIDATE_LABEL, | ||
| BEGINNER_LABEL, | ||
| INTERMEDIATE_LABEL, | ||
| ADVANCED_LABEL, | ||
| DIFFICULTY_LABELS, | ||
| isSafeLabel, | ||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.