Skip to content

Convert Underscores and Dots to Dashes - #257

Closed
d-dot-one wants to merge 4 commits into
mainfrom
bugfix.PE-9429.underscores-and-dots-to-dashes
Closed

d-dot-one wants to merge 4 commits into
mainfrom
bugfix.PE-9429.underscores-and-dots-to-dashes

Conversation

@d-dot-one

@d-dot-one d-dot-one commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

The problem is a name mismatch between the GitHub action and Mayhem. For repos with _ or . in the name, the fuzz job asks Mayhem for a project name Mayhem doesn't use, since it uses dashes.

How a run gets its project name:

The fork's mayhem.yml doesn't set a project. It calls ForAllSecure/mcode-action@v1 with  --image, --file and --duration. mcode-action falls back to the GitHub repo name. src/main.ts:130 sets the project to (getInput("project") || repo).toLowerCase(). That only lowercases, so the repo, for example,  sample_repo stays sample_repo. Mayhem stores project names with dashes. It keeps the project as sample-repo. Its lookup API treats both spellings alike: sample_repo and sample-repo returned identical data when I queried them.

The seed test-suite entry uses the literal name. Every Mayhemfile starts its testsuite with https://$MAYHEM_DOMAIN/$MAYHEM_PROJECT/$MAYHEM_TARGET/testsuite.tar. That expands to …/sample_repo/…, and at run creation Mayhem's access check refuses it: "You do not have access to use a test suite from the project sample_repo". Soooo, the run never starts.

@d-dot-one
d-dot-one requested review from ethan42 and ivg September 30, 2026 21:31
@d-dot-one d-dot-one self-assigned this Sep 30, 2026
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Mayhem Automated Code Testing Report

❗ 1 Defects Found

CWE Severity Defect Description
7.1 Improper Input Validation The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.

Testing details found at https://app.mayhem.security/forallsecure/mcode-action/mayhemit/63

d-dot-one and others added 3 commits September 30, 2026 21:39
src/project.ts normalizes each /-separated segment of the project name to
Mayhem's slug ([a-z0-9-], everything else '-'), so the owner/name default
from GITHUB_REPOSITORY keeps its separator. dist/ rebuilt with ncc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inline `.toLowerCase().replace(/[^a-z0-9-]/g, "-")` also turned the "/"
in the owner/name default (GITHUB_REPOSITORY) into "-": SavantEnvs/SDL_sound
became savantenvs-sdl_sound's slug "savantenvs-sdl-sound", and main.ts then
prepended the owner again, naming savantenvs/savantenvs-sdl-sound, a
project that does not exist, for every repository using the default.
getConfig() now calls mayhemProjectSlug(), which normalizes each
/-separated segment, and logs when the name changes. This is the source the
committed dist/ was built from: a fresh build leaves dist/ unchanged.

Also prettier-formats __tests__/project.test.ts (one line wrap, final
newline) so `yarn format-check` stays clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread __tests__/project.test.ts

@sauliusbc sauliusbc left a comment

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.

Also: no need for internal issue numbers on PRs to public repos (so not to leak internal jira #)

@d-dot-one d-dot-one changed the title PE-9429 - Convert Underscores and Dots to Dashes Convert Underscores and Dots to Dashes Oct 1, 2026
@d-dot-one

Copy link
Copy Markdown
Contributor Author

Superseded by #258 (same change, history cleaned up per review).

@d-dot-one d-dot-one closed this Oct 1, 2026
@d-dot-one
d-dot-one deleted the bugfix.PE-9429.underscores-and-dots-to-dashes branch October 1, 2026 15:49
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