Skip to content

Codebridge: fix for file name validation#73004

Open
molly-moen wants to merge 2 commits into
stagingfrom
molly/codebridge-duplicate-name-bug
Open

Codebridge: fix for file name validation#73004
molly-moen wants to merge 2 commits into
stagingfrom
molly/codebridge-duplicate-name-bug

Conversation

@molly-moen
Copy link
Copy Markdown
Contributor

@molly-moen molly-moen commented Jun 2, 2026

When we moved to the version of the file creation modal that uses a dropdown for file extensions we introduced two bugs:

  • The check for duplicate file names stopped working because we were comparing the name without the extension to the names in the project, which have extensions.
  • We started allowing a single additional period in file names, so a name like my.main.python would pass validation when it wouldn't previously.

This PR fixes these issues, present in Python Lab, Web Lab 2, and Java Lab on lab2.

Before

Screen.Recording.2026-06-02.at.2.36.37.PM.mov

After

Screen.Recording.2026-06-02.at.2.37.11.PM.mov

Testing story

Tested locally and added unit tests.

@molly-moen molly-moen requested review from a team and removed request for a team June 2, 2026 21:17
@molly-moen molly-moen marked this pull request as draft June 2, 2026 21:25
@molly-moen
Copy link
Copy Markdown
Contributor Author

converting to draft, found another gap in the validation

## To Dos
- **Validation** (`get_validations` override on `Javalab`,
`JavaValidator`, `JavaValidationTracker`, test-result handling).
- **File name validation** there are no checks for invalid file names yet.
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.

When doing the java lab conversion I thought this was a specific issue to Java Lab on lab2 but it turned out it was more universal than that!

@molly-moen molly-moen marked this pull request as ready for review June 2, 2026 21:39
@molly-moen molly-moen changed the title Codebridge: fix for duplicate name check Codebridge: fix for file name validation Jun 2, 2026
@molly-moen molly-moen requested a review from a team June 2, 2026 21:39
Copy link
Copy Markdown
Contributor

@hannahbergam hannahbergam left a comment

Choose a reason for hiding this comment

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

Thanks for adding the tests! LGTM

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