skyl / corpora

Corpora is a self-building corpus that can help build other arbitrary corpora
GNU Affero General Public License v3.0
2 stars 0 forks source link

feat(sync): sync corpus to server from rust CLI #54

Closed skyl closed 4 days ago

skyl commented 4 days ago

PR Type

enhancement, dependencies


Description


Changes walkthrough ๐Ÿ“

Relevant files
Enhancement
sync.rs
Implement `sync` command for corpus synchronization           

rs/core/corpora_cli/src/commands/sync.rs
  • Implemented the sync command to synchronize local files with a remote
    server.
  • Added logic to compute file hashes and determine files to update, add,
    or delete.
  • Introduced error handling for file collection and server
    communication.
  • Added a function to calculate file hashes using SHA1.
  • +153/-2 
    git.rs
    Enhance tarball creation for selective file inclusion       

    rs/core/corpora_cli/src/context/collector/git.rs
  • Added method to create tarball for specified paths.
  • Refactored tarball creation logic to support selective file inclusion.
  • Removed commented-out code for collecting files.
  • +14/-26 
    mod.rs
    Update Collector trait for selective tarball creation       

    rs/core/corpora_cli/src/context/collector/mod.rs
  • Updated Collector trait to include method for creating tarball from
    specified paths.
  • Improved documentation for trait methods.
  • +19/-3   
    Dependencies
    Cargo.toml
    Add sha1 dependency for file hashing                                         

    rs/core/corpora_cli/Cargo.toml - Added `sha1` crate as a dependency for file hashing.
    +1/-0     

    ๐Ÿ’ก PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    skyl commented 4 days ago

    /help

    skyl commented 4 days ago

    /describe

    skyl commented 4 days ago

    /review

    github-actions[bot] commented 4 days ago

    PR Agent Walkthrough ๐Ÿค–

    Welcome to the PR Agent, an AI-powered tool for automated pull request analysis, feedback, suggestions and more.

    Here is a list of tools you can use to interact with the PR Agent:

    ToolDescriptionTrigger Interactively :gem:
    [DESCRIBE](https://pr-agent-docs.codium.ai/tools/describe/) Generates PR description - title, type, summary, code walkthrough and labels - [ ] Run
    [REVIEW](https://pr-agent-docs.codium.ai/tools/review/) Adjustable feedback about the PR, possible issues, security concerns, review effort and more - [ ] Run
    [IMPROVE](https://pr-agent-docs.codium.ai/tools/improve/) Code suggestions for improving the PR - [ ] Run
    [UPDATE CHANGELOG](https://pr-agent-docs.codium.ai/tools/update_changelog/) Automatically updates the changelog - [ ] Run
    [ADD DOCS](https://pr-agent-docs.codium.ai/tools/documentation/) ๐Ÿ’Ž Generates documentation to methods/functions/classes that changed in the PR - [ ] Run
    [TEST](https://pr-agent-docs.codium.ai/tools/test/) ๐Ÿ’Ž Generates unit tests for a specific component, based on the PR code change - [ ] Run
    [IMPROVE COMPONENT](https://pr-agent-docs.codium.ai/tools/improve_component/) ๐Ÿ’Ž Code suggestions for a specific component that changed in the PR - [ ] Run
    [ANALYZE](https://pr-agent-docs.codium.ai/tools/analyze/) ๐Ÿ’Ž Identifies code components that changed in the PR, and enables to interactively generate tests, docs, and code suggestions for each component - [ ] Run
    [ASK](https://pr-agent-docs.codium.ai/tools/ask/) Answering free-text questions about the PR [*]
    [GENERATE CUSTOM LABELS](https://pr-agent-docs.codium.ai/tools/custom_labels/) ๐Ÿ’Ž Generates custom labels for the PR, based on specific guidelines defined by the user [*]
    [CI FEEDBACK](https://pr-agent-docs.codium.ai/tools/ci_feedback/) ๐Ÿ’Ž Generates feedback and analysis for a failed CI job [*]
    [CUSTOM PROMPT](https://pr-agent-docs.codium.ai/tools/custom_prompt/) ๐Ÿ’Ž Generates custom suggestions for improving the PR code, derived only from a specific guidelines prompt defined by the user [*]
    [SIMILAR ISSUE](https://pr-agent-docs.codium.ai/tools/similar_issues/) Automatically retrieves and presents similar issues [*]

    (1) Note that each tool be triggered automatically when a new PR is opened, or called manually by commenting on a PR.

    (2) Tools marked with [*] require additional parameters to be passed. For example, to invoke the /ask tool, you need to comment on a PR: /ask "<question content>". See the relevant documentation for each tool for more details.

    github-actions[bot] commented 4 days ago

    PR Description updated to latest commit (https://github.com/skyl/corpora/commit/242aa4930f241308c96fdd4deb4f2a0948da5f0b)

    github-actions[bot] commented 4 days ago

    PR Reviewer Guide ๐Ÿ”

    Here are some key observations to aid the review process:

    โฑ๏ธ Estimated effort to review: 4 ๐Ÿ”ต๐Ÿ”ต๐Ÿ”ต๐Ÿ”ตโšช
    ๐Ÿงช No relevant tests
    ๐Ÿ”’ No security concerns identified
    โšก Recommended focus areas for review

    Error Handling
    The `get_file_hash` function returns `None` if an error occurs while reading a file. Consider logging the error for better traceability and debugging. Code Duplication
    The code for logging success and error messages is repeated multiple times. Consider refactoring to reduce duplication and improve maintainability.
    skyl commented 4 days ago

    /similar_issue