Skip to content

feat(graph-store): add a conditional graph uploader - #151

Open
SamuelReeder wants to merge 1 commit into
mainfrom
users/sareeder/graph-store-uploader
Open

SamuelReeder wants to merge 1 commit into
mainfrom
users/sareeder/graph-store-uploader

Conversation

@SamuelReeder

Copy link
Copy Markdown
Collaborator

Summary

  • Add tools/upload_graphs.py to validate graph JSON, compute the canonical SHA-256 object keys, and preview creates, tag merges, and skips.
  • Require --apply and a named AWS profile for writes. Preserve stored names, notes, and tags. Use S3 conditional writes to prevent overwriting concurrent changes.
  • Replace the manual upload instructions with examples for the new tool.

Validation

  • PYTHONPATH=src python -m pytest -q tests/unit/test_upload_graphs.py
  • Black 25.12.0 check on the new Python files.
  • AWS CLI v2 smoke test against a local S3-compatible endpoint: preview, conditional create, conditional merge, skip, and stale ETag rejection. No live S3 objects changed.

Preview the SHA-256 keys and tag changes before writing to S3.
Merge tags without replacing stored names or notes, and stop on a stale ETag.
@SamuelReeder
SamuelReeder requested a review from a team as a code owner November 24, 2026 19:17
Comment thread tools/upload_graphs.py
except (OSError, ValueError) as exc:
parser.error(str(exc))

aws = ["aws", "--no-cli-pager", "--output", "json"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of aws cli in this python script, could we use the boto3 api.
And then we could add a requirements.txt to download the dependencies

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should just use your env to upload

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