Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path sanitization hotfix #107

Merged
merged 3 commits into from
Aug 2, 2024
Merged

Path sanitization hotfix #107

merged 3 commits into from
Aug 2, 2024

Conversation

talmo
Copy link
Contributor

@talmo talmo commented Aug 2, 2024

Fixes root issue in #106: we need to manually replace \\ with / when on Linux, but Windows paths are stored, and running on a platform that doesn't support it (e.g., our networked NetApp).

Summary by CodeRabbit

  • Bug Fixes

    • Improved error handling in the video creation process to prevent crashes from invalid paths.
    • Standardized video path format for better compatibility across different operating systems.
  • Chores

    • Updated package version from 0.1.6 to 0.1.7, indicating new improvements and updates.
    • Enhanced dependency management by updating version constraints for critical libraries to ensure compatibility and stability.

Copy link
Contributor

coderabbitai bot commented Aug 2, 2024

Warning

Rate limit exceeded

@talmo has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 37 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between ff53ffb and d19b525.

Walkthrough

The recent updates focus on enhancing the make_video function by improving error handling for invalid video_path inputs and standardizing path formats for better cross-platform compatibility. The package version has been incremented from "0.1.6" to "0.1.7," indicating a new release that reflects various updates and enhancements made since the last version. Additionally, changes to dependency specifications in configuration files promote more robust and flexible management.

Changes

Files Change Summary
environment.yml Removed version constraints for ffmpeg and opencv; updated imageio-ffmpeg to >=0.5.0 and constrained numpy to <2.0.0. Maintained h5py >=3.8.0 requirement.
pyproject.toml Updated imageio-ffmpeg dependency to >=0.5.0 for better control.
sleap_io/io/slp.py Enhanced make_video function with error handling and path normalization.
sleap_io/version.py Incremented package version from "0.1.6" to "0.1.7."

Poem

In the code where the rabbits play,
Paths are neat, and bugs kept at bay.
With a hop and a skip, version's new,
A leap of improvements, just for you!
So here’s to the changes, let’s cheer and rejoice,
For every small fix, we celebrate with voice! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@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.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5b79a22 and bb025cf.

Files selected for processing (2)
  • sleap_io/io/slp.py (1 hunks)
  • sleap_io/version.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • sleap_io/version.py
Additional comments not posted (2)
sleap_io/io/slp.py (2)

68-68: Path normalization for cross-platform compatibility.

The line video_path = video_path.replace("\\", "/") ensures that paths are compatible across different operating systems. This is crucial for environments that do not support Windows-style paths.


70-70: Conversion to Path object.

Converting video_path to a Path object using Path(video_path) is a good practice for handling file paths in a platform-independent manner.

sleap_io/io/slp.py Show resolved Hide resolved
Copy link
Contributor

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bb025cf and ff53ffb.

Files selected for processing (2)
  • environment.yml (1 hunks)
  • pyproject.toml (1 hunks)
Additional comments not posted (6)
environment.yml (5)

8-8: Consider potential compatibility issues with ffmpeg.

Removing the version constraint for ffmpeg allows for greater flexibility but may introduce compatibility issues with other dependencies.

Ensure that the latest versions of ffmpeg are compatible with the rest of the dependencies.


10-10: LGTM!

Updating the version constraint for imageio-ffmpeg to require a minimum version of 0.5.0 ensures compatibility with newer features or fixes.


15-15: LGTM!

Retaining the minimum version requirement for h5py ensures that the environment uses a version that meets the necessary functionality.


17-17: LGTM!

Constraining numpy to versions below 2.0.0 may be necessary to maintain compatibility with other libraries.


18-18: Consider potential compatibility issues with opencv.

Removing the version constraint for opencv allows for greater flexibility but may introduce compatibility issues with other dependencies.

Ensure that the latest versions of opencv are compatible with the rest of the dependencies.

pyproject.toml (1)

31-31: LGTM!

Updating the version constraint for imageio-ffmpeg to require a minimum version of 0.5.0 ensures compatibility with newer features or fixes.

Copy link

codecov bot commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 96.01%. Comparing base (5b79a22) to head (d19b525).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
sleap_io/io/slp.py 66.66% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #107      +/-   ##
==========================================
- Coverage   96.11%   96.01%   -0.10%     
==========================================
  Files          17       17              
  Lines        2032     2035       +3     
==========================================
+ Hits         1953     1954       +1     
- Misses         79       81       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@talmo talmo merged commit e002927 into main Aug 2, 2024
7 of 8 checks passed
@talmo talmo deleted the talmo/slp-pathlib-hotfix branch August 2, 2024 01:39
@gitttt-1234 gitttt-1234 linked an issue Aug 7, 2024 that may be closed by this pull request
@lochhh lochhh mentioned this pull request Sep 10, 2024
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.

OSError: [Errno 22] Invalid argument when loading an SLP file
1 participant