fix(bundler): reject non-mapping 'integration' in a bundle manifest#3629
Merged
mnriem merged 1 commit intoJul 22, 2026
Merged
Conversation
BundleManifest.from_dict guarded 'requires' and 'provides' with "must be a mapping when present", but a present-but-non-mapping 'integration' (e.g. a bare string "copilot") silently failed the isinstance(dict) check and was dropped — leaving the bundle wrongly integration-agnostic (is_agnostic() True) instead of surfacing the authoring mistake. Add the same guard so 'integration' is consistent with its sibling mapping fields. Test: integration='copilot' now raises BundlerError (fails before: silently dropped, no raise). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Rejects malformed non-mapping integration values instead of silently treating bundles as integration-agnostic.
Changes:
- Adds explicit
integrationmapping validation. - Adds a regression test for bare string values.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/bundler/models/manifest.py |
Validates the optional integration field. |
tests/contract/test_manifest_schema.py |
Covers malformed string integration input. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Medium
Collaborator
|
Thank you! |
This was referenced Jul 22, 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
BundleManifest.from_dictrejects a present-but-non-mappingrequiresandprovides:…but
integrationis the odd one out — a non-mapping value is silently dropped:So a manifest with
integration: copilot(a common mistake — the schema wantsintegration: {id: copilot}) parses as a bundle that is wrongly integration-agnostic (is_agnostic()True), instead of surfacing the error.Fix
Add the same guard as its sibling mapping fields — scoped strictly to the non-mapping-present case, leaving the existing dict-with-id behavior unchanged.
Test
test_string_integration_rejected_not_silently_dropped:integration="copilot"now raisesBundlerError("'integration' must be a mapping when present")— fails before (silently dropped, no raise).🤖 Written with the assistance of Claude Code (AI). Bug self-found; fix/tests verified locally (fail-before / pass-after), ruff clean.