fix(composer): allow null license_type and subscription_link in manifest schema (#7119) - #7388
Conversation
|
The following packages appear to be unused:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the manifest-fragment generator and its JSON Schema to use explicit null values (instead of empty strings) for optional license_type and subscription_link, improving semantic clarity for downstream consumers (e.g., XTM Hub) as part of the manifest-fragment delivery work in #7119.
Changes:
- Allow
license_typeandsubscription_linkto benullin the manifest fragment schema and emitnullfrom the generator when those fields are absent. - Anchor the
PYCTI_PIN_PATTERNused to extract the pinnedpycti==...version formin_versioncomputation. - Remove the redundant
namefield from the Spur connector manifest metadata.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| shared/tools/composer/generate_manifest_fragment/generate_manifest_fragment.py | Updates pycti pin parsing regex and emits null for optional manifest fragment fields. |
| shared/tools/composer/generate_manifest_fragment/connector_manifest_schema.json | Allows null for license_type and subscription_link in the fragment schema. |
| external-import/spur/metadata/connector_manifest.json | Drops redundant name field to align with generator expectations/output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
2637b18 to
7a90f62
Compare
7a90f62 to
41b9ebc
Compare
41b9ebc to
87bc9a9
Compare
199bbe1 to
07d661b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
shared/tools/composer/generate_manifest_fragment/connector_manifest_schema.json:152
subscription_linkis now allowed to benull(per the updatedtype), but the schema description and examples still document the old empty-string sentinel. This is inconsistent with the PR’s stated intent to replace""withnullfor “not set” and may mislead schema consumers.
"subscription_link": {
"type": ["string", "null"],
"description": "URL to the external service or subscription page for the data source. Empty string if none.",
"examples": ["https://www.misp-project.org", ""]
07d661b to
0c4233e
Compare
Helene Nguyen (helene-nguyen)
left a comment
There was a problem hiding this comment.
Hugo Dupras (@jabesq) Good for me 👍
Proposed changes
license_typeandsubscription_linkto benullin the manifest fragment JSON schema, replacing the previous empty-string convention for "no value".generate_manifest_fragment.pyto emitnull(instead of"") forlicense_typeandsubscription_linkwhen the source manifest omits them.PYCTI_PIN_PATTERNregex (^...$withre.MULTILINE) so it only matches a full pinnedpycti==X.Y.Zline, preventing accidental partial/substring matches on lines with multiple dependency entries.namefield, reflecting the updated generator output.Related issues
Checklist
Further comments
license_typeandsubscription_linkpreviously used an empty string ("") as the "no value" sentinel, which is ambiguous with an actual empty value and doesn't map cleanly to JSON Schema'snulltype. Switching tonullmakes the "not set" case explicit and consistent with how other optional fields (e.g.last_verified_date) are already handled in the schema and generator.The
PYCTI_PIN_PATTERNregex was previously unanchored, so it could match apycti==X.Y.Zpin anywhere within a line — including inside apyproject.tomldependencies array with multiple quoted entries on one line, or as a partial substring of a longer token. Anchoring the pattern with^/$andre.MULTILINEensures it only matches when the entire line is a pinnedpyctirequirement, avoiding false positives from adjacent entries on the same line.