Skip to content

ratchet(types): promote unresolved-attribute + deprecated (plugins)#1317

Open
tomchop wants to merge 1 commit into
mainfrom
ty-plugins-final
Open

ratchet(types): promote unresolved-attribute + deprecated (plugins)#1317
tomchop wants to merge 1 commit into
mainfrom
ty-plugins-final

Conversation

@tomchop

@tomchop tomchop commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Final plugins ratchet batch. Drops unresolved-attribute and deprecated
from the overrides — the [[tool.ty.overrides]] block now holds only
unused-ignore-comment (the two core boto3/tldextract import ignores, which are
env-dependent: used by the dev-only main job, unused in the all-deps plugins job).

unresolved-attribute (32)

  • Event handlers (dockerhub, hostname_extract): message.event is an
    ObjectEvent | LinkEvent | TagEvent union and only ObjectEvent has
    yeti_object. Narrow with assert isinstance(event, ObjectEvent), then cast
    yeti_object to the concrete observable (ContainerImage / Url).
  • save()/find() return the base Observable/Entity through the connector,
    so plugins doing x = SpecificType(...).save() then x.<subclass attr> cast
    the result: File .name/.size (abusech, botvrij, hybrid), Malware/IntrusionSet
    .aliases (malpedia), AttackPattern .kill_chain_phases (wiz), ContainerImage
    .registry (dockerhub).
  • Response | None guards for _make_request(...).content/.text
    (cisco_umbrella, tranco, lolbas).

deprecated (5)

datetime.utcnow()datetime.now(timezone.utc) (abusech, abuseipdb,
azorult-tracker, misp).

Verification

  • Plugins job: 0 errors, 2 warnings (the intentional unused-ignore-comment)
  • Main typecheck job: unchanged (0/0)
  • ruff check . + ruff format . --check: clean
  • unittest schemas / apiv2 / core_tests: 186 / 197 / 29, all pass

Plugins ratchet complete 🎉

114 diagnostics at rollout → 0 real diagnostics. core, yetictl, and
plugins are all now type-checked; only the env-dependent
unused-ignore-comment remains at warn.

🤖 Generated with Claude Code

Final plugins ratchet batch; drops unresolved-attribute and deprecated from the
overrides. The [[tool.ty.overrides]] block now holds only unused-ignore-comment
(the two core boto3/tldextract import ignores, which are env-dependent).

unresolved-attribute (32):
- Event handlers (dockerhub, hostname_extract): `message.event` is a
  ObjectEvent | LinkEvent | TagEvent union and only ObjectEvent has
  `yeti_object`. Narrow with `assert isinstance(event, ObjectEvent)`, then cast
  yeti_object to the concrete observable (ContainerImage / Url).
- save()/find() return the base Observable/Entity through the connector, so
  plugins doing `x = SpecificType(...).save()` then `x.<subclass attr>` cast the
  result: abusech/botvrij/hybrid File.name/.size, malpedia Malware/IntrusionSet
  .aliases, wiz AttackPattern.kill_chain_phases, dockerhub ContainerImage.registry.
- Response | None guards for `_make_request(...).content/.text`
  (cisco_umbrella, tranco, lolbas).

deprecated (5): `datetime.utcnow()` -> `datetime.now(timezone.utc)` (abusech,
abuseipdb, azorult-tracker, misp).

Plugins job: 0 errors, 2 warnings (the intentional unused-ignore-comment).
Main job unchanged (0/0). ruff clean; tests 186/197/29.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant