Sebastian Serth
c29256aa81
Fix Rubocop offenses
2023-09-11 14:10:16 +02:00
Sebastian Serth
50a4707f65
Prevent duplicated WebSocket close for client_kill
...
Our investigation in CODEOCEAN-TV showed that we might attempt to close the WebSocket connection twice, if learners press the stop button. With this commit, we fix that issue.
2023-09-08 00:16:12 +02:00
Sebastian Serth
c6461f6bdd
Only log runs not stopped by a client to Sentry
2023-09-08 00:05:50 +02:00
Sebastian Serth
3ad946537b
Log terminated_by_client
to Sentry
2023-09-06 23:49:48 +02:00
Sebastian Serth
80b457a0c9
Add Sentry exception to Runner::Error in SubmissionsController
2023-09-06 23:05:56 +02:00
Sebastian Serth
be4f2b790d
Add user to testrun
...
* We want to identify a user that has triggered a testrun. Previously (in regular operation), only submission author who were regular users were able to start a testrun. Now, we want to prepare a future where submission authors are programming groups. Still, a testrun is triggered by an individual user and not a group.
* Further, this commit fixes some missing foreign key constrains.
2023-08-24 19:32:06 +02:00
kiragrammel
0234414bae
Rename user to contributor in submission
2023-08-24 19:32:06 +02:00
Sebastian Serth
269f135812
Fix Errno::ECONNRESET error for Tubesock
...
* We must not close the socket manually (with `client_socket.close`), as this would close it twice. Compare: 2c83794b85/lib/tubesock.rb (L92)
* When the socket is closed twice, nginx registers a `Connection reset by peer` error: `recv() failed (104: Connection reset by peer) while proxying upgraded connection`
* Tubesock automatically closes the socket when the `hijack` block ends and otherwise ignores `Errno::ECONNRESET`: 2c83794b85/lib/tubesock.rb (L161-L162)
2023-08-22 00:20:02 +02:00
Sebastian Serth
fd2d94568a
Handle OutOfMemory runner errors with gVisor
2023-07-21 16:38:49 +02:00
Sebastian Serth
264927e3c4
Fix unnecessary testrun for each successful test / score action.
...
This commit resolves a regression introduced by commit 9c3ec3c7
.
We still might want to remove this false data from our database, which is still pending.
2023-07-15 19:00:26 +02:00
Sebastian Serth
e8a21ea319
Further optimize extracting errors
...
The previous solution worked, but always queried all ErrorTemplateAttributes, even if there was no match of the ErrorTemplate. This solution resolves this issue and still benefits from less SQL queries.
2023-03-21 07:34:31 +01:00
Sebastian Serth
09809cc12e
Preload error template attributes in SubmissionsController
...
The join operation is okay, since a similar one is otherwise performed automatically by Rails
2023-03-20 23:52:34 +01:00
Sebastian Serth
9c3ec3c7ff
Refactor submission scoring and testing
...
* Properly cancel code execution if running is prohibited
* Correctly monitor duration with Sentry
* Align methods with running submissions
2023-02-17 18:13:48 +01:00
Sebastian Serth
a1ec4579fe
Properly cancel code execution if running is prohibited
2023-02-17 18:13:48 +01:00
Sebastian Serth
e9cf79085a
Refactor listing files to be independent of exiting runners
...
Previously, we were always fetching files, even if not required (e.g., for score runs). Now, we reduce the number of file listings and use a dedicated callback.
2023-02-16 10:50:01 +01:00
Sebastian Serth
91c2e14fe8
Fix error handling during Runner::Connection close
...
Closes CODEOCEAN-HQ
2023-02-16 10:47:28 +01:00
Sebastian Serth
6a942ccf50
Capture exception for Scoring
...
Previously, an exception was caused by the tubesock gem but not sent to Sentry. This caused errors not to bubble up correctly but rather kill the current thread, leaving the user with a generic "WebSocket connection not established" message.
Probably, this should be removed when updating the WebSocket implementation.
2022-12-23 13:04:34 +01:00
Sebastian Serth
574e99eddd
Fix rubocop offenses - Requires Ruby 3.1+
2022-11-25 11:10:06 +01:00
Sebastian Serth
b2af4e0663
Check submission and exercise files when filtering downloads
2022-11-17 20:47:33 +01:00
Sebastian Serth
591f776f69
Close WebSocket connection normally
...
With Tubesock, we need to send a close frame ourselves. Otherwise, some browsers might display a warning.
2022-11-16 23:16:49 +01:00
Sebastian Serth
0950e626ba
Convert message data to string before slicing
...
Fixes CODEOCEAN-F1
2022-11-16 19:53:19 +01:00
Sebastian Serth
60078701f5
Editor: Allow file retrieval after code run
2022-10-29 18:49:18 +02:00
Sebastian Serth
c75f52f2c8
Fix Rubocop offenses
2022-10-24 12:28:50 +02:00
Sebastian Serth
f7515362a1
Set Content-Type to fixed value for all download actions
2022-10-05 21:46:17 +02:00
Sebastian Serth
2d95a737f6
Assume failed code execution if no status was received
2022-10-04 16:08:10 +02:00
Sebastian Serth
b8b7cd99bd
SubmissionsController: Allow JS to be "rendered"
...
We skip verifying the authenticity token for the action, to prevent raising a `ActionController::InvalidCrossOriginRequest` exception.
2022-10-04 16:06:59 +02:00
Sebastian Serth
ca13ea03c8
SubmissionsController: Send Content-Length if possible
2022-10-04 16:06:59 +02:00
Sebastian Serth
c3daa51c8c
SubmissionsController: Remove outdated ActionController::Live
mixin
...
The mixin was previously used for Server-Sent-Events, which were removed from CodeOcean a long time ago.
After the mixin is removed, we can also fix the cookie send mechanism (this was erroneous with the mixin).
2022-10-04 16:06:58 +02:00
Sebastian Serth
3263d4f838
Respect subpath for (render_)protected_upload_path
2022-09-28 11:06:15 +02:00
Sebastian Serth
16c00ec136
Add support for signed URLs used by the render_file function
2022-09-23 21:35:22 +02:00
Sebastian Serth
5b73f4df6f
Refactor render_file method
...
* We simplify the send_data call,
* ensure to set the correct header, and
* prevent our custom MIME type detection
2022-09-06 11:21:33 +02:00
Sebastian Serth
b6d8c7175b
Disallow any external resources for :render_file
2022-09-06 11:20:57 +02:00
Sebastian Serth
0a16f589e9
Use X-Sendfile to transmit native files and handle file uploads
2022-09-06 01:21:40 +02:00
Sebastian Serth
60dc8c3b7e
Apply line-based coloring for output
2022-09-02 16:56:18 +02:00
Janis4411
e0c2c7b806
Hide score button if exercise has no tests
...
We check for all teacher-defined assessments (linter and unit tests) to determine whether scoring should be possible
2022-08-22 17:51:57 +02:00
Sebastian Serth
c228850ae8
Update find method
2022-08-20 00:37:48 +02:00
Sebastian Serth
d762f976a8
Add new CodeOcean::File#read method
...
* With a new method, we can simplify our code to handle differences between file.content and file.native_file.read
2022-08-19 22:42:55 +02:00
Sebastian Serth
acc07ffa5d
Disallow leading / in zip archives
2022-08-18 16:45:15 +02:00
Sebastian Serth
145c4aa8d5
Refactor various ruby files
...
* Insights based on brakeman report
2022-08-18 15:25:04 +02:00
Sebastian Serth
01f6b0d16e
Reduce skip_before_action usage
2022-08-17 00:54:20 +02:00
Sebastian Serth
9587ecb2b1
Resolve bug where duration of not-started runner cannot be calculated
2022-07-15 00:49:16 +02:00
Sebastian Serth
1183f5cdcd
Ensure that the testrun[:status] is available in more cases
2022-07-15 00:49:15 +02:00
Sebastian Serth
0ab3d0bdc1
Fix Rubocop offenses
2022-06-30 14:02:53 +02:00
Sebastian Serth
ea728f54ec
Fix remote evaluations URL when using subdirectory for CO
2022-05-14 19:01:54 -04:00
Sebastian Serth
ea02dff0e5
Extend storage of Testrun Messages and truncate long output
2022-04-29 22:44:34 +02:00
Sebastian Serth
5ecba6ef70
Persist TestrunMessages and store timestamp
...
So far, the Testrun messages are in addition to the Tesstrun.output column
2022-04-29 01:00:51 +02:00
Sebastian Serth
e9efb5bc2b
Add exit_code and status to Testruns, create model for TestrunMessages
...
* This is the first step to migrate the `output` column from Testruns to a dedicated table TestrunMessages
2022-04-28 15:18:51 +02:00
Sebastian Serth
83e09f33ec
Merge pull request #1237 from openHPI/aws_experiment
...
Prepare AWS Experiment
2022-04-18 21:18:29 +02:00
Sebastian Serth
19bd742bc9
Show a localized message if the program was killed.
...
* This will most likely happen by the OOM killer, thus we inform the user about the memory restriction.
2022-04-15 21:29:55 +02:00
Sebastian Serth
d10735d0a8
Persist Execution Environment when running code
2022-04-15 15:22:19 +02:00