Mapping extensions to languages is broken
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1k
- Forks
- 412
- Avg merge
- 6d 10h
- Merged PRs (30d)
- 3
Description
In PR #1464, I discovered that cmsAddSubmission without --lang defaults to the first language on the list which matches the filename extension, regardless of what is enabled in the contest. The test suite did not originally catch this, because it used C which has only one version enabled.
All callers of cms.grading.languagemanager.filename_to_language seem to be affected, in particular cmsMake and cmstestsuite/web/CWSRequests.py.
cmsAddSubmission is already fixed by PR #1464, but the other places need attention, too.
@veluca93 mentioned that cmsMake can be probably removed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with cms.grading.languagemanager.filename_to_language and trace its callers in cmsMake and cmstestsuite/web/CWSRequests.py. Check the existing language-selection tests, then cover contests with multiple enabled languages sharing an extension; done means every remaining caller selects an enabled language rather than the first match.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100