feat: add isExternal property to Component for CycloneDX v1.7#959
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Documentation build overview
12 files changed ·
|
|
Thank you so much for contributing this feature, @tonal. |
| self.supplier, self.author, self.publisher, | ||
| self.description, | ||
| self.mime_type, self.scope, _ComparableTuple(self.hashes), | ||
| self.mime_type, self.scope, self.is_external, _ComparableTuple(self.hashes), |
There was a problem hiding this comment.
please add self.is_external at the bottom, not in the middle
There was a problem hiding this comment.
Thanks for the review, @jkowalleck!
self.is_external is now the last field in __comparable_tuple — moved to the bottom, right after crypto_properties/tags.
I also rebased the branch onto the latest main (11.11.0), so it's a single commit on top of current upstream. All tests pass locally (6981/6981), including the is_external unit tests and the JSON/XML snapshots across schema versions.
Implement the isExternal boolean property on Component as specified in CycloneDX v1.7 schema. An external component is one that is not part of an assembly, but is expected to be provided by the environment. - Add is_external property to Component class with XML attribute serialization - Create XmlBoolAttribute serialization helper for proper bool handling - Add unit tests for is_external (default value, set/get, equality, sorting) - Add test fixture and snapshots for JSON/XML output - Supports v1.7+ schemas only Implements: CycloneDX#903 Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> Signed-off-by: Alexandr N Zamaraev (aka tonal) <tonal@promsoft.ru>
Implement the
isExternalboolean property on Component as specified in CycloneDX v1.7 schema. An external component is one that is not part of an assembly, but is expected to be provided by the environment.is_externalproperty to Component class with XML attribute serializationXmlBoolAttributeserialization helper for proper bool handling (JSON: native bool, XML: lowercase string)is_external(default value, set/get, equality, sorting)Description
Adds the
isExternalproperty toComponentas defined in the CycloneDX v1.7 XML/JSON schema. This property indicates that a component is external to the organization and expected to be provided by the deployment environment. The implementation includes a custom serialization helper (XmlBoolAttribute) to handle the difference between JSON (native boolean) and XML (lowercase string attribute) serialization requirements.Resolves or fixes issue: #903
AI Tool Disclosure
Qwen Code (CLI agent)Qwen (latest)Implement isExternal property for Component per CycloneDX v1.7 spec, including tests and snapshotsAffirmation