fix(ia-save): validate save job status before recording success#590
Open
fix(ia-save): validate save job status before recording success#590
Conversation
Collaborator
Author
|
Validation summary:
|
Collaborator
Author
|
Additional verification note (live IA capture confirmation): For the two live-smoke URLs, I verified actual captures were created by checking save-status payloads and opening the resulting archive URLs.
So these are confirmed captures on IA, not only successful client responses. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
job_id/save/status/{job_id}and only treatstatus=successas successWhy
Issue #387 reports many URLs marked as saved even when no archive entry exists. The previous implementation treated any 2xx from
/saveas success, but save is asynchronous and requires status verification.Testing
python3 -m compileall src/external/internet_archives/client.py tests/automated/unit/external/internet_archives/test_client_save.pyPOSTGRES_USER=test_source_collector_user POSTGRES_PASSWORD=HanviliciousHamiltonHilltops POSTGRES_HOST=localhost POSTGRES_PORT=5432 POSTGRES_DB=source_collector_test_db UV_CACHE_DIR=/tmp/uv-cache uv run pytest -q tests/automated/integration/tasks/scheduled/impl/internet_archives/save/test_new_insert.py tests/automated/integration/tasks/scheduled/impl/internet_archives/save/test_updated_insert.py tests/automated/integration/tasks/scheduled/impl/internet_archives/save/test_error.py tests/automated/unit/external/internet_archives/test_client_save.py8 passedINTERNET_ARCHIVE_S3_KEYS):https://example.com->has_error=Falsehttps://www.pdap.io->has_error=FalseFixes #387