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

insights: saving a new view of a scoped insight does not trigger recalculation #44679

Merged
leonore merged 25 commits into
mainfrom
leo/experiment-save-as-new-view
Dec 5, 2022
Merged

insights: saving a new view of a scoped insight does not trigger recalculation #44679
leonore merged 25 commits into
mainfrom
leo/experiment-save-as-new-view

Conversation

@leonore

@leonore leonore commented Nov 21, 2022

Copy link
Copy Markdown
Contributor

final close https://github.com/sourcegraph/sourcegraph/issues/42116

Test plan

Manually tested for the frontend flow.

  • created a new view from the all insights dashboard
  • from a specific dashboard
  • from the standalone insight page

Integration test added

@leonore leonore requested review from a team November 21, 2022 17:07
@cla-bot cla-bot Bot added the cla-signed label Nov 21, 2022
@sg-e2e-regression-test-bob

sg-e2e-regression-test-bob commented Nov 21, 2022

Copy link
Copy Markdown

Bundle size report 📦

Initial size Total size Async size Modules
0.00% (0.00 kb) 0.01% (+1.53 kb) 0.01% (+1.53 kb) -0.27% (-2) 🔽

Look at the Statoscope report for a full comparison between the commits 471a445 and cdf3710 or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

Comment thread client/web/src/enterprise/insights/pages/insights/creation/capture-group/types.ts Outdated
Comment thread cmd/frontend/graphqlbackend/insights.graphql Outdated
@leonore leonore force-pushed the leo/experiment-save-as-new-view branch from 33cb789 to e0c5e7f Compare November 29, 2022 19:16
@vovakulikov

Copy link
Copy Markdown
Contributor

@leonore I pushed my 5 cent commit about optimistic mutation update fix. I haven't test it properly with local BE, I would like to have another 10-15 minutes sync with your just to make sure that everything is in place and ready for full-fledged review.

@leonore leonore marked this pull request as ready for review December 1, 2022 23:16
@sourcegraph-bot

sourcegraph-bot commented Dec 2, 2022

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff cdf3710...471a445.

Notify File(s)
@sourcegraph/code-insights-backend cmd/frontend/graphqlbackend/insights.go
enterprise/internal/insights/resolvers/disabled_resolver.go
enterprise/internal/insights/resolvers/insight_view_resolvers.go
enterprise/internal/insights/store/insight_store.go
@unknwon dev/gqltest/code_insights_test.go
internal/gqltestutil/code_insights.go

Comment thread cmd/frontend/graphqlbackend/insights.graphql Outdated
Comment thread enterprise/internal/insights/resolvers/insight_view_resolvers.go Outdated

setOriginalInsightFilters(filters)
history.push(`/insights/dashboard/${ALL_INSIGHTS_DASHBOARD.id}`)
history.push(`/insights/dashboards/${ALL_INSIGHTS_DASHBOARD.id}`)

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.

is this intentional?

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.

yes, it looks like this might have been a bug to begin with? our single dashboard url looks like that. it's the only occurrence (apart from some doc entries)

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.

@coury-clark, this is my change in order to fix this problem that @leonore described above. This change is intentional and it fixes this bad routing problem

filters,
title: values.insightName,
dashboard: null,
}).toPromise()

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.

Is this intentional?

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.

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.

@leonore is right. Previously we used observables since we had to work with a generic GQL client interface (in which we had an Observable interface for this mutation) in this PR Leo implements a new method of doing mutation (more standard), which already returns a promise and doesn't do anything with observables.

@leonore leonore merged commit 9c041c8 into main Dec 5, 2022
@leonore leonore deleted the leo/experiment-save-as-new-view branch December 5, 2022 16:40

@vovakulikov vovakulikov 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.

FE changes LGTM.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

insights: save default filters and save as new view are retriggering insight calculation for scoped insights

5 participants