Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

batches: Change git diffstat to (added, deleted) from (added, modified, deleted)#40454

Merged
BolajiOlajide merged 33 commits into
mainfrom
bo/change-diff-stat-values
Sep 19, 2022
Merged

batches: Change git diffstat to (added, deleted) from (added, modified, deleted)#40454
BolajiOlajide merged 33 commits into
mainfrom
bo/change-diff-stat-values

Conversation

@BolajiOlajide

@BolajiOlajide BolajiOlajide commented Aug 17, 2022

Copy link
Copy Markdown
Contributor

Closes #39390

CleanShot 2022-09-10 at 08 48 01@2x

CleanShot 2022-09-10 at 08 49 13@2x

Test plan

I confirmed all diffs generated only display the added and deleted fields.

@BolajiOlajide BolajiOlajide added the batch-changes Issues related to Batch Changes label Aug 17, 2022
@cla-bot cla-bot Bot added the cla-signed label Aug 17, 2022
@BolajiOlajide BolajiOlajide marked this pull request as draft August 17, 2022 04:26
@BolajiOlajide BolajiOlajide force-pushed the bo/change-diff-stat-values branch from ef51737 to 39c2cc6 Compare August 22, 2022 06:53
Comment thread internal/usagestats/batches.go
@BolajiOlajide BolajiOlajide force-pushed the bo/change-diff-stat-values branch from c50920b to 3fc1f96 Compare September 3, 2022 03:50

@LawnGnome LawnGnome left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I gave this a super quick once over after our discussion earlier at sprint planning, and this LGTM at a first pass. Looking forward to this being ready for review!

Comment thread enterprise/cmd/frontend/internal/batches/resolvers/apitest/types.go Outdated
@eseliger

eseliger commented Sep 8, 2022

Copy link
Copy Markdown
Member

Gave it a quick glance and got some thoughts:

We don't modify the global type DiffStat in GraphQL, which means that the changed property would still exist in the API. It now seems that out of all resolvers in Sourcegraph code batch changes resolvers seem to calculate that field wrong because every other API still returns it correctly. 🤔
I think it would be great to remove it from the global type as well, so that we don't end up with two DiffStat declarations and two separate concepts that users have to understand (in BC there are no changed lines, in everything else there are).
This also causes another problem: The fileDiffs use the global type, as it's a global resolver, and that causes the diffs themselves to still have changed lines, although the summary only knows added and deleted. That looks a bit confusing to me, even if we had to do two concepts for a while, at no time should both of them be visible on the same page:
Screenshot 2022-09-08 at 21 39 45@2x
This will also mean that batch changes will have to translate the DiffStat we use elsewhere in the codebase to our new approach.
I'm sorry I haven't been more clear in the ticket about the scope of this, but I think that we should do something that is consistent around all of the product.


One missed on the step resolver:
Screenshot 2022-09-08 at 21 40 49@2x

@BolajiOlajide BolajiOlajide force-pushed the bo/change-diff-stat-values branch 2 times, most recently from 73bdf19 to 4a27ed8 Compare September 10, 2022 08:04
@BolajiOlajide BolajiOlajide marked this pull request as ready for review September 10, 2022 10:13
@BolajiOlajide BolajiOlajide requested a review from a team September 10, 2022 10:13
@sourcegraph-bot

sourcegraph-bot commented Sep 10, 2022

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 156b65a...a526094.

Notify File(s)
@courier-new client/web/src/enterprise/batches/batch-spec/batch-spec.mock.ts
client/web/src/enterprise/batches/batch-spec/execute/backend.ts
client/web/src/enterprise/batches/close/BatchChangeClosePage.story.tsx
client/web/src/enterprise/batches/detail/BatchChangeDetailsPage.mock.ts
client/web/src/enterprise/batches/detail/BatchChangeStatsCard.story.tsx
client/web/src/enterprise/batches/detail/changesets/BatchChangeChangesets.mock.ts
client/web/src/enterprise/batches/detail/changesets/ExternalChangesetNode.story.tsx
client/web/src/enterprise/batches/preview/BatchChangePreviewPage.story.tsx
client/web/src/enterprise/batches/preview/list/VisibleChangesetApplyPreviewNode.tsx
client/web/src/enterprise/batches/preview/list/backend.ts
client/web/src/enterprise/batches/preview/list/storyData.ts
client/web/src/enterprise/batches/repo/BatchChangeRepoPage.story.tsx
client/web/src/enterprise/batches/repo/backend.ts
client/web/src/enterprise/batches/repo/testData.ts
client/web/src/integration/batches.test.ts
@eseliger client/web/src/enterprise/batches/batch-spec/batch-spec.mock.ts
client/web/src/enterprise/batches/batch-spec/execute/backend.ts
client/web/src/enterprise/batches/close/BatchChangeClosePage.story.tsx
client/web/src/enterprise/batches/detail/BatchChangeDetailsPage.mock.ts
client/web/src/enterprise/batches/detail/BatchChangeStatsCard.story.tsx
client/web/src/enterprise/batches/detail/changesets/BatchChangeChangesets.mock.ts
client/web/src/enterprise/batches/detail/changesets/ExternalChangesetNode.story.tsx
client/web/src/enterprise/batches/preview/BatchChangePreviewPage.story.tsx
client/web/src/enterprise/batches/preview/list/VisibleChangesetApplyPreviewNode.tsx
client/web/src/enterprise/batches/preview/list/backend.ts
client/web/src/enterprise/batches/preview/list/storyData.ts
client/web/src/enterprise/batches/repo/BatchChangeRepoPage.story.tsx
client/web/src/enterprise/batches/repo/backend.ts
client/web/src/enterprise/batches/repo/testData.ts
client/web/src/integration/batches.test.ts
enterprise/internal/batches/service/service_test.go
enterprise/internal/batches/state/state.go
enterprise/internal/batches/store/batch_changes.go
enterprise/internal/batches/store/batch_changes_test.go
enterprise/internal/batches/store/batch_specs.go
enterprise/internal/batches/store/batch_specs_test.go
enterprise/internal/batches/store/changeset_specs.go
enterprise/internal/batches/store/changeset_specs_test.go
enterprise/internal/batches/store/changesets.go
enterprise/internal/batches/store/changesets_test.go
enterprise/internal/batches/testing/changeset.go
enterprise/internal/batches/testing/changeset_spec.go
enterprise/internal/batches/testing/mock_sync_state.go
enterprise/internal/batches/testing/specs.go
enterprise/internal/batches/types/changeset.go
enterprise/internal/batches/types/changeset_spec.go
enterprise/internal/batches/types/changeset_test.go
internal/usagestats/batches.go
internal/usagestats/batches_test.go

Comment thread enterprise/internal/batches/state/state.go Outdated
@BolajiOlajide BolajiOlajide force-pushed the bo/change-diff-stat-values branch 4 times, most recently from ade602c to ec7cb8d Compare September 15, 2022 02:10

@courier-new courier-new left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for all your work on this, especially when it comes to the tedium of updating all the tests that broke. 😂 Looks great to me. Saw your updates in the analytics, repo, too -- appreciate that!

Comment thread CHANGELOG.md Outdated
Comment thread cmd/frontend/graphqlbackend/schema.graphql Outdated
Comment thread enterprise/internal/batches/state/state.go Outdated
Comment thread enterprise/internal/batches/store/batch_specs_test.go Outdated
@BolajiOlajide BolajiOlajide force-pushed the bo/change-diff-stat-values branch from d5f2e70 to adce4c7 Compare September 15, 2022 19:55
@BolajiOlajide BolajiOlajide merged commit d838320 into main Sep 19, 2022
@BolajiOlajide BolajiOlajide deleted the bo/change-diff-stat-values branch September 19, 2022 11:57
{
"path": "enterprise/cmd/frontend/internal/batches/webhooks",
"prefix": "TestWebhooksIntegration",
"reason": "Removed the `diff_stat_changed` column from changeset and changeset_specs table."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the best way to do this next time would be to keep the column one more release but not use it - that way existing frontend pods won't error out before they get bumped for the upgrade and also the backcompat tests won't fail :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it. thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

batch-changes Issues related to Batch Changes cla-signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change git diffstat to (added, deleted) from (added, modified, deleted)

7 participants