Skip to content

Conversation

@wolmir
Copy link
Contributor

@wolmir wolmir commented Jul 14, 2022

This PR will highlight the dependency cells with changes in relation to HEAD.

Demo:

Screen.Recording.2022-07-18.at.12.21.46.mov

Copy link
Contributor

@mattseddon mattseddon left a comment

Choose a reason for hiding this comment

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

Functionality looks good:

image

const value = shortenForLabel(hash)
acc[path] = value

if (value && branch && branch?.deps?.[path] !== value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[Q] Is this definitely accessing the right property in the branch?

Copy link
Contributor

Choose a reason for hiding this comment

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

I can see from

export interface DepColumns {
  [path: string]: string | ValueWithChanges
}

that you've got mixed types. It would be a good idea to standardise the type now as we are moving towards Studio style tooltips for deps:

image

styles.td,
cell.isPlaceholder && styles.groupPlaceholder,
{
[styles.workspaceChange]:
Copy link
Contributor

Choose a reason for hiding this comment

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

[I] Name needs to be updated. Personally I think it would be ok to have two different (currently duplicate) styles. One for workspace changes and another for dep changes against HEAD.

}

const stringValue = String(value)
const rawValue = (value as ValueWithChanges).value ?? value
Copy link
Contributor

Choose a reason for hiding this comment

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

[I] Would be good to have a couple of helper functions for

const rawValue = (value as ValueWithChanges).value ?? value
const cellhasChanges = (cell.value as ValueWithChanges)?.changes

so that we can keep them together and have the concept all in one place (easier to extend/reason about later)

@wolmir wolmir force-pushed the data-pipeline-column-changes-highlight branch from 6bfaa05 to 5521a15 Compare July 18, 2022 14:50
@wolmir wolmir marked this pull request as ready for review July 18, 2022 15:28
@wolmir wolmir requested a review from mattseddon July 18, 2022 15:29
for (const [path, { hash }] of Object.entries(columns)) {
acc[path] = shortenForLabel(hash)
const value = shortenForLabel(hash)
acc[path] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

You could move this below the if clause and add a continue in the if clause. That way you wouldn't assign to acc[path] twice.

}

export interface ValueWithChanges {
value: string | number
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this ever be anything else than a string or number? I think we have a similar interface somewhere and we also have string[], number[], boolean, boolean[] in there.

{...cell.getCellProps({
className: cx(
styles.td,
cell.isPlaceholder && styles.groupPlaceholder,
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't really matter, but since we have a block with conditionals just below, this could be moved there as [styles.groupPlaceholder]: cell.isPlaceholder

@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit cbb0834 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 96.7% (0.0% change).

View more on Code Climate.

@wolmir wolmir merged commit 730d442 into main Jul 18, 2022
@wolmir wolmir deleted the data-pipeline-column-changes-highlight branch July 18, 2022 16:38
@mattseddon mattseddon added 🏠 housekeeping product PR that affects product and removed 🏠 housekeeping labels Jul 19, 2022
@mattseddon
Copy link
Contributor

@wolmir please remember to add one of the three labels to your PRs or they won't make it into the release changelog.

The labels are :product: or :housekeeping: or 🐛

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.

3 participants