Skip to content

[Google TI Feeds] fetch relationship entities directly from collections API#6316

Merged
jabesq merged 4 commits into
masterfrom
feat/6236_relationship_api
May 7, 2026
Merged

[Google TI Feeds] fetch relationship entities directly from collections API#6316
jabesq merged 4 commits into
masterfrom
feat/6236_relationship_api

Conversation

@jabesq
Copy link
Copy Markdown
Member

@jabesq jabesq commented Apr 29, 2026

Proposed changes

  • Refactored relationship retrieval to use direct collections endpoints (/collections/{entity_id}/{entity_type}) and return related entities directly instead of re-fetching details, reducing extra API calls and simplifying data flow.
  • Updated orchestrators (campaign, malware, report, threat_actor, vulnerability) to consume direct related-entity payloads while preserving attack-technique ID-only optimization.
  • Updated fixtures and assertions in orchestrator/config tests to match direct relationship payload behavior and improve stability.
  • Updated CONTRIBUTING.md to reference the renamed API method (fetch_subentities).
  • Added a follow-up style commit normalizing test file line endings to satisfy black in pre-commit.

Related issues

Checklist

  • I consider the submitted work as finished
  • I have signed my commits using GPG key.
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Comments

Prometheus metrics (from PR #6307),

Before changes:

# HELP google_ti_feeds_api_endpoint_calls_total Count of API calls made by GenericFetcher for each Google TI Feeds API endpoint
# TYPE google_ti_feeds_api_endpoint_calls_total counter
google_ti_feeds_api_endpoint_calls_total{endpoint="/collections"} 1.0
google_ti_feeds_api_endpoint_calls_total{endpoint="/collections/{entity_id}/relationships/{entity_type}"} 74.0
google_ti_feeds_api_endpoint_calls_total{endpoint="/collections/{entity_id}"} 112.0
google_ti_feeds_api_endpoint_calls_total{endpoint="/files/{entity_id}"} 22.0
google_ti_feeds_api_endpoint_calls_total{endpoint="/urls/{entity_id}"} 21.0

After:

python_info{implementation="CPython",major="3",minor="12",patchlevel="12",version="3.12.12"} 1.0
# HELP google_ti_feeds_api_endpoint_calls_total Count of API calls made by GenericFetcher for each Google TI Feeds API endpoint
# TYPE google_ti_feeds_api_endpoint_calls_total counter
google_ti_feeds_api_endpoint_calls_total{endpoint="/collections"} 1.0
google_ti_feeds_api_endpoint_calls_total{endpoint="/collections/{entity_id}/{entity_type}"} 74.0

@jabesq jabesq requested a review from Kakudou April 29, 2026 09:19
@github-actions github-actions Bot added the filigran team use to identify PR from the Filigran team label Apr 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 83.14607% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 14.33%. Comparing base (1504ad6) to head (63d22e5).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...nnector/src/custom/client_api/client_api_shared.py 68.75% 10 Missing ⚠️
.../google-ti-feeds/tests/custom/test_orchestrator.py 63.63% 4 Missing ⚠️
...-feeds/tests/octi/configs/test_connector_config.py 95.83% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (1504ad6) and HEAD (63d22e5). Click for more details.

HEAD has 93 uploads less than BASE
Flag BASE (1504ad6) HEAD (63d22e5)
connectors 95 2
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6316       +/-   ##
===========================================
- Coverage   40.60%   14.33%   -26.28%     
===========================================
  Files        2142     1705      -437     
  Lines      128325   108573    -19752     
===========================================
- Hits        52102    15560    -36542     
- Misses      76223    93013    +16790     
Flag Coverage Δ
baseline 0.00% <0.00%> (ø)
connectors 92.56% <83.14%> (+18.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@romain-filigran
Copy link
Copy Markdown
Member

Note: I would like to functionally validate this PR before merging it

Copy link
Copy Markdown
Member

@romain-filigran romain-filigran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good for me. Thank you @jabesq

@jabesq jabesq merged commit 168e2dd into master May 7, 2026
18 checks passed
@jabesq jabesq deleted the feat/6236_relationship_api branch May 7, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team use to identify PR from the Filigran team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Google TI] Reduce quota usage by resolving related entities

3 participants