Missing `--sandbox` in documentation snippet
Bug description and behavior
The page at https://escape2020.pages.in2p3.fr/wp3/eossr/snippets/3.ex_CI_upload_ossr.html provides a “snippet” for working with the Zenodo sandbox. However, the invocation of the eossr-check-connection-zenodo
in this repository is missing the --sandbox
argument, so it fails.
Steps to reproduce
Attempt to set up integration between GitLab and Zenodo following instructions at https://escape2020.pages.in2p3.fr/wp3/eossr/gitlab_to_zenodo.html
Expected behavior?
Integration works.
Relevant logs and/or screenshots
[0KRunning with gitlab-runner 15.3.0 (bbcb5aba)[0;m
[0K on Temp Shared Runner on lcs126 fdWqLYnX[0;m
section_start:1664206213:resolve_secrets
[0K[0K[36;1mResolving secrets[0;m[0;m
section_end:1664206213:resolve_secrets
[0Ksection_start:1664206213:prepare_executor
[0K[0K[36;1mPreparing the "docker" executor[0;m[0;m
[0KUsing Docker executor with image gitlab-registry.in2p3.fr/escape2020/wp3/eossr:v0.6 ...[0;m
[0KPulling docker image gitlab-registry.in2p3.fr/escape2020/wp3/eossr:v0.6 ...[0;m
[0KUsing docker image sha256:0995dae54f3f638e72ac8abf7627cd39db03ea3ab5981d9e63c06b2ec59854df for gitlab-registry.in2p3.fr/escape2020/wp3/eossr:v0.6 with digest gitlab-registry.in2p3.fr/escape2020/wp3/eossr@sha256:4506d2265804e885e4297c618da8af8c7ccdea1ed69905d59044d59130e3da8b ...[0;m
section_end:1664206222:prepare_executor
[0Ksection_start:1664206222:prepare_script
[0K[0K[36;1mPreparing environment[0;m[0;m
Running on runner-fdwqlynx-project-432-concurrent-0 via db01bd4e46f5...
section_end:1664206223:prepare_script
[0Ksection_start:1664206223:get_sources
[0K[0K[36;1mGetting source from Git repository[0;m[0;m
[32;1mFetching changes with git depth set to 20...[0;m
Initialized empty Git repository in /builds/astron-sdc/escape-wp5/esap-root-demo/.git/
[32;1mCreated fresh repository.[0;m
[32;1mChecking out 50cfeebe as 1.0.0...[0;m
[32;1mSkipping Git submodules setup[0;m
section_end:1664206224:get_sources
[0Ksection_start:1664206224:step_script
[0K[0K[36;1mExecuting "step_script" stage of the job script[0;m[0;m
[0KUsing docker image sha256:0995dae54f3f638e72ac8abf7627cd39db03ea3ab5981d9e63c06b2ec59854df for gitlab-registry.in2p3.fr/escape2020/wp3/eossr:v0.6 with digest gitlab-registry.in2p3.fr/escape2020/wp3/eossr@sha256:4506d2265804e885e4297c618da8af8c7ccdea1ed69905d59044d59130e3da8b ...[0;m
[32;1m$ eossr-check-connection-zenodo --token $SANDBOX_ZENODO_TOKEN -p $CI_PROJECT_DIR[0;m
* Creating a .zenodo.json file from your codemeta.json file...
* Using /builds/astron-sdc/escape-wp5/esap-root-demo/.zenodo.json file to simulate a new upload to Zenodo...
1 --> Testing communication with Zenodo...
Traceback (most recent call last):
File "/usr/local/bin/eossr-check-connection-zenodo", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/eossr/scripts/check_connection_zenodo.py", line 45, in main
zenodo.check_upload_to_zenodo(args.project_dir)
File "/usr/local/lib/python3.8/site-packages/eossr/api/zenodo/zenodo.py", line 416, in check_upload_to_zenodo
test_connection = self.query_user_entries()
File "/usr/local/lib/python3.8/site-packages/eossr/api/zenodo/zenodo.py", line 104, in query_user_entries
http_status.ZenodoHTTPStatus(answer.status_code, answer.json())
File "/usr/local/lib/python3.8/site-packages/eossr/api/zenodo/http_status.py", line 80, in __init__
self.raise_error()
File "/usr/local/lib/python3.8/site-packages/eossr/api/zenodo/http_status.py", line 107, in raise_error
raise HTTPStatusError(msg)
eossr.api.zenodo.http_status.HTTPStatusError: HTTP Status Code: 401 - Unauthorized.
Request failed, due to an invalid access token. Error response included.
{'message': "The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.", 'status': 401}
section_end:1664206226:step_script
[0Ksection_start:1664206226:cleanup_file_variables
[0K[0K[36;1mCleaning up project directory and file based variables[0;m[0;m
section_end:1664206227:cleanup_file_variables
[0K[31;1mERROR: Job failed: exit code 1
[0;m
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
diff --git a/examples/CI_code_snippets/3.ex_CI_upload_ossr.md b/examples/CI_code_snippets/3.ex_CI_upload_ossr.md
index 33ce0a5..14fbc33 100644
--- a/examples/CI_code_snippets/3.ex_CI_upload_ossr.md
+++ b/examples/CI_code_snippets/3.ex_CI_upload_ossr.md
@@ -53,7 +53,7 @@ deploy_zenodo:
stage: deploy
image: gitlab-registry.in2p3.fr/escape2020/wp3/eossr:v0.6
before_script:
- - eossr-check-connection-zenodo --token $SANDBOX_ZENODO_TOKEN -p $CI_PROJECT_DIR
+ - eossr-check-connection-zenodo --sandbox --token $SANDBOX_ZENODO_TOKEN -p $CI_PROJECT_DIR
script:
- eossr-upload-repository -t $SANDBOX_ZENODO_TOKEN --sandbox -i $CI_PROJECT_DIR --archive-name $CI_PROJECT_NAME.zip [-id $SANDBOX_ZENODO_PROJECT_ID]
only: