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

Add file system watcher for dvc.yaml #1282

Merged
merged 1 commit into from
Feb 3, 2022
Merged

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Feb 3, 2022

2/3 master <- #1281 <- this <- #1284

This PR adds the file system watcher that will watch dvc.yaml files for updates and then load them and send them through the Experiments class to the CheckpointsModel. For now I plan to have one FileSystemData per Experiments class but if more than more class (e.g plots) ends up needing these event I'll pull it out and use a similar pattern to the one we do to instantiate Plots and Experiments.

@mattseddon mattseddon self-assigned this Feb 3, 2022
@mattseddon mattseddon changed the base branch from master to add-has-checkpoint February 3, 2022 04:21
@mattseddon mattseddon force-pushed the add-file-system-data branch from a13732a to e8af2a2 Compare February 3, 2022 04:27

export const loadYaml = <T>(path: string): T | undefined => {
try {
return load(readFileSync(path, 'utf-8')) as T
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] Don't want everything to fall over if the file is corrupted.

}

private async initialize() {
const files = await findFiles(join('**', 'dvc.yaml'))
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] We have to find all of the files in the workspace and then cut down (limitation of using workspace from VS Code.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not possible to use a ${dvcRoot}/**/dvc.yaml pattern? Stranger things have happened, so I won't be too surprised if so.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did test that, it didn't return anything.

}

private async initialize() {
const files = await findFiles(join('**', 'dvc.yaml'))
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not possible to use a ${dvcRoot}/**/dvc.yaml pattern? Stranger things have happened, so I won't be too surprised if so.

Base automatically changed from add-has-checkpoint to master February 3, 2022 18:55
@mattseddon mattseddon force-pushed the add-file-system-data branch from e8af2a2 to 50fd368 Compare February 3, 2022 18:56
@mattseddon mattseddon enabled auto-merge (squash) February 3, 2022 18:57
@codeclimate
Copy link

codeclimate bot commented Feb 3, 2022

Code Climate has analyzed commit 50fd368 and detected 0 issues on this pull request.

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

This pull request will bring the total coverage in the repository to 96.2% (-0.2% change).

View more on Code Climate.

@mattseddon mattseddon merged commit d848208 into master Feb 3, 2022
@mattseddon mattseddon deleted the add-file-system-data branch February 3, 2022 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants