Repository navigation
feat: product view and list give the data's S3 path (s3_uri, s3_endpoint) - #103
Merged
Merged
Conversation
|
Claude finished @alukach's task in 13s —— View job ✅ No blocking issues — safe to merge. I read the
Simplify (ponytail)
💰 Estimated review cost: $0.14 · 0m12s · 5 turns |
Contributor
|
Docs preview: https://cli.source.coop/pr-preview/pr-103/ Built from 1aaf704. It goes live a minute or two after this run, once GitHub Pages deploys it, and is removed when the PR closes. |
`product view` and `product list --json` add `s3_uri` (s3://ACCOUNT/PRODUCT/) and `s3_endpoint` (the --proxy-url), so scripts and agents read the data through the proxy instead of copying a mirror's backend prefix. The human view, the details list and the -i screen show an S3 line under the URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review: - The human S3 row reads `s3://ACCOUNT/PRODUCT/ on <proxy>`: a bare s3:// path pasted into an AWS tool goes to AWS itself, to a bucket named after the account. - with_s3 takes each product by value, so list --json doesn't clone every record to add two fields. - --proxy-url's help and the README say it is product --json's s3_endpoint. - Re-record the README's product-create demo, which selects s3_uri. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alukach
force-pushed
the
feat/product-s3-uri
branch
from
November 9, 2026 18:43
e1e8e1a to
29ac447
Compare
…opy nothing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
product viewandproduct listnow say where to read a product's data with S3 tools. Before, an agent runningproduct view ACCOUNT/PRODUCT --jsonsaw the mirrors' backendprefixand the website URL, but not the path through the S3 data proxy, so it copied the backend prefix. Now--jsoncarriess3_uri(s3://ACCOUNT/PRODUCT/) ands3_endpoint(the proxy to send requests to), and the human view shows anS3line with the endpoint it's read through.How it behaves
--jsonadds two derived fields to each product record fromproduct view,product list,product createandproduct edit:s3_uri:s3://ACCOUNT/PRODUCT/, from the record'saccount_idandproduct_id.s3_endpoint: the--proxy-url/SOURCE_PROXY_URLthe command ran with, trailing/removed (https://data.source.coopby default,https://data.staging.source.coopon staging). The proxy is path-style: the account is the bucket.Everything else is the API's record as before. Adding fields is non-breaking per the JSON contract.
product delete --jsonis unchanged: the product is gone, so there's nothing to read.Human output:
product view, thedetailsformat ofproduct listand the-irecord screen (allproduct_lines) showS3 s3://ACCOUNT/PRODUCT/ on https://data.source.coop(the--proxy-urlin use) underURL. The table format is unchanged, to keep it toNAME VISIBILITY TITLE. The line names the endpoint because a bares3://path pasted into an AWS tool goes to AWS itself, to a bucket named after the account, which may be someone else's.Why
s3_endpointis included: the proxy URL was already in hand where product commands run (main.rshasargs.site.proxy_url, the same value that picks the login environment, and service-account commands already get it through theirCtx). Product commands now take a smallproduct::Site { web, proxy }instead of the site URL alone. Without the endpoint, an agent on staging (or anyone with--proxy-urlset) would pair the right path with the wrong host, andauth status --jsonis a second call to learn it.No new prompts, flags or exit codes.
Demos
These run against
docs/recorder/stub.py, not a real API.record.pydraws the stub's URLs as production's (source.coop,data.source.coop), so the records shown are made-up fixtures, not real ones.product view: the S3 line, s3_uri and s3_endpoint in --json, then aws s3 ls with them
product list: s3_uri on each product in --json, and the S3 line in the details format
product view -i: the product's screen shows the S3 line too
Docs changes
S3line,s3_uriands3_endpoint, why not to use a mirror'sprefix, and anaws s3 ls --no-sign-requestexample.tour(its--jsonnow pickss3_uri; theS3line shows its endpoint),product-create(pickss3_uri) andproduct-browse(the record screen has theS3line) demos: Quick start, Products.--proxy-url's help on the API commands says it is also product--json'ss3_endpoint.--helpforproduct list --jsonandproduct view --jsonnames the two fields.Not in this PR
s3_urifrom the source.coop API. It's derived here from the product's IDs. Kept in the CLI for now; worth moving to the API if other clients (the web UI, SDKs) need it.delete --jsonprints the deleted record withouts3_uri/s3_endpoint: there's no data to read once it's gone.s3_uriinaccount viewor other places that mention products. Only product records carry it. Worth adding if member or service-account--jsonstarts embedding product records.Testing
cargo fmt,cargo clippy --all-targets -- -D warnings,cargo testandcargo test --features staging: 181 passed each, rebased on docs: say in --help where the data is and that public data needs no sign-in #101.json_adds_where_to_read_the_data_through_the_proxy: the record is kept,s3_uriands3_endpointare added, a trailing/on the proxy URL is dropped), and theproduct_linestest now expects theS3line. Existing wiremock tests oflist,createandeditrun the new code with--json; they don't capture stdout, so the fields themselves are checked throughwith_s3, which takes each product by value solist --jsoncopies nothing.aws s3 ls … --no-sign-requestagainst its S3 listing. Built the docs site locally and checked the new cross-page link resolves.🤖 Generated with Claude Code