Two Submissions are Created for Commits in Programming Exercises
See original GitHub issueDescribe the bug
For many commits two submissions are created:
- one without build result, and
- one with a build result.
In our case it not problematic except for the unnecessary database entries and resulting UI clutter. However, in exercises that use submission policies based on the number of submissions students might get a points deduction even if they shouldn’t.
To Reproduce
I can see this for submissions from different students. The students in this case used the online code editor to submit. I was not able to reproduce this issue on artemis-test2 but in our instance the issue is present for many submissions for different students.
Expected behavior
Only one submission is created per commit.
Screenshots
In this example the bug happens only to builds where the build fails. In other places it also occurs when some tests pass.
What browsers are you seeing the problem on?
Other (specify in “Additional context”)
Additional context
- Artemis 5.7.4
- Gitlab/Jenkins setup
- The method around the log message in
ProgrammingExerciseGradingService
(createAndSaveFallbackSubmission
) has been introduced in #4830- This method also seems to create the second submission that is not really needed.
Relevant log output
2022-04-25 14:41:22.623 INFO 26810 --- [.1-8080-exec-31] t.i.w.a.s.p.ProgrammingSubmissionService : NotifyPush invoked due to the commit <HASH01> by <STUDENT> in
2022-04-25 14:41:29.825 INFO 26810 --- [.1-8080-exec-31] t.i.w.a.s.p.ProgrammingSubmissionService : Create new programmingSubmission with commitHash: <HASH01> for participation <000000>
2022-04-25 14:41:34.314 INFO 26810 --- [.1-8080-exec-41] d.t.i.w.artemis.web.rest.ResultResource : Artemis received a new result for build plan <BUILD_PLAN>-<USER_ID_STUDENT>
2022-04-25 14:41:34.339 WARN 26810 --- [.1-8080-exec-41] .a.s.p.ProgrammingExerciseGradingService : Could not find pending ProgrammingSubmission for Commit Hash Optional[<HASH01>] (Participation <000000>) Will create a new one subsequently...
2022-04-25 14:41:37.350 INFO 26810 --- [.1-8080-exec-41] d.t.i.www1.artemis.service.ScoreService : Updated an existing participant score. Was: StudentScore{…}
2022-04-25 14:41:37.382 INFO 26810 --- [.1-8080-exec-41] d.t.i.w.artemis.web.rest.ResultResource : The new result for <BUILD_PLAN>-<USER_ID_STUDENT> was saved successfully
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
@julian-christl I disagree. For exams this will not be an issue. I can tell you more details personally. I removed the corresponding code block in the commit c29811257a392b36520b0a988b100fb1606fcb7b
In 941c92596e16a2cfbe8247cc90576aca778883ed I moved the submission date creation to the top of the method, so this will improve the accuracy for a couple of milliseconds Before, I also added a TODO that we should store the default branch of a participation in the database to avoid that we retrieve this all the time. It cannot change after the repository was created, so it is much more efficient to store it once instead of retrieving it in several places