Skip to content

feat: migrate all scripts to plugins and tomte CLI#2470

Open
DhairyaPatel7 wants to merge 8 commits intomainfrom
feat/scripts-to-plugins-and-tomte
Open

feat: migrate all scripts to plugins and tomte CLI#2470
DhairyaPatel7 wants to merge 8 commits intomainfrom
feat/scripts-to-plugins-and-tomte

Conversation

@DhairyaPatel7
Copy link
Copy Markdown
Collaborator

Summary

Replaces all 8 Python scripts from scripts/ with tomte CLI commands and plugin commands. After this PR, scripts/ contains only data files (whitelist.py), git hooks, and docs.

Tomte (0.6.5)

  • check_copyright.pytomte check-copyright --author "Valory AG"
  • check_doc_links.pytomte check-doc-links (with URL skip flags)
  • freeze_dependencies.pytomte freeze-dependencies --exclude-package open-autonomy

aea-ci-helpers (open-aea >= 2.2.0)

  • generate_package_list.pyaea-ci generate-pkg-list
  • check_ipfs_hashes_pushed.pyaea-ci check-ipfs-pushed

aea-helpers (OA plugin)

  • check_third_party_hashes.pyaea-helpers check-third-party-hashes
  • generate_contract_list.pyaea-helpers generate-contract-list
  • generate_api_documentation.pyaea-helpers generate-api-docs (OA-specific, scans autonomy/ not aea/)

Other changes

  • Bump all tomte pins from 0.6.1 to 0.6.5
  • Fix pre-existing copyright end years
  • Regenerate API docs for new aea-helpers modules
  • Add pip to tox deps where tomte freeze-dependencies needs it

Scripts remaining

whitelist.py, pre-add, pre-push, RELEASE_PROCESS.md, __init__.py

Test plan

  • tox -e check-copyright — OK
  • tox -e black-check — OK
  • tox -e isort-check — OK
  • tox -e flake8 — OK
  • tox -e check-api-docs — OK
  • tox -e liccheck — OK
  • Full CI workflow

🤖 Generated with Claude Code

DhairyaPatel7 and others added 4 commits April 13, 2026 17:07
Replace all 8 Python scripts from scripts/ with tomte CLI commands
and plugin commands:

Tomte (0.6.5):
- check_copyright.py → tomte check-copyright --author "Valory AG"
- check_doc_links.py → tomte check-doc-links (with URL skip flags)
- freeze_dependencies.py → tomte freeze-dependencies --exclude-package open-autonomy

aea-ci-helpers (requires open-aea >= 2.2.0):
- generate_api_documentation.py → aea-ci generate-api-docs
- generate_package_list.py → aea-ci generate-pkg-list
- check_ipfs_hashes_pushed.py → aea-ci check-ipfs-pushed

aea-helpers (OA-specific):
- check_third_party_hashes.py → aea-helpers check-third-party-hashes
- generate_contract_list.py → aea-helpers generate-contract-list

Also:
- Bump all tomte pins from 0.6.1 to 0.6.5 (tox.ini, pyproject.toml, workflow)
- Fix pre-existing copyright end years
- Remaining in scripts/: whitelist.py, git hooks, RELEASE_PROCESS.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The aea-ci generate-api-docs command is designed for open-aea's repo
structure (scans aea/), not OA's (scans autonomy/). Moved OA's
generate_api_documentation.py to aea-helpers plugin instead.

Also regenerated API docs for new aea-helpers modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change PyPI package name from "aea-helpers" to "open-aea-helpers"
for naming consistency with open-aea-ci-helpers and open-aea-dev-helpers.

The CLI entry point stays "aea-helpers" (console_scripts unchanged).
The Python import name stays "aea_helpers" (no code changes needed).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.56%. Comparing base (6d66479) to head (95d7549).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2470   +/-   ##
=======================================
  Coverage   92.55%   92.56%           
=======================================
  Files         243      243           
  Lines       17259    17261    +2     
=======================================
+ Hits        15974    15977    +3     
+ Misses       1285     1284    -1     
Flag Coverage Δ
unittests 92.56% <ø> (+<0.01%) ⬆️

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DhairyaPatel7 DhairyaPatel7 marked this pull request as ready for review April 14, 2026 12:30
@LOCKhart07 LOCKhart07 self-requested a review April 14, 2026 12:32
OjusWiZard
OjusWiZard previously approved these changes Apr 14, 2026
tox.ini Outdated
deps =
{[deps-packages]deps}
; requires open-aea-ci-helpers >= 2.2.0
open-aea-ci-helpers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

would be good to pin them, so that we don't surprise ourselves in the future.

tox.ini Outdated
aea init --reset --author ci --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https"
aea packages sync
{toxinidir}/scripts/check_doc_links.py
tomte check-doc-links -n "http://pmg.csail.mit.edu/papers/osdi99.pdf" -u "https://github.com/valory-xyz/open-operator" -u "https://gateway.autonolas.tech/ipfs/<hash>"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Blocking. This drops 3 URL skips that the deleted scripts/check_doc_links.py had, and they all still appear in current docs:

  • http://host.docker.internal:8545docs/guides/define_service.md, docs/configure_service/configure_access_external_chains.md, docs/configure_service/service_configuration_file.md, docs/advanced_reference/developer_tooling/debugging_in_the_cluster.md
  • http://www.fipa.org/repository/ips.php3docs/key_concepts/abci_app_async_behaviour.md
  • https://github.com/valory-xyz/open-autonomy/trunk/infrastructuredocs/using_stack_deployment.md, docs/application_deployment.md

tox -e check-doc-links-hashes is also missing from the PR test plan, so this likely wasn't exercised. Add the missing entries (-n for HTTP-allowlist, -u for status-code skips) before merge.

commands = {toxinidir}/scripts/check_copyright.py --check
allowlist_externals = {toxinidir}/scripts/check_copyright.py
tomte[cli]==0.6.5
commands = tomte check-copyright --author "Valory AG" --scan-path autonomy --scan-path tests --scan-path packages/valory/agents --scan-path packages/valory/connections/abci --scan-path packages/valory/contracts --scan-path packages/valory/skills --scan-path scripts --scan-path plugins -e protocols -e dummy_packages
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Non-blocking. The deleted scripts/check_copyright.py excluded _pb2.py, _pb2_grpc.py, build/, t_protocol/, t_protocol_no_ct/. The new invocation only excludes protocols and dummy_packages, but generated _pb2.py files exist outside packages/valory/protocols/ (e.g. packages/valory/connections/abci/gogoproto/gogo_pb2.py, which has no Valory header). This only passes if tomte's check-copyright auto-skips generated files — worth confirming explicitly, otherwise add the exclusions.

@click.command(name="check-third-party-hashes")
def check_third_party_hashes() -> None:
"""Check that third-party package hashes match the open-aea repository."""
root_dir = Path.cwd()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Non-blocking. Hardcoding Path.cwd() as root_dir makes the contract implicit — the command silently does the wrong thing if invoked from outside the OA repo root. Expose it as a click option (--root-dir, default .) so the dependency on cwd is documented.


setup(
name="aea-helpers",
name="open-aea-helpers",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Non-blocking but worth calling out in the PR body / release notes: open-aea-helpers is not yet on PyPI (verified — pip index versions open-aea-helpers returns no matches), so the next release will be the first publish under the new name. Anyone with aea-helpers pinned externally will break, and the old PyPI name becomes orphaned (typosquat surface). Confirm someone will claim/reserve it.

Version bumps:
- open-aea[all], open-aea-cli-ipfs, open-aea-ledger-ethereum,
  open-aea-ledger-ethereum-hwi, open-aea-ledger-cosmos,
  open-aea-ledger-solana: 2.1.0 → 2.2.0 (tox.ini, pyproject.toml,
  setup.py, aea-test-autonomy/setup.py)
- open-aea-ci-helpers: pinned to ==2.2.0
- Python range: ^3.10 → >=3.10,<3.15 (matches open-aea plugins)
- Regenerated poetry.lock

Review fixes:
- Add missing URL skips for check-doc-links: host.docker.internal,
  fipa.org, open-autonomy/trunk/infrastructure (LOCKhart07 blocking)
- Add --root-dir option to check-third-party-hashes (LOCKhart07)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- check-api-docs/generate-api-documentation: install aea-helpers via
  --no-deps in commands to avoid circular dep resolution (aea-helpers
  depends on open-autonomy from PyPI which pins open-aea==2.1.0)
- Regenerate API docs for check_third_party_hashes (--root-dir added)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
import sys
from pathlib import Path

import click
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why isn't this in open-aea? You can imagine agents building purely on open-aea wanting this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This script checks third-party packages against the open-aea repo's hashes. We put it in OA's aea-helpers initially, but any downstream repo building on open-aea would want the same check. Should I migrate it to open-aea-ci-helpers?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes please - migrate there and re-release for use here

@@ -24,7 +24,10 @@
from aea_helpers.check_binary import check_binary
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So we're extending aea-helpers?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes — aea-helpers already existed in OA with commands like run-agent, run-service, make-release, config-replace, check-binary, etc. We added 3 commands that were previously in scripts/: check-third-party-hashes, generate-contract-list, and generate-api-docs. The first two are arguably OA-specific (contract list generation, third-party hash checking against open-aea). The API doc generator is OA-specific because it scans autonomy/ rather than aea/ — but per your other comment, that could be made configurable upstream instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

third-party hash checking should be generic against any upstream repo (or list of repos)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's make api thing configurable upstream so we don't need to maintain two versions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

generate contract list can stay here. but what is it's purpose?

)
arguments = parser.parse_args()

def main(check_clean: bool = False) -> None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why wasn't this backported to open-aea?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The open-aea aea-ci generate-api-docs command is hardcoded to scan aea/ and plugins/ with open-aea's directory structure. OA's version scans autonomy/ and packages/valory/. We couldn't reuse the open-aea version as-is, so we kept OA's version in aea-helpers.

The right fix would be to make aea-ci generate-api-docs configurable (e.g. --source-dir, --packages-dir flags) so both repos can use the same command. Should I create a follow-up PR on open-aea for this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes


setup(
name="aea-helpers",
name="open-aea-helpers",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why aea-helpers in autonomy?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The other OA plugin follows the same pattern: open-aea-test-autonomy — also an open-aea-* name living in the OA repo. We're renaming this one from aea-helpers to open-aea-helpers on PyPI in this PR to match that convention. The commands it provides (run-agent, run-service, make-release, config-replace, check-binary) are OA-specific and depend on autonomy.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok

@@ -7,15 +7,15 @@ license = "Apache-2.0 license"
packages = [{include = "autonomy"}, {include = "packages"}]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why are open-aea-ci-helpers and open-aea-dev-helpers not used here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

They're not runtime dependencies of open-autonomy — they're CI/dev tools. They're declared in tox.ini as deps for the specific tox envs that need them (e.g. open-aea-ci-helpers==2.2.0 in check-doc-links-hashes). Adding them to pyproject.toml would make them install-time dependencies for every user of open-autonomy, which isn't right since most users don't need CI tooling.

Should we add them under [tool.poetry.group.dev.dependencies] instead so they're available during development but not for end users?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes dev dependencies

LOCKhart07
LOCKhart07 previously approved these changes Apr 14, 2026
Copy link
Copy Markdown
Member

@LOCKhart07 LOCKhart07 left a comment

Choose a reason for hiding this comment

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

Re-reviewed commits aebd768 and eff13d0b since my previous review.

Prior items — resolved:

  • Missing URL skips (host.docker.internal, fipa.org, open-autonomy/trunk/infrastructure) added to check-doc-links-hashes (blocker).
  • --root-dir click option added to check-third-party-hashes.
  • open-aea-ci-helpers now pinned to ==2.2.0.

Minor, non-blocking polish (optional):

  • tox.ini check-third-party-hashes still installs aea-helpers via deps = {toxinidir}/plugins/aea-helpers, while the other new envs (check-api-docs, generate-api-documentation, check-doc-links-hashes, lock-packages) switched to python -m pip install --no-deps ... in commands to avoid the circular open-autonomy resolution. Lower risk here because this env omits {[deps-packages]deps}, but aligning for consistency would be nice.
  • http://host.docker.internal:8545 appears in both -n and -u for tomte check-doc-links — intentional (non-HTTPS skip + unreachable status skip), just worth noting so it isn't "simplified" later.
  • Still outstanding from prior pass (non-blocking): generated _pb2.py files outside packages/valory/protocols/ and the open-aea-helpers PyPI name reservation.

LGTM.

DhairyaPatel7 and others added 2 commits April 14, 2026 20:18
open-aea-cli-ipfs 2.2.0 replaced the underlying ipfshttpclient.Client
with an in-tree IPFSHTTPClient that does not expose add_str. Switch to
add_bytes which provides equivalent behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Matches the other new tox envs (check-api-docs, generate-api-documentation,
check-doc-links-hashes, lock-packages) which install aea-helpers via
`python -m pip install --no-deps` in commands to avoid pulling the PyPI
open-autonomy via aea-helpers' install_requires.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@DhairyaPatel7
Copy link
Copy Markdown
Collaborator Author

Thanks @LOCKhart07. Aligned check-third-party-hashes with the other new envs in 26d57a6 — now uses pip install --no-deps in commands for consistency.

Leaving the host.docker.internal:8545 entries in both -n and -u as-is per your note (intentional: non-HTTPS skip + unreachable status skip).

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.

4 participants