Skip to content

feat: add Anyone Protocol collector and fix CI worker manifest#77

Merged
GeiserX merged 2 commits into
mainfrom
feat/anyone-collector-and-ci-fix
May 24, 2026
Merged

feat: add Anyone Protocol collector and fix CI worker manifest#77
GeiserX merged 2 commits into
mainfrom
feat/anyone-collector-and-ci-fix

Conversation

@GeiserX
Copy link
Copy Markdown
Owner

@GeiserX GeiserX commented May 23, 2026

Summary

  • Add AnyoneCollector that queries the AO relay-rewards smart contract (relay-rewards.lua) by relay fingerprint, converts ANYONE tokens to USD via CoinGecko
  • Fix build.yml manifest step: only creates multi-arch manifests when the corresponding arch-specific builds actually succeeded (was trying to create worker manifests from non-existent arch tags when worker builds were skipped)
  • Register anyone-protocol in collector registry with fingerprints credential

Details

Anyone Protocol Collector:

  • Queries AO Compute Unit at cu.anyone.tech with Get-Rewards action by fingerprint
  • Converts raw token amounts (18 decimals) to ANYONE tokens
  • Fetches USD price from CoinGecko (airtor-protocol)
  • Falls back to reporting in ANYONE if price unavailable
  • Note: Anyone's AO infrastructure is currently returning scheduler errors — collector will work once their infra stabilizes

CI Fix:

  • Added needs.build-worker-amd64.result == 'success' guards to manifest creation steps
  • Prevents manifest unknown errors when only UI is rebuilt

Test plan

  • 885 tests pass (5 new Anyone collector tests)
  • Lint + format clean
  • CI passes on this PR
  • After merge, verify worker manifest isn't attempted on UI-only releases
  • Once Anyone AO infra is stable, configure fingerprints and verify earnings show

Summary by CodeRabbit

  • New Features
    • Added support for Anyone Protocol earnings collection: enter relay fingerprints to fetch relay rewards and convert ANYONE tokens to USD.
  • Configuration
    • Connector now accepts a fingerprints credential to enable automatic relay-rewards queries.
  • Tests
    • Added deep tests covering success, multiple fingerprints, error handling, missing fingerprints, and missing price scenarios.
  • Chores
    • CI manifest creation now waits for multi-arch image builds to complete before running.

Review Change Stack

- Add AnyoneCollector that queries AO relay-rewards contract by
  fingerprint and converts ANYONE tokens to USD via CoinGecko
- Fix build.yml manifest step: only create multi-arch manifests when
  the corresponding arch-specific builds actually succeeded
- Register anyone-protocol in collector map with fingerprints credential
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 77cafb5e-676a-4184-acb1-987dd589daf4

📥 Commits

Reviewing files that changed from the base of the PR and between 8bb0485 and 2e08fd6.

📒 Files selected for processing (1)
  • app/collectors/anyone.py

📝 Walkthrough

Walkthrough

Adds an Anyone Protocol collector that queries AO CU dry-run endpoints per fingerprint, converts ANYONE tokens to USD via CoinGecko, registers the collector, updates the service manifest to use an auto collector with fingerprint credentials, and adds deep tests and CI manifest guards.

Changes

CI Build Manifest Dependencies

Layer / File(s) Summary
Manifest step job dependencies
.github/workflows/build.yml
UI and worker manifest creation steps now require both amd64 and arm64 builds to complete successfully in addition to their feature flags.

Anyone Protocol Collector

Layer / File(s) Summary
Core collector implementation
app/collectors/anyone.py
Adds module constants, async helpers for AO CU dry-run reward queries, token-unit→decimal conversion, price lookup from CoinGecko, and collect() that sums rewards across fingerprints with explicit fallback/error variants.
Collector registration and factory wiring
app/collectors/__init__.py
Imports AnyoneCollector, registers "anyone-protocol" in COLLECTOR_MAP, and adds fingerprints to _COLLECTOR_ARGS for factory instantiation.
Service configuration and validation tests
services/depin/anyone-protocol.yml, tests/test_collectors_deep.py
Changes service connector to type: auto with fingerprints credential input and adds TestAnyoneProtocolDeep suite (5 tests) covering success, missing fingerprints, AO errors, multi-fingerprint handling, and no-price fallback.

🎯 2 (Simple) | ⏱️ ~12 minutes

  • GeiserX/CashPilot#77: Adds the same Anyone Protocol collector end-to-end (implementation, registry entry, service config, tests, and CI manifest guards).
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes both main changes: adding AnyoneCollector and fixing the CI manifest step.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/anyone-collector-and-ci-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

❌ Patch coverage is 92.98246% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.00%. Comparing base (1feb390) to head (2e08fd6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/collectors/anyone.py 92.85% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #77      +/-   ##
==========================================
+ Coverage   90.96%   91.00%   +0.04%     
==========================================
  Files          25       26       +1     
  Lines        2755     2812      +57     
==========================================
+ Hits         2506     2559      +53     
- Misses        249      253       +4     
Files with missing lines Coverage Δ
app/collectors/__init__.py 79.74% <100.00%> (+0.25%) ⬆️
app/collectors/anyone.py 92.85% <92.85%> (ø)
🚀 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/collectors/anyone.py (1)

98-110: ⚡ Quick win

Add retry wrapper for reward/price calls inside collect().

These awaits fail the whole run on the first transient network error. Wrap them with BaseCollector._retry(...) to harden collection without changing output semantics.

Proposed diff
             for fp in self.fingerprints:
-                tokens = await self._get_rewards_for_fingerprint(client, fp)
+                tokens = await self._retry(
+                    lambda fp=fp: self._get_rewards_for_fingerprint(client, fp)
+                )
                 total_tokens += tokens
                 logger.debug("Fingerprint %s: %.6f ANYONE", fp, tokens)
@@
-            price = await self._get_token_price(client)
+            price = await self._retry(lambda: self._get_token_price(client))

As per coding guidelines, app/**: Check for proper error handling and logging.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/collectors/anyone.py` around lines 98 - 110, The collect() loop currently
awaits self._get_rewards_for_fingerprint(...) and self._get_token_price(...)
directly which allows transient network errors to abort the run; wrap both calls
with the class retry helper BaseCollector._retry so they are retried on
transient failures (i.e., call await self._retry(lambda:
self._get_rewards_for_fingerprint(client, fp)) within the for fp in
self.fingerprints loop and await self._retry(lambda:
self._get_token_price(client)) before using price), preserving return types and
existing logging/behavior when retries ultimately fail.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@app/collectors/anyone.py`:
- Around line 98-110: The collect() loop currently awaits
self._get_rewards_for_fingerprint(...) and self._get_token_price(...) directly
which allows transient network errors to abort the run; wrap both calls with the
class retry helper BaseCollector._retry so they are retried on transient
failures (i.e., call await self._retry(lambda:
self._get_rewards_for_fingerprint(client, fp)) within the for fp in
self.fingerprints loop and await self._retry(lambda:
self._get_token_price(client)) before using price), preserving return types and
existing logging/behavior when retries ultimately fail.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6da040e9-3acc-4588-b756-52c86a97f70a

📥 Commits

Reviewing files that changed from the base of the PR and between 1feb390 and 8bb0485.

📒 Files selected for processing (5)
  • .github/workflows/build.yml
  • app/collectors/__init__.py
  • app/collectors/anyone.py
  • services/depin/anyone-protocol.yml
  • tests/test_collectors_deep.py

@GeiserX GeiserX merged commit 78c894e into main May 24, 2026
4 of 5 checks passed
@GeiserX GeiserX deleted the feat/anyone-collector-and-ci-fix branch May 24, 2026 10:43
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