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

Multiple commits in the experiments table #2392

Merged
merged 15 commits into from
Sep 23, 2022
2 changes: 2 additions & 0 deletions extension/src/cli/dvc/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ export enum SubCommand {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the row borders are now a bit buggy which I believe is due to this line in our styles:

Screen Shot 2022-09-15 at 7 43 29 AM

Copy link
Contributor

Choose a reason for hiding this comment

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

If I remember correctly, the CSS lines were added to make the last row on the table not have a border 🤔


export enum Flag {
ALL_COMMITS = '-A',
FORCE = '-f',
GRANULAR = '--granular',
JSON = '--json',
NUM_COMMIT = '-n',
OUTPUT_PATH = '-o',
SUBDIRECTORY = '--subdir',
SET_PARAM = '-S',
Expand Down
2 changes: 1 addition & 1 deletion extension/src/cli/dvc/reader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('CliReader', () => {
const cliOutput = await dvcReader.expShow(cwd)
expect(cliOutput).toStrictEqual(expShowFixture)
expect(mockedCreateProcess).toHaveBeenCalledWith({
args: ['exp', 'show', JSON_FLAG],
args: ['exp', 'show', '-n', '3', JSON_FLAG],
cwd,
env: mockedEnv,
executable: 'dvc'
Expand Down
3 changes: 3 additions & 0 deletions extension/src/cli/dvc/reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export interface PlotsOutput {
}

export const TEMP_PLOTS_DIR = join('.dvc', 'tmp', 'plots')
export const NUM_OF_COMMITS_TO_SHOW = '3'

export const isDvcError = <
T extends ExperimentsOutput | DataStatusOutput | PlotsOutput
Expand Down Expand Up @@ -135,6 +136,8 @@ export class DvcReader extends DvcCli {
Command.EXPERIMENT,
SubCommand.SHOW,
...flags,
Flag.NUM_COMMIT,
NUM_OF_COMMITS_TO_SHOW,
Flag.JSON
)
if (isDvcError(output) || isEmpty(output)) {
Expand Down
10 changes: 8 additions & 2 deletions extension/src/experiments/model/collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,14 @@ const collectFromBranchesObject = (
for (const [sha, { baseline, ...experimentsObject }] of Object.entries(
branchesObject
)) {
const name = baseline.data?.name || sha
const branch = transformExperimentData(name, baseline, name, sha)
let name = baseline.data?.name
let label = name

if (!name) {
name = sha
label = shortenForLabel(name)
}
const branch = transformExperimentData(name, baseline, label, sha)

if (branch) {
collectFromExperimentsObject(acc, experimentsObject, sha, branch)
Expand Down