Skip to content

i1278: send RUN_RECEIVED msg to TEAM when submission is via pc2submit... - #1299

Open
clevengr wants to merge 1 commit into
pc2ccs:developfrom
clevengr:i1278_pc2submit_runs_don't_show_as_pending_on_WTI
Open

clevengr wants to merge 1 commit into
pc2ccs:developfrom
clevengr:i1278_pc2submit_runs_don't_show_as_pending_on_WTI

Conversation

@clevengr

Copy link
Copy Markdown
Contributor

Description of what the PR does

Adds an extra step to PacketHandler.runSubmission(...), which is the method invoked when a Run is submitted to the PC2 Server. The extra step is to check whether the submission came from a "proxy" (such as the Event Feeder client -- for example when the pc2submit Python script is used to submit a run) and if so to send a RunSubmissionConfirm packet to the actual team client (that is, to the account that invoked pc2submit).

This extra step is necessary because pc2submit makes submissions via the Event Feed client, and the packet handler for submissions doesn't send a RunSubmissionConfirm packets to proxy clients like the EF client -- the result being that clients such as the WTI never get a notification of the run submission when it occurs via an invocation of pc2submit. This in turn keeps the WTI from displaying runs which are "Pending".

Issue which the PR addresses

Fixes #1278

Environment in which the PR was developed

Windows 11, java version "1.8.0_271", Chrome Version 149.0.7827.103, and Cursor Version 3.14.7 w/ LLM Grok 4.7

Precise steps for testing the PR

  1. Ensure you have Python installed on your machine (it is needed to run the pc2submit script).
  2. Download and unzip the PR distribution (or build it yourself on your machine).
  3. Start a PC2 Server loading the clics_sumithello contest.
  4. Start a PC2 Admin and use the Times tab to start the contest running
  5. Start a PC2 Event Feeder client, login as "ef1", and press the Start button to start the Event Feed webserver running.
    1. Verify on the EF console that the EF web server started.
  6. Start a WTI Server running (you may need to unzip the projects>WebTeamInterface-1.2 zip file; then in the resulting folder enter the command ./bin/pc2wti at a command prompt).
    1. Verify on the WTI console that the WTI web server started
  7. Open a clean browser and connect to the WTI server (typically, using http://localhost:8080)
  8. Login as team1/team1.
  9. Select Submit Problem, then select any problem, any language, and any (text) file and click Submit.
  10. Verify that the WTI Runs screen, under Judgement, shows the submission as Pending.
  11. Open a command prompt in the PC2 distribution folder and submit a program using the command
python ./bin/pc2submit --url https://localhost:50443 --problem A ./samps/src/hello.cpp
  1. On the PC2 Admin, look at the Run Contest>Runs screen and verify that TWO runs are Queued_for_computer_judgement (one is the first one you submitted above via the WTI; the second is the one you submitted using pc2submit).
  2. Look at the WTI Runs screen; verify that there are TWO runs, both showing "Pending" under "Judgement".
  3. On the PC2 Admin Run Contest>Runs screen, select the first run (the one submitted via WTI), click Edit, change the Run Status to JUDGED, change the Judgement to any judgement, check the Notify Team checkbox, and click Update.
  4. On the WTI Runs screen, verify that the run status changes to whatever judgement you assigned, and that there is still a second run showing "Pending".
  5. On the PC2 Admin, select the second run (the one submitted using pc2submit), click Edit, change the run Status to New, and click Update.
  6. Ensure the second run is still selected, then click Request Run then Execute Run.
  7. After the run executes, close the resulting Test Results screen and then select either Accept Validator or select a different judgement and click Accept Selected. (Be sure the Notify Team checkbox is checked.)
  8. On the WTI Runs screen, verify that the second run now has the judgement you assigned.

This extra step is necessary because pc2submit makes submissions via the
Event Feed client; the packet handler for submissions doesn't send a
RUN_RECEIVED to proxy clients like the EF client.
@clevengr clevengr added bug Something isn't working WTI-UI This bug or feature request applies to the WTI-UI (browser-side). In PR code review NEXT Contest Consider fixing for next contet One Approval A very low risk and low LOE PR/Change labels Sep 23, 2026

@johnbrvc johnbrvc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

See the question I have...

controller.sendToJudgesAndOthers(confirmPacket, false);
Packet dupSubmissionPacket = PacketFactory.createRunSubmissionConfirmation(contest.getClientId(), fromId, run, runFiles);
controller.sendToServers(dupSubmissionPacket);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What happens if this run was submitted via the shadow/RemoteRunSubmitter.submitRun() from shadow/RemoteEventFeedMonitor.run()? That is, PC2 is acting as a shadow? Where does that notification that was added wind up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working In PR code review NEXT Contest Consider fixing for next contet One Approval A very low risk and low LOE PR/Change WTI-UI This bug or feature request applies to the WTI-UI (browser-side).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WTI does not display pending submissions submitted via command line

2 participants