refactor: rename WasmBuildable::repo_url to source_dir#445
refactor: rename WasmBuildable::repo_url to source_dir#445henrypark133 merged 2 commits intonearai:mainfrom
Conversation
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>
Summary of ChangesHello, 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 Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
* 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>
Summary
Renames
WasmBuildable::repo_urltosource_dirto accurately reflect that the field holds a local directory path (e.g.,"tools-src/gmail"), not a URL.Closes #329
Changes
repo_url->source_dironExtensionSource::WasmBuildable#[serde(alias = "repo_url")]for backwards compatibility with any previously serialized dataFiles changed
src/extensions/mod.rssrc/extensions/discovery.rssrc/extensions/manager.rssrc/extensions/registry.rssrc/registry/manifest.rsTest plan
cargo clippy --all --benches --tests --examples --all-features-- zero warningscargo test --all-features registry-- 108 passedcargo test --all-features manager-- 60 passedcargo test --all-features manifest-- 8 passedcargo check --no-default-features --features libsql-- cleanGenerated with Claude Code