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

Fix table/plots not updating correctly on windows #3191

Merged
merged 4 commits into from
Feb 1, 2023

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented Jan 31, 2023

Demo

Extension.Development.Host.Experiments.-.example-get-started.-.Visual.Studio.Code.2023-01-31.13-27-43.mp4

Fixes #3103, fixes #3102

@julieg18 julieg18 added the bug Something isn't working label Jan 31, 2023
@julieg18 julieg18 self-assigned this Jan 31, 2023
export const getRelativePattern = (
path: string,
pattern: string
): RelativePattern => {
for (const workspaceFolder of workspace.workspaceFolders || []) {
const workspaceFolderPath = workspaceFolder.uri.fsPath
if (isSameOrChild(workspaceFolderPath, path)) {
return new RelativePattern(
workspaceFolder,
join(relative(workspaceFolderPath, path), pattern)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Took wayyyy too long for me to realize this, but RelativePattern requires the pattern to be created with forward slashes 🤦. join will add backward slashes in a windows environment, thus breaking things in windows.

@julieg18 julieg18 marked this pull request as ready for review January 31, 2023 20:31
@@ -18,7 +19,7 @@ export const getRelativePattern = (
if (isSameOrChild(workspaceFolderPath, path)) {
return new RelativePattern(
workspaceFolder,
join(relative(workspaceFolderPath, path), pattern)
joinWithForwardSlashes([relative(workspaceFolderPath, path), pattern])
Copy link
Member

Choose a reason for hiding this comment

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

[Q] Can we create a new relativePattern file and move joinWithForwardSlashes and these function in there? Grouping the behaviour/functions together would give more clues about why it was done in the future.

[I] Would be good to get a regression test for the behaviour (maybe add to 'should watch the .git directory for updates' in extension/src/test/suite/experiments/data/index.test.ts).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

[Q] Can we create a new relativePattern file and move joinWithForwardSlashes and these function in there? Grouping the behaviour/functions together would give more clues about why it was done in the future.

Done!

[I] Would be good to get a regression test for the behaviour (maybe add to 'should watch the .git directory for updates' in extension/src/test/suite/experiments/data/index.test.ts).

Currently, we have a .git file watcher test set up for when the .git folder is outside of the workspace since that's how our demo project works. But I couldn't think of an uncomplicated way to test a workspace that has a local .git folder inside since we don't have a project like that in our repo... Is there something I'm misunderstanding/missing?

Copy link
Member

Choose a reason for hiding this comment

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

not sure but can we create a set of nested subfolders inside of the demo project and then stub getGitRepositoryRoot to return that path or even stub getGitPath? Could then remove the top directory at the end of the test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure but can we create a set of nested subfolders inside of the demo project and then stub getGitRepositoryRoot to return that path or even stub getGitPath? Could then remove the top directory at the end of the test

Will work on it in a followup!

@mattseddon
Copy link
Member

[Q] Can you confirm if this also fixes #3102

@julieg18 julieg18 changed the title Fix experiment table showing removed experiments Fix table/plots not updating correctly on windows Feb 1, 2023
@julieg18
Copy link
Contributor Author

julieg18 commented Feb 1, 2023

[Q] Can you confirm if this also fixes #3102

Look like it does fix the issue!

@codeclimate
Copy link

codeclimate bot commented Feb 1, 2023

Code Climate has analyzed commit 70ca4db and detected 0 issues on this pull request.

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

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

View more on Code Climate.

@julieg18
Copy link
Contributor Author

julieg18 commented Feb 1, 2023

Going to go ahead and merge this! If we need more testing, I'll do so in a followup :)

@julieg18 julieg18 merged commit 34642e8 into main Feb 1, 2023
@julieg18 julieg18 deleted the fix-remove-experiments branch February 1, 2023 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table is not refreshed after experiment is removed Plots don't update while experiment is running
3 participants