Skip to content

refactor(scripts): rework eco static-data refresh - #268

Merged
MVladislav merged 8 commits into
mainfrom
feature/eco-scripts-and-static-data-update
Aug 27, 2026
Merged

MVladislav merged 8 commits into
mainfrom
feature/eco-scripts-and-static-data-update

Conversation

@MVladislav

Copy link
Copy Markdown
Owner

What

Reworks the three Ecovacs static-data refresh scripts (renamed, see below),
adds a maintenance guide for the whole update flow and refreshes the bundled
static data under bumper/web/static_api/ with the new scripts.

Changed

update-eco-data.sh - device verification login flow

  • Ecovacs answers error 1013 for unverified device ids: the script now
    fetches the RSA public key, encrypts the account email, requests a
    verification code (sendEmailVerifyCode) and completes verifyDevice.
    Code is prompted or provided via ECO_VERIFY_CODE.
  • Device id persisted in .eco-device-id (overridable with ECO_DEVICE_ID /
    ECO_DEVICE_ID_FILE) — verification is only needed once.
  • requestId now md5 of current timestamp, matching the reference client
    implementation; hints added for the 0002 rate-limit error.

Combination step

  • Country priority DE > US > remaining; countries whose request failed are
    skipped instead of poisoning the result.
  • Recursive key normalization (custom jq walk), table-driven COMBINE_SPECS,
    committed files appended as fallback → deterministic output, stable diffs.

Codepush scripts parallelized

  • update-eco-codepush.sh: update_check fetches via xargs -P
    (ECO_PARALLEL, default 4), AWS signing params stripped from download URLs,
    output sorted by key.
  • update-eco-codepush-mapping.sh: parallel bundle downloads, valid sorted
    {main_folder: deployment_key} JSON copied to
    bumper/web/static_api/updateCheck_mapping.json; empty runs leave the
    committed file unchanged.

Robustness

  • Dependency checks (curl/jq/openssl/unzip), deterministic loop order.

Added

  • Docs: docs/development/static-data-update.md
    • what gets updated (files + the endpoints they serve, verified against the
      code), script order, usage incl. the verification flow, combination rules,
      env-variables table. Linked from dev-guide.md, added to the mkdocs nav.

Renamed

Old name New name
scripts/clean-domains.py scripts/cert-san-domains.py
scripts/eco-check-bot-version.sh scripts/check-eco-firmware.sh
scripts/create-unpinned-app-old.sh scripts/create-unpinned-app-legacy.sh
scripts/run-in-env.sh scripts/run-in-dev-env.sh
scripts/update-statics.sh scripts/update-web-assets.sh
scripts/eco-json-downloader.sh scripts/update-eco-data.sh
scripts/eco-update-check.sh scripts/update-eco-codepush.sh
scripts/eco-update-check-mapping.sh scripts/update-eco-codepush-mapping.sh

Data refresh

  • configGroupsResponse.json, configNetAllResponse.json, productIotMap.json
    • regenerated with update-eco-data.sh (country-priority combination, normalized key order).
  • updateCheck.json, updateCheck_mapping.json
    • regenerated with the codepush scripts (sorted keys, valid JSON).
  • bumper/web/static_web/js/htmx.min.js
    • refreshed via update-web-assets.sh.

Pure renames; update mypy/pylint hook and cert-doc references.
Handles Ecovacs error 1013 by verifying the device via RSA-encrypted email code (ECO_VERIFY_CODE, ECO_DEVICE_ID/FILE). Rewrites combination: DE > US > rest country priority, recursive key normalization, table-driven COMBINE_SPECS, stable diffs. Adds dependency checks, fixes EXIT-trap bug.
Parallel update_check fetches (ECO_PARALLEL), per-key fragment/status files, AWS signing params stripped from URLs, sorted output for deterministic diffs.
Old output was invalid JSON and crashed load_json_object_files. Parallel downloads, valid sorted {main_folder: deployment_key} JSON copied to bumper/web/static_api/, empty runs leave the committed file unchanged.
Covers the update scripts, usage incl. device verification, combination rules and env vars; linked from dev-guide, added to mkdocs nav.
Regenerated with update-eco-data.sh (country-priority combination, normalized key order).
Regenerated with the codepush scripts (sorted keys, valid JSON mapping).
Updated via update-web-assets.sh.
@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.34%. Comparing base (960e120) to head (0cb1a12).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #268   +/-   ##
=======================================
  Coverage   77.34%   77.34%           
=======================================
  Files          84       84           
  Lines        4683     4683           
  Branches      546      546           
=======================================
  Hits         3622     3622           
  Misses        876      876           
  Partials      185      185           

☔ 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.

@MVladislav
MVladislav merged commit 39033ec into main Aug 27, 2026
11 checks passed
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