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 for automated ingestion due to a change in the Github API for non-existing files #206

Merged
merged 2 commits into from
Jan 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions scripts/automated_ingestion/eessitarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ def find_state(self):
except github.UnknownObjectException:
bedroge marked this conversation as resolved.
Show resolved Hide resolved
# no metadata file found in this state's directory, so keep searching...
continue
except github.GithubException:
# if there was some other (e.g. connection) issue, abort the search for this tarball
logging.warning(f'Unable to determine the state of {self.object}!')
return "unknown"
except github.GithubException as e:
if e.status == 404:
# no metadata file found in this state's directory, so keep searching...
continue
else:
# if there was some other (e.g. connection) issue, abort the search for this tarball
logging.warning(f'Unable to determine the state of {self.object}, the GitHub API returned status {e.status}!')
return "unknown"
else:
# if no state was found, we assume this is a new tarball that was ingested to the bucket
return "new"
Expand Down
Loading