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

Fix Zenodo upload script #1645

Open
uellue opened this issue May 16, 2024 · 1 comment
Open

Fix Zenodo upload script #1645

uellue opened this issue May 16, 2024 · 1 comment
Labels
infra Test/Build/Release infrastructure
Milestone

Comments

@uellue
Copy link
Member

uellue commented May 16, 2024

Since recently the script cannot update an existing draft anymore, instead it triggers a "404". We should figure out what is going on and fix the script.

As a work-around one can drop any drafts on Zenodo before minting a new RC or release.

@uellue uellue added the infra Test/Build/Release infrastructure label May 16, 2024
@uellue uellue added this to the 0.15 milestone May 16, 2024
@sk1p
Copy link
Member

sk1p commented May 16, 2024

Full error message:

Traceback (most recent call last):
  File "/home/runner/work/LiberTEM/LiberTEM/scripts/zenodo_upload", line 399, in main
    r = update_deposition(deposition_id=deposition_id, data=make_data())
  File "/home/runner/work/LiberTEM/LiberTEM/scripts/zenodo_upload", line 150, in update_deposition
    raise ZenodoException(prettystring(r))
ZenodoException: Status code: 404 
{'message': 'Not found.', 'status': 404}

Possible next debugging steps: the deposition_id used in the update_deposition call comes from get_latest_draft of get_geposition(deposition_id=parent). More concretely, it comes from the latest_draft link.

In the case of the successful update (newly created deposition), latest_draft is something like https://zenodo.org/api/deposit/depositions/11204954 - it would be good to find out how this looks like in the case of updating an existing draft.

Also a note:

def get_latest_draft(r):
    data = r.json()
    url = data['links']['latest_draft']
    parts = url.split('/')
    # The last bit of the URL is the ID
    return parts[-1]

This can be error-prone, maybe instead we should directly fetch the url and access the id of the returned object? Then we don't rely on the exact URL layout (imagine they add a URL parameter, for example, for whatever reason...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Test/Build/Release infrastructure
Projects
None yet
Development

No branches or pull requests

2 participants