Skip to content

refactor: Clean up dead code, typos, and storage-client internals#981

Closed
vdusek wants to merge 1 commit into
masterfrom
refactor/cleanup
Closed

refactor: Clean up dead code, typos, and storage-client internals#981
vdusek wants to merge 1 commit into
masterfrom
refactor/cleanup

Conversation

@vdusek

@vdusek vdusek commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

A round of cleanup ahead of the major release.

Dead code

Removed _was_final_persist_state_emitted, is_url(), maybe_extract_enum_member_value(), EXIT_CODE_SUCCESS, a no-op except Exception: raise in _crypto.py, the pre-impit hpack/httpcore Scrapy loggers, and a discarded get() call in the alias resolver (plus the now-orphaned tests).

Env-var enums

Added the four vars Configuration reads but Actor.get_env() was silently omitting: ACTOR_STORAGES_JSON, ACTOR_TEST_PAY_PER_EVENT, APIFY_ACTOR_PRICING_INFO, APIFY_CHARGED_ACTOR_EVENT_COUNTS.

Packaging

Dropped the 8 redundant nested py.typed files (the top-level one covers the whole package per PEP 561), added the Typing :: Typed classifier, and removed the stale apify-shared entry from [tool.uv.exclude-newer-package].

Docstrings / typos

Fixed prisingpricing, MIIGRATINGMIGRATING, the nonexistent content_type in call_task, the "in seconds" on timedelta-typed timeout args, the concatenated web_server_port description, the stale "except in Pytest" claim, the stale _AliasResolver references, and the mkdocs cross-refs in events/_types.py.

Storage-client internals

  • Added @docs_group to FileSystemStorageClient and a docstring/@docs_group to ApifyRequestQueueMetadata so both render in the API reference.
  • AliasResolver now reuses a cached ApifyClientAsync per (token, api_url) instead of creating an unclosed one on every call.
  • Renamed hash_api_base_url_and_tokenhash_api_public_base_url_and_token to match what it actually hashes.
  • Shared request-queue fetch_next_request no longer re-fetches a request it already hydrated.
  • push_data([]) returns early instead of POSTing [].
  • Documented in the v4 upgrading guide that cloud storage clients raise NotImplementedError on purge() (use drop()).

Major-release cleanup: remove dead code and stale references, fix docstring/typo
and packaging issues, expose the missing env vars via Actor.get_env(), and tidy
storage-client internals (reuse the alias-resolver API client, drop a redundant
request fetch, and skip empty push_data POSTs).
@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 12, 2026
@vdusek vdusek self-assigned this Jun 12, 2026
@github-actions github-actions Bot added this to the 142nd sprint - Tooling team milestone Jun 12, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jun 12, 2026
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.56522% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.69%. Comparing base (0daca28) to head (9c3fab5).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...c/apify/storage_clients/_apify/_alias_resolving.py 50.00% 5 Missing ⚠️
...rc/apify/storage_clients/_apify/_dataset_client.py 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (0daca28) and HEAD (9c3fab5). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (0daca28) HEAD (9c3fab5)
integration 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #981       +/-   ##
===========================================
- Coverage   89.90%   78.69%   -11.21%     
===========================================
  Files          49       49               
  Lines        3091     3075       -16     
===========================================
- Hits         2779     2420      -359     
- Misses        312      655      +343     
Flag Coverage Δ
e2e 36.16% <60.86%> (+0.25%) ⬆️
integration ?
unit 78.69% <69.56%> (-0.05%) ⬇️

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 closed this Jun 12, 2026
@vdusek vdusek deleted the refactor/cleanup branch June 12, 2026 15:44
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.

2 participants