fix(urlscan): honor config labels and duration_period (#6555)#7091
Open
jabesq wants to merge 2 commits into
Open
fix(urlscan): honor config labels and duration_period (#6555)#7091jabesq wants to merge 2 commits into
jabesq wants to merge 2 commits into
Conversation
|
🔴 Connector Linter errors detected
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the external-import/urlscan connector to correctly honor configurable labels and to align its scheduling configuration with the repository’s standard connector.duration_period pattern (while keeping backward compatibility via a deprecated connector.interval).
Changes:
- Read observable labels from configuration (
urlscan.labels) instead of hardcoding defaults inconnector.py. - Deprecate
connector.intervalin favor ofconnector.duration_period(timedelta-based), with automatic migration from legacy seconds. - Regenerate configuration documentation/schema and update sample deployment files/README accordingly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| external-import/urlscan/src/urlscan/settings.py | Adds urlscan.labels, introduces deprecated connector.interval migration to duration_period, and sets a default connector id. |
| external-import/urlscan/src/urlscan/connector.py | Switches scheduling to duration_period and sources default labels from config. |
| external-import/urlscan/src/config.yml.sample | Updates sample YAML to use duration_period and labels and aligns with current sample-comment conventions. |
| external-import/urlscan/README.md | Simplifies config documentation by linking to the generated CONNECTOR_CONFIG_DOC.md. |
| external-import/urlscan/docker-compose.yml | Updates sample env vars to use CONNECTOR_DURATION_PERIOD and URLSCAN_LABELS. |
| external-import/urlscan/metadata/connector_config_schema.json | Regenerated schema reflecting CONNECTOR_DURATION_PERIOD, deprecated CONNECTOR_INTERVAL, and URLSCAN_LABELS. |
| external-import/urlscan/metadata/CONNECTOR_CONFIG_DOC.md | Regenerated config documentation including deprecation and the new labels variable. |
jabesq
force-pushed
the
fix/6555-urlscan-config-labels
branch
2 times, most recently
from
July 23, 2026 14:04
9498f53 to
0b5d054
Compare
jabesq
force-pushed
the
fix/6555-urlscan-config-labels
branch
from
July 23, 2026 15:03
0b5d054 to
48218a8
Compare
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.
Proposed changes
CONNECTOR_LABELS(nowURLSCAN_LABELS) being silently ignored: the connector previously hardcodeddefault_labels=["Phishing", "phishfeed"]inconnector.pyinstead of reading the value from configuration. Labels are now sourced fromself._config.urlscan.labels.connector.interval/CONNECTOR_INTERVALin favor ofconnector.duration_period/CONNECTOR_DURATION_PERIOD, aligning this connector with the standard scheduling pattern used across other connectors, and replaced the raw-seconds interval with a propertimedelta.DeprecatedFieldforintervalso existing deployments that still setCONNECTOR_INTERVAL(in seconds) keep working: the old integer value is automatically converted into aduration_periodtimedelta under the hood.connector.idvalue so the connector can run out-of-the-box without requiring every deployment to generate its own UUID.__metadata__/CONNECTOR_CONFIG_DOC.mdandconnector_config_schema.jsonto reflect the newCONNECTOR_DURATION_PERIODandURLSCAN_LABELSvariables and the deprecation ofCONNECTOR_INTERVAL.docker-compose.ymlandsrc/config.yml.sampleto useduration_period/labelsand commented out optional variables to match current sample conventions.README.mdto link to the auto-generatedCONNECTOR_CONFIG_DOC.mdinstead of maintaining a manual, now-outdated configuration table.Related issues
Checklist
Further comments
The
connector.intervalfield is kept in the settings model but marked withDeprecatedField(deprecated="Use duration_period instead", new_namespaced_var="duration_period", new_value_factory=lambda x: timedelta(seconds=x)). This means: if an operator still setsCONNECTOR_INTERVAL(in seconds, as before), it is transparently converted into atimedeltaand assigned toconnector.duration_period, so no breaking change occurs for existing deployments. New deployments should setCONNECTOR_DURATION_PERIOD(ISO-8601 duration, e.g.P1D) directly. The connector still manages its own scheduling loop internally (it does not delegate to the SDK's built-in scheduler), it now just reads the interval fromduration_period.total_seconds()instead of a rawintervalint.