Skip to content

fix(ci): clarify image triage checks and prevent bad filename cascading - #4383

Merged
LucasHT22 merged 7 commits into
hackclub:mainfrom
SSoggyTacoMan:fix/triage-image-validation-ux
Oct 15, 2026
Merged

LucasHT22 merged 7 commits into
hackclub:mainfrom
SSoggyTacoMan:fix/triage-image-validation-ux

Conversation

@SSoggyTacoMan

@SSoggyTacoMan SSoggyTacoMan commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

In PRs like #4344:

  1. When authors submit images with spaces or non-standard characters in games/img/, strict regex matching causes them to be treated as disallowed folder violations (Files stay in allowed folders), giving confusing errors for files that are in games/img/.
  2. When authors submit more than one image (e.g. a screenshot and a thumbnail), there was no check indicating that at most one image is permitted per game, leaving them confused about which file caused failures.
  3. When game filenames contain spaces, the bot previously issued contradictory instructions: telling the author to rename the game file without spaces, while simultaneously telling them the image must match the game file (with spaces).

Fix

  • Loose image matching: In submission-manifest.mjs, allow all files under games/img/ into imageFilesLoose so image-specific checks handle them rather than failing the general folder check.
  • Route all images to image check: Extract all images into allImageFiles so misplaced images (e.g. screenshots/foo.png) trigger Optional image path (Move images into games/img/...) alongside folder checks.
  • Image count check: Added an explicit At most one image file check explaining that only one image is allowed as the gallery thumbnail, listing the files and advising deletion of extra images.
  • Unified rename guidance: In validateImageFiles, if the game filename contains spaces or invalid characters, provide a clear unified rename recommendation (e.g. games/Retro_space_shooter.js and games/img/Retro_space_shooter.png).
  • Sanitized game suggestions: Strip extensions before cleaning up non-alphanumeric characters, and sanitize dots to avoid invalid suggestions like dr._mario.js.
  • Encode screenshot URL segments: Encode path segments with encodeURIComponent to ensure filenames containing spaces, #, or ? don't break markdown link formatting.
  • Unit tests: Comprehensive test suite in .github/scripts/submission-manifest.test.mjs.

@vercel

vercel Bot commented Oct 13, 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
SSoggyTacoMan marked this pull request as ready for review October 14, 2026 14:00

@LucasHT22 LucasHT22 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice!

@LucasHT22
LucasHT22 added this pull request to the merge queue Oct 15, 2026
Merged via the queue into hackclub:main with commit 01fc81a Oct 15, 2026
6 of 7 checks passed
@SSoggyTacoMan
SSoggyTacoMan deleted the fix/triage-image-validation-ux branch October 15, 2026 19:54
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