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

feat(api): add lfs metadata #8

Merged
merged 9 commits into from
Aug 2, 2023
Merged

feat(api): add lfs metadata #8

merged 9 commits into from
Aug 2, 2023

Conversation

McPatate
Copy link
Member

Full lfs object looks like this :

"lfs": {
    "sha256": "5b1da7ebe3bdcc58c91eb9916f7d881791ac2659307f0c383c325361382f2f42",
    "size": 2239866697,
    "pointerSize": 135
}

Needed for the repo scanner

@McPatate McPatate requested a review from Narsil July 31, 2023 14:46
@Narsil
Copy link
Collaborator

Narsil commented Jul 31, 2023

Can we add a test for it ? (Also so I can have a look at what models return that could be interesting in other places to get file sizes without Range:0-0.

Copy link
Collaborator

@Narsil Narsil left a comment

Choose a reason for hiding this comment

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

Quite nice.

I propose a different (simpler imho) internals.

Otherwise looks good. Not sure how cargo fmt didn't pick up those before.

src/api/sync.rs Outdated Show resolved Hide resolved
src/api/sync.rs Outdated Show resolved Hide resolved
src/api/sync.rs Outdated

/// serde_json error
#[error("Serde json error: {0}")]
SerdeJson(#[from] serde_json::Error),
Copy link
Collaborator

Choose a reason for hiding this comment

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

How were we getting away without it before, is it the map(Box?) ?

Copy link
Member Author

@McPatate McPatate Aug 1, 2023

Choose a reason for hiding this comment

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

Response::into_json returns an io::Result<T> while serde_json::from_value returns a Result<T, serde_json::Error>

Copy link
Member Author

Choose a reason for hiding this comment

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

And reqwest::Response::json returns a Result<T, reqwest::Error>

src/api/tokio.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@Narsil Narsil left a comment

Choose a reason for hiding this comment

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

LGTM

@Narsil Narsil merged commit a13a818 into main Aug 2, 2023
3 checks passed
@McPatate McPatate deleted the feat/add_lfs_meta branch August 2, 2023 15:12
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.

2 participants