Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat]: Add sub-commands related to submissions #19

Merged
merged 26 commits into from
Mar 28, 2024
Merged

Conversation

vpchung
Copy link
Member

@vpchung vpchung commented Mar 26, 2024

Fixes (partially) #3

Changelog

Sub-commands added:

Subcommand Description
annotate Add and/or update submission annotations
change-status Update status annotation of one or more submissions
delete Delete one or more submissions
download Download a file submission OR provide instructions on how to pull a Docker submission
info Get information about a submission
reset Reset status annotation to RECEIVED of one or more submissions

Preview

  • annotate

    Simple output

    $ cnb-tools submission annotate 9743445 ~/Desktop/annots.json
    Submission ID 9743445 annotations updated.
    

    verbose output

    $ cnb-tools submission annotate 9743445 ~/Desktop/annots.json --verbose
    Submission ID 9743445 annotations updated.
    Annotations:
    {
      "foo_score": [
        100
      ],
      "submission_errors": [
        ""
      ],
      "submission_status": [
        "SCORED"
      ]
    }
    
  • change-status

    $ cnb-tools submission change-status 9743445 9743446 CLOSED
    Updated submission ID 9743445 to status: CLOSED
    Updated submission ID 9743446 to status: CLOSED
    
  • delete

    Prompt before deleting - nothing happens if 'no'

    $ cnb-tools submission delete 9742197
    ❗Are you sure you want to delete the submission(s)?
    
    Once deleted, submission(s) CANNOT be recovered. [y/N]: n
    
    No deletion was done.
    

    Prompt before deleting - delete submission(s) if 'yes'

    $ cnb-tools submission delete 9742197
    ❗Are you sure you want to delete the submission(s)?
    
    Once deleted, submission(s) CANNOT be recovered. [y/N]: y
    
    Submission deleted: 9742197
    

    Force delete without confirmation

    $ cnb-tools submission delete 9743442 9743443 -f
    
    Submission deleted: 9743442
    Submission deleted: 9743443
    
  • download

    Download file submission to default destination (cwd)

    $ cnb-tools submission download 9742197
     Submission ID 9742197 downloaded to: /Users/vchung/Desktop/cnb-tools
    

    Download file submission to specified destination

    $ cnb-tools submission download 9742197 --dir ~/Desktop
    Submission ID 9742197 downloaded to: /Users/vchung/Desktop
    

    Provide instructions for Docker submission

    $ cnb-tools submission download 9743442
    Submission ID 9743442 is a Docker image 🐳 To 'download', run the following:
    
    docker pull docker.synapse.org/syn20682803/test-mlcube@sha256:...
    
    If you receive an error, try logging in first with: docker login docker.synapse.org
    
  • info

    $ cnb-tools submission info 9742197
    ID: 9742197
    Challenge: Challenge Portal Wiki Template
    Date: 2024-01-18
    Submitter: vchung
    Team (if any): 
    Status: ACCEPTED
    Annotations:
    {
      "baz_score": [
        50
      ],
      "foo_score": [
        50
      ],
      "submission_errors": [
        ""
      ],
      "submission_status": [
        "SCORED"
      ]
    }
    
  • reset

    $ cnb-tools submission reset 9743445 9743446
    Updated submission ID 9743445 to status: RECEIVED
    Updated submission ID 9743446 to status: RECEIVED
    

@pep8speaks
Copy link

pep8speaks commented Mar 26, 2024

Hello @vpchung! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 31:60: F722 syntax error in forward annotation 'Submission ID'
Line 39:55: F722 syntax error in forward annotation 'Submission ID'
Line 43:13: F821 undefined name 'dest'
Line 45:18: F722 syntax error in forward annotation 'Filepath to download destination (if submission is a file)'
Line 56:55: F722 syntax error in forward annotation 'Submission ID'
Line 60:18: F722 syntax error in forward annotation 'Filepath to JSON file containing annotations'
Line 66:13: F821 undefined name 'verbose'
Line 67:13: F821 undefined name 'v'
Line 68:18: F722 syntax error in forward annotation 'Output final submission annotations (default: false)'
Line 80:40: F722 syntax error in forward annotation 'One or more submission ID(s)'
Line 93:40: F722 syntax error in forward annotation 'One or more submission ID(s)'
Line 104:29: F722 syntax error in forward annotation 'One or more submission ID(s)'
Line 112:17: F722 syntax error in forward annotation '❗Are you sure you want to delete the submission(s)?\n\nOnce deleted, submission(s) CANNOT be recovered.'

Comment last updated at 2024-03-28 00:24:38 UTC

@vpchung vpchung marked this pull request as ready for review March 28, 2024 00:15
@vpchung vpchung self-assigned this Mar 28, 2024
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@vpchung vpchung merged commit 07d5688 into main Mar 28, 2024
2 checks passed
@vpchung vpchung deleted the feat-3_submissions branch March 28, 2024 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants