Skip to content

chore(deploy): configure PRICECHARTING_SELLER_ID in prod - #300

Merged
elstonyth merged 1 commit into
masterfrom
chore/pc-seller-id-prod
Jul 30, 2026
Merged

chore(deploy): configure PRICECHARTING_SELLER_ID in prod#300
elstonyth merged 1 commit into
masterfrom
chore/pc-seller-id-prod

Conversation

@elstonyth

@elstonyth elstonyth commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Follow-up to #299. That page refuses to run without a seller id — deliberately, because PriceCharting's API token only authenticates and does not scope /api/offers to our account; without a seller the API answers with every user's offers. So until this key exists, Inventory › "Add from PC Collection" 503s in production with its setup message.

  - key: PRICECHARTING_SELLER_ID
    scope: RUN_TIME
    value: pwoe4lsq4pkxegdsoyyzvfjuza

Plain value, not a __SECRET__ placeholder, for two reasons:

  • It isn't a secret — it's the public 26-character PriceCharting user id (their API docs publish an example one, and other users' ids are visible on their profile pages).
  • A __SECRET__ token with no matching entry in the secret store aborts every do-apply run, so adding one here would have broken unrelated deploys.

App-level scope, sitting with the token above it: the collection route is served by the API component, but keeping both PriceCharting keys app-wide avoids the component-scope trap that silently left the nightly sync "no token" on the worker in July.

Verification

  • Spec parses (yaml.safe_load), 29 envs, the new key present as a plain value.
  • Placeholder inventory unchanged — the 10 existing __SECRET__ tokens are the same before and after, so no new secret is required for do-apply.
  • The value itself was verified live against PriceCharting before use: status=collection|available|sold with this seller all return success, where a username or a wrong id returns 400 user not found.

🤖 Generated with Claude Code

Summary by Sourcery

Build:

  • Add non-secret PRICECHARTING_SELLER_ID app-level env configuration alongside the existing PriceCharting API token.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the “Inventory > Add from PC Collection” flow to ensure imported offers come from the configured PriceCharting seller account.
    • Prevented offers belonging to other PriceCharting accounts from appearing during collection imports.

Inventory > "Add from PC Collection" refuses to run without a seller id, so
without this key the page 503s in production with its setup message.

Added as a PLAIN value, not a __SECRET__ placeholder, for two reasons: it is the
public 26-character PriceCharting user id (their own API docs publish an example
one), and a placeholder with no matching entry in the secret store aborts every
do-apply run.

App-level scope like the token above it: the collection route is served by the
API component, but keeping both PriceCharting keys together app-wide avoids the
component-scope trap that silently broke the nightly sync on the worker in July.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Configures the PRICECHARTING_SELLER_ID runtime environment variable in the production backend app manifest so that the Inventory "Add from PC Collection" route can call PriceCharting with a scoped seller and avoid 503s and cross-account data exposure, while explicitly keeping it as a non-secret plain value alongside the existing API token.

Sequence diagram for Inventory AddFromPCCollection calling PriceCharting with PRICECHARTING_SELLER_ID

sequenceDiagram
  actor User
  participant InventoryUI
  participant BackendAPI
  participant PriceChartingAPI

  User->>InventoryUI: click Add from PC Collection
  InventoryUI->>BackendAPI: GET /inventory/pricecharting_collection
  BackendAPI->>PriceChartingAPI: GET /api/offers?seller=PRICECHARTING_SELLER_ID
  PriceChartingAPI-->>BackendAPI: offers scoped to seller
  BackendAPI-->>InventoryUI: 200 offers list
  InventoryUI-->>User: display seller collection offers
Loading

File-Level Changes

Change Details Files
Add a new runtime environment variable for the PriceCharting seller id to the backend app deployment spec and document why it is a plain value rather than a secret placeholder.
  • Extend the envs list with a PRICECHARTING_SELLER_ID entry scoped to RUN_TIME and set to the provided seller id string.
  • Place the new key adjacent to the existing PRICECHARTING_API_TOKEN configuration to keep both PriceCharting-related values at app scope.
  • Add explanatory comments clarifying that the seller id is public, that the API token only authenticates and does not scope /api/offers, and that using a secret placeholder would break do-apply when no secret store entry exists.
.do/backend.app.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4c4abf97-5bfb-45ab-9bc6-8623bcb8d817

📥 Commits

Reviewing files that changed from the base of the PR and between a45c180 and 22a4f2c.

📒 Files selected for processing (1)
  • .do/backend.app.yaml

📝 Walkthrough

Walkthrough

The backend app environment configuration adds the public PRICECHARTING_SELLER_ID variable alongside the existing API token to scope PriceCharting collection imports to the configured seller account.

Changes

PriceCharting configuration

Layer / File(s) Summary
Seller identifier environment wiring
.do/backend.app.yaml
Adds PRICECHARTING_SELLER_ID to the shared runtime environment and documents its role in the “Add from PC Collection” flow.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: configuring PRICECHARTING_SELLER_ID in production.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/pc-seller-id-prod

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@elstonyth
elstonyth merged commit e9f4b0b into master Jul 30, 2026
14 checks passed
@elstonyth
elstonyth deleted the chore/pc-seller-id-prod branch July 30, 2026 09:33
elstonyth added a commit that referenced this pull request Jul 30, 2026
#300 added a comment that spelled the redacted-secret placeholder token
literally. do-apply.ps1's final guard greps the WHOLE spec text — comments
included — for that token and aborts, so the prose alone was enough to block
every backend deploy:

  pwsh scripts/do-apply.ps1 backend -Validate
  -> Unresolved secret placeholder remains - aborting

Reworded, and the comment now says why the token must never appear in prose.
`pwsh scripts/do-apply.ps1 backend -Validate` passes again ("Validation OK"),
with exactly the ten real placeholders left in the file.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant