Skip to content

refactor: rename WasmBuildable::repo_url to source_dir#445

Merged
henrypark133 merged 2 commits intonearai:mainfrom
zmanian:fix/rename-repo-url-to-source-dir
Mar 2, 2026
Merged

refactor: rename WasmBuildable::repo_url to source_dir#445
henrypark133 merged 2 commits intonearai:mainfrom
zmanian:fix/rename-repo-url-to-source-dir

Conversation

@zmanian
Copy link
Copy Markdown
Collaborator

@zmanian zmanian commented Mar 1, 2026

Summary

Renames WasmBuildable::repo_url to source_dir to accurately reflect that the field holds a local directory path (e.g., "tools-src/gmail"), not a URL.

Closes #329

Changes

  • Rename field repo_url -> source_dir on ExtensionSource::WasmBuildable
  • Update doc comment from "Build from source repository" to "Build from local source directory"
  • Add #[serde(alias = "repo_url")] for backwards compatibility with any previously serialized data
  • Update all 13 references across 5 files

Files changed

File Change
src/extensions/mod.rs Field definition + serde alias
src/extensions/discovery.rs Pattern match binding
src/extensions/manager.rs Test struct construction
src/extensions/registry.rs 10 test struct constructions
src/registry/manifest.rs Struct construction

Test plan

  • cargo clippy --all --benches --tests --examples --all-features -- zero warnings
  • cargo test --all-features registry -- 108 passed
  • cargo test --all-features manager -- 60 passed
  • cargo test --all-features manifest -- 8 passed
  • cargo check --no-default-features --features libsql -- clean

Generated with Claude Code

The field receives a local directory path (e.g. "tools-src/gmail"), not a
URL. Rename to source_dir to accurately reflect its purpose.

Adds #[serde(alias = "repo_url")] for backwards compatibility with any
previously serialized data.

Closes nearai#329

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added scope: extensions Extension management size: S 10-49 changed lines labels Mar 1, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the ExtensionSource::WasmBuildable enum by renaming a key field. The change clarifies the field's intent, ensuring it accurately represents a local source directory rather than a repository URL. This improves code readability and maintainability while preserving compatibility with existing data through a Serde alias.

Highlights

  • Field Renaming: The repo_url field within the ExtensionSource::WasmBuildable enum has been renamed to source_dir to more accurately reflect its purpose of holding a local directory path.
  • Backward Compatibility: A #[serde(alias = "repo_url")] attribute was added to the new source_dir field to ensure backward compatibility with existing serialized data that might still use the old field name.
  • Documentation Update: The doc comment for WasmBuildable was updated from "Build from source repository" to "Build from local source directory" to align with the field's new name and meaning.
  • Codebase Updates: All 13 references to the repo_url field across 5 different files have been updated to use the new source_dir name.
Changelog
  • src/extensions/discovery.rs
    • Updated the field name in the pattern match for ExtensionSource::WasmBuildable within the extract_url function.
  • src/extensions/manager.rs
    • Modified the make_fallback_source test helper to use source_dir instead of repo_url when constructing ExtensionSource::WasmBuildable.
  • src/extensions/mod.rs
    • Renamed the repo_url field to source_dir in the ExtensionSource::WasmBuildable enum.
    • Added #[serde(alias = "repo_url")] to source_dir for deserialization compatibility.
    • Updated the doc comment for WasmBuildable to reflect building from a local source directory.
  • src/extensions/registry.rs
    • Updated repo_url to source_dir in ten different test cases constructing ExtensionSource::WasmBuildable instances.
  • src/registry/manifest.rs
    • Changed repo_url to source_dir when creating an ExtensionSource::WasmBuildable in the to_registry_entry method.
Activity
  • No human activity (comments, reviews) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added risk: medium Business logic, config, or moderate-risk modules contributor: core 20+ merged PRs labels Mar 1, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a good refactoring that renames WasmBuildable::repo_url to source_dir to more accurately reflect its purpose of holding a local directory path. The change is applied consistently across all relevant files, and backward compatibility for deserialization is maintained using #[serde(alias = "repo_url")]. I have one suggestion to improve clarity further.

ExtensionSource::Discovered { url } => url.clone(),
ExtensionSource::WasmDownload { wasm_url, .. } => wasm_url.clone(),
ExtensionSource::WasmBuildable { repo_url, .. } => repo_url.clone(),
ExtensionSource::WasmBuildable { source_dir, .. } => source_dir.clone(),
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.

medium

This change highlights that the enclosing function extract_url is now misnamed, as it can return a local directory path (source_dir) which is not a URL. This could be confusing for future maintenance. Consider renaming extract_url to something more generic like extract_source_identifier to accurately reflect that it can return either a URL or a path. This could be done in a follow-up PR.

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.

Fixed -- renamed to extract_source in the same PR since the rename is small and directly related to the refactor.

The function can return a local directory path, not just a URL.
Addresses review feedback on PR nearai#445.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@henrypark133 henrypark133 merged commit a21dba0 into nearai:main Mar 2, 2026
13 checks passed
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
* refactor: rename WasmBuildable::repo_url to source_dir

The field receives a local directory path (e.g. "tools-src/gmail"), not a
URL. Rename to source_dir to accurately reflect its purpose.

Adds #[serde(alias = "repo_url")] for backwards compatibility with any
previously serialized data.

Closes nearai#329

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: rename extract_url to extract_source

The function can return a local directory path, not just a URL.
Addresses review feedback on PR nearai#445.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs risk: medium Business logic, config, or moderate-risk modules scope: extensions Extension management size: S 10-49 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename WasmBuildable::repo_url to source_dir

2 participants