Skip to content

fix: accept flexible author field formats in PR description - #4232

Open
SSoggyTacoMan wants to merge 11 commits into
hackclub:mainfrom
SSoggyTacoMan:fix/pr-body-v2
Open

SSoggyTacoMan wants to merge 11 commits into
hackclub:mainfrom
SSoggyTacoMan:fix/pr-body-v2

Conversation

@SSoggyTacoMan

@SSoggyTacoMan SSoggyTacoMan commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Fixes several issues with the auto-triage bot that were causing false failures and confusing error messages.

Changes

Flexible author field parsing
The bot only matched **Author:** in bold. Submitters using @mentions, markdown links, unbolded Author: name, or heading-style formatting kept failing even with valid info filled in.
Now accepts all of: **Author:** name, **Author:** @mention, [@foo](github url), Author: name (unbolded), ### Author name\nAuthor: name.

No cascading errors from bad filename
When a filename had invalid characters (e.g. an apostrophe in Rayan's-Maze.js), the bot would report 3 separate failures: invalid filename, no game file found, and metadata not checked — even though there was one game file and it was in the right place. Now only the filename check fails; the file is still recognized for count and metadata purposes. The materializeSubmittedGameFiles function now also uses a loose regex so badly named files are actually fetched and validated.

Better filename error message
Was: "Filenames cannot contain spaces."
Now: "Filenames may only contain letters, numbers, hyphens, and underscores (no spaces, apostrophes, or special characters)."

Better check name
"Files stay in allowed folders" → "Valid filenames and folders" (the old name was confusing when the file was in the right folder but had a bad name).

Duplicate open PR detection
Now detects when the same GitHub user already has another open submission PR, regardless of filename validity or game title match. Only counts PRs with the Submission label so valid submissions aren't blocked if the user has an open non-game PR (e.g. a docs fix). When a duplicate PR is closed, the bot will now automatically re-validate the remaining open PR from that user so it escapes the "Failed" state.

Optimized title conflict check
The existing check fetched file diffs for every open PR in the entire repository. It now filters candidates to only PRs with the Submission label, saving massive amounts of API calls and preventing rate limits.

Tutorial game detection
Detects if the submitted game is an unmodified getting_started.js or maze_game_starter.js by comparing stripped code bodies, and fails with a clear message.

Open preview and PR comment links in new tab
Links in the auto-triage bot comment (including "Play in Sprig Editor", "Edit Game File", "Play Similar Game (Gallery)", "View Raw", "View Screenshot", and "PR Files") now open in a new tab (target="_blank" rel="noopener noreferrer") so reviewers and authors do not lose their place on the pull request.


🤖 Generated with Claude Code

The bot only matched bold **Author:** syntax. Submitters using
@mentions, markdown links, or unbolded Author: text kept failing.

Now accepts:
- **Author:** name (original)
- **Author:** @mention or [@foo](github url)
- Author: name (unbolded / plain)
- ### Author name\nAuthor: name (heading style)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

@SSoggyTacoMan is attempting to deploy a commit to the Hack Club Team on Vercel.

A member of the Team first needs to authorize it.

SSoggyTacoMan and others added 2 commits September 17, 2026 12:41
…l chars

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
'Files stay in allowed folders' was confusing when the file IS in games/
but has invalid characters. Now says 'Valid filenames and folders' and
the error message explicitly lists what characters are allowed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SSoggyTacoMan and others added 2 commits September 17, 2026 16:34
…errors

- Bad filename chars (apostrophe etc) no longer cascade into false
  'no game file found' and 'metadata not checked' errors. The file is
  still recognized as the game file for count/metadata purposes; only
  the filename validity check itself fails.
- Detect duplicate open PRs from the same GitHub user regardless of
  filename validity or game title.
- Detect if submitted game is an unmodified tutorial (getting_started.js
  or maze_game_starter.js) by comparing stripped code bodies.
- Clarify 'Exactly one game file' error so it doesn't say 'add a file'
  when there is one but it has an invalid name.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When all submitted JS files have invalid names, the 'exactly one game
file' check no longer also fails with 'only one allowed' — the filename
error already covers it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@SSoggyTacoMan SSoggyTacoMan left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Bug in duplicate PR detection. openPulls.find checks for any open PR by the user. If they have an open PR for an engine typo fix, it incorrectly blocks their game submission.

Fix: filter by the 'Submission' label.

const duplicatePR = openPulls.find((pr) => 
	pr.number !== prNumber && 
	pr.user?.login === submitterLogin && 
	pr.labels?.some(l => l.name === 'Submission')
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants