Skip to content

refactor: Inject API client into AliasResolver instead of creating its own#985

Merged
vdusek merged 3 commits into
masterfrom
refactor/inject-alias-resolver-client
Jun 16, 2026
Merged

refactor: Inject API client into AliasResolver instead of creating its own#985
vdusek merged 3 commits into
masterfrom
refactor/inject-alias-resolver-client

Conversation

@vdusek

@vdusek vdusek commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

AliasResolver (and open_by_alias) no longer create their own ApifyClientAsync to read the alias mapping from the default key-value store. The API client already built for the storage operation is injected and reused, so alias resolution shares its HTTP client (connection pool and event-loop affinity) instead of spinning up — and leaking — a separate client on every call. This also removes the need for the process-global client cache that the review flagged.

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Jun 13, 2026
@vdusek vdusek self-assigned this Jun 13, 2026
@github-actions github-actions Bot added this to the 142nd sprint - Tooling team milestone Jun 13, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jun 13, 2026
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.44%. Comparing base (e8cda0a) to head (d7ce88e).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #985      +/-   ##
==========================================
+ Coverage   90.35%   90.44%   +0.08%     
==========================================
  Files          49       49              
  Lines        3089     3086       -3     
==========================================
  Hits         2791     2791              
+ Misses        298      295       -3     
Flag Coverage Δ
e2e 36.16% <14.28%> (-0.07%) ⬇️
integration 57.45% <50.00%> (-0.01%) ⬇️
unit 79.00% <100.00%> (+0.07%) ⬆️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek requested a review from Pijukatel June 16, 2026 08:46
@vdusek vdusek marked this pull request as ready for review June 16, 2026 08:46
vdusek added 2 commits June 16, 2026 10:49
…as-resolver-client

# Conflicts:
#	src/apify/storage_clients/_apify/_alias_resolving.py
Comment thread tests/unit/storage_clients/test_alias_resolver.py
@vdusek vdusek requested a review from Pijukatel June 16, 2026 10:07
@vdusek vdusek merged commit 19ab1b4 into master Jun 16, 2026
28 checks passed
@vdusek vdusek deleted the refactor/inject-alias-resolver-client branch June 16, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants