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 remove queued experiment command #1454

Merged
merged 2 commits into from
Mar 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add git logs refs to watched path for removing single queued experiment
mattseddon committed Mar 17, 2022
commit 20aad913f7caef814573f8268460a01203573fb8
3 changes: 2 additions & 1 deletion extension/src/experiments/data/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { join } from 'path'
import { GIT_REFS } from '../../git'
import { GIT_LOGS_REFS, GIT_REFS } from '../../git'

export const EXPERIMENTS_GIT_REFS = join(GIT_REFS, 'exps')
export const EXPERIMENTS_GIT_LOGS_REFS = join(GIT_LOGS_REFS, 'exps')
9 changes: 7 additions & 2 deletions extension/src/experiments/data/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { join } from 'path'
import { EventEmitter } from 'vscode'
import { collectFiles } from './collect'
import { EXPERIMENTS_GIT_REFS } from './constants'
import { EXPERIMENTS_GIT_LOGS_REFS, EXPERIMENTS_GIT_REFS } from './constants'
import {
createFileSystemWatcher,
getRelativePattern
@@ -55,7 +55,12 @@ export class ExperimentsData extends BaseData<ExperimentsOutput> {

private async watchExpGitRefs(): Promise<void> {
const gitRoot = await getGitRepositoryRoot(this.dvcRoot)
const watchedRelPaths = [DOT_GIT_HEAD, EXPERIMENTS_GIT_REFS, HEADS_GIT_REFS]
const watchedRelPaths = [
DOT_GIT_HEAD,
EXPERIMENTS_GIT_REFS,
EXPERIMENTS_GIT_LOGS_REFS,
HEADS_GIT_REFS
]

this.dispose.track(
createFileSystemWatcher(
1 change: 1 addition & 0 deletions extension/src/git.ts
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ export const DOT_GIT = '.git'
export const DOT_GIT_HEAD = join(DOT_GIT, 'HEAD')
export const DOT_GIT_INDEX = join(DOT_GIT, 'index')
export const GIT_REFS = join(DOT_GIT, 'refs')
export const GIT_LOGS_REFS = join(DOT_GIT, 'logs', 'refs')
export const HEADS_GIT_REFS = join(GIT_REFS, 'heads')

const getUris = (repositoryRoot: string, relativePaths: string[]) =>
6 changes: 5 additions & 1 deletion extension/src/repository/data/index.ts
Original file line number Diff line number Diff line change
@@ -12,7 +12,10 @@ import {
getRelativePattern
} from '../../fileSystem/watcher'
import { join } from '../../test/util/path'
import { EXPERIMENTS_GIT_REFS } from '../../experiments/data/constants'
import {
EXPERIMENTS_GIT_LOGS_REFS,
EXPERIMENTS_GIT_REFS
} from '../../experiments/data/constants'

export type Data = {
diffFromHead: DiffOutput
@@ -28,6 +31,7 @@ export const isExcluded = (dvcRoot: string, path: string) =>
(path.includes('.git') && (path.includes('HEAD') || path.includes('index')))
) ||
path.includes(EXPERIMENTS_GIT_REFS) ||
path.includes(EXPERIMENTS_GIT_LOGS_REFS) ||
ignoredDotDirectories.test(path)

export class RepositoryData {