Report manifests under the production environment by default#28
Merged
Conversation
The connector never sent an `environment` field, so the backend defaulted every manifest to "sandbox". Since the connector reports from real builds (the prebuild scan / build hooks), the manifest should be "production". - Add `environment` to Config (type) and the wire payload, defaulting to `production`. - Resolve it from `PATCHSTACK_ENVIRONMENT` (env) or `environment` in `.patchstackrc.json`; reject anything other than production|sandbox. - Surface it in `scan` output and `status`; document the env var in --help. - Bump version to 0.2.7. Tests: added body + config-resolution coverage (94 passing). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
/review |
|
Implements configurable production or sandbox environment reporting with defaults. 🎯 Quality: 100% Elite · 📦 Size: Medium 📈 This month: Your 105th PR — above team average · Averaging Excellent |
ejntaylor
approved these changes
Jun 26, 2026
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.
What
The connector never sent an
environmentfield with the manifest, so the backend defaulted every upload to sandbox. Since the connector reports from real builds (theprebuildscan / build hooks), manifests should be reported as production.Changes
environmenttoConfigand the POST body, defaulting toproduction.PATCHSTACK_ENVIRONMENT(env var) or"environment"in.patchstackrc.json; precedence env → file → default. Reject any value other thanproduction/sandbox(CONFIG_INVALID).scanoutput (Reporting under the <env> environment.) andstatus; documentPATCHSTACK_ENVIRONMENTin--help.0.2.6 → 0.2.7.Tests
typecheckclean; 94 tests pass, including new coverage:postManifestsends the configured environment in the body.resolveConfigdefaults toproduction, reads the env var + config file, and rejects invalid values.Notes
Pairs with the backend change (saas) that flips the omitted-environment default to
production, so already-deployed connectors also report production without needing this upgrade.