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

Use diff in repository class #451

Closed
wants to merge 30 commits into from
Closed

Use diff in repository class #451

wants to merge 30 commits into from

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented May 20, 2021

Feel free to take a look at what is here but it is very rough (so that I could demo the approach in this #318 (comment)).

I am going to break bits off of this to make it easier to review.

diff has an added status as opposed to new so I switched across to use that.

I will add renamed into the dependent classes in a subsequent PR.

@mattseddon mattseddon added the product PR that affects product label May 20, 2021
@mattseddon mattseddon self-assigned this May 20, 2021
@mattseddon mattseddon marked this pull request as ready for review May 20, 2021 06:10
@mattseddon mattseddon marked this pull request as draft May 20, 2021 06:12
Base automatically changed from add-dvc-diff to master May 20, 2021 19:12
{ 'changed deps': { 'data/MNIST': 'modified' } },
{ 'changed outs': { 'model.pt': 'modified', logs: 'modified' } },
'always changed'
const mockDiff = stub(CliReader, 'diff').resolves({
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] This is straight dump from the CLI

>

export const status = (options: ExecutionOptions): Promise<Status> =>
readCliProcessJson<Status>(options, Command.STATUS)
Copy link
Member Author

Choose a reason for hiding this comment

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

[C] Dithered a bit on whether to remove this or not as "we'll need it later" but it doesn't have a test AND just follow YAGNI, it's in the commit history.

}
if (this.state.notInCache?.has(uri.fsPath)) {
return DecorationProvider.DecorationNotInCache
}
if (this.state.modified?.has(uri.fsPath)) {
return DecorationProvider.DecorationModified
}
if (this.state.stageModified?.has(uri.fsPath)) {
return DecorationProvider.DecorationStageModified
Copy link

Choose a reason for hiding this comment

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

Avoid too many return statements within this function.

@codeclimate
Copy link

codeclimate bot commented May 24, 2021

Code Climate has analyzed commit 7f374d2 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 98.6% (50% is the threshold).

This pull request will bring the total coverage in the repository to 88.1% (0.0% change).

View more on Code Climate.

@mattseddon
Copy link
Member Author

split this up into reviewable chunks

@mattseddon mattseddon closed this May 24, 2021
@mattseddon mattseddon deleted the switch-repo-to-diff branch May 24, 2021 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant