question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Two Submissions are Created for Commits in Programming Exercises

See original GitHub issue

Describe 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

Screenshot 2022-04-26 at 14-37-52 Participation

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:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kruschecommented, Apr 28, 2022

@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

0reactions
kruschecommented, Apr 28, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Two Submissions are Created for Commits in Programming Exercises
For many commits two submissions are created: one without build result, and; one with a build result. In our case it not problematic...
Read more >
Commit & Submit - CSE 373 - Washington
This means that there are really two versions of code on your machine: the local repository will store the entire history of the...
Read more >
CS 240: Git for Code Assignments - Wellesley College
git push all commits to your hosted submission repository. git status should show both: Your branch is up to date with 'origin/master'. nothing...
Read more >
Git Exercises (non-credit) - Bucknell University
We will do a three-part exercise, create a git repo; update and commit changes to existing files; and branch and merge a section...
Read more >
Git Best Practices – How to Write Meaningful Commits ...
We can do this utilising the git merge command. If there were changes, that is there were files in the pull from main,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found