i_1061 Prompt for credentials for pc2submit if none found #1064
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of what the PR does
Add optional code (controlled by environment variable SUBMITCREDENTIALS == 'yes') to prompt the user for their contest credentials and add them to their
~/.netrc
file. Added appropriate code ask for and confirm the user's credentials.CI: Code cleanup - create constants for environment variables (there were already several environment variables hard-coded).
CI: Add
-t #
(--team_id #
) to allow specification of theteam_id
to submit on behalf ofCI: Add environment variable SUBMITOMITEXTRAHELP=='yes' to not include help for the
-c
,-a
,-u
and-t
options as these are typically not used by most users.Issue which the PR addresses
Fixes #1061
Environment in which the PR was developed (OS,IDE, Java version, etc.)
Windows 11
java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)
Precise steps for testing the PR (i.e., how to demonstrate that it works correctly)
~/.netrc
SUBMITCREDENTIALS
environment to yes or no (to test various combinations)pc2submit
, eg.pc2submit -p a -y --team_id 1 samps/src/hello.cpp
SUBMITCREDENTIALS
was set to 'yes', otherwise it should just fail with a network exception of some sort.SUBMITCREDENTIALS
, user and password, eg. team1/team1, administrator1/administrator1, or wrong credentials. Be sure to remove the entry for localhost from the~/.netrc
if you want to clear out the credentials for a new test.