* Works
* Refactor to use enums
* Remove logs
* Refactor to make less calls
* Move vars closer to usage + fix typo
* Apply suggestions from code review
Co-authored-by: Milan Freml <kopancek@users.noreply.github.com>
* Change init
Co-authored-by: Milan Freml <kopancek@users.noreply.github.com>
We've seen this alert get triggered over the last few days even though
the metrics seem to indicate otherwise. Adding a log to understand
when we are resetting the update queue.
Now that we have a top-level limiter, there is no reason for each of the
child jobs to have their own limiters since they all use the same
context, so the limits are effectively duplicated logic.
Previously, when the limit was hit, we would cancel any jobs depending
on the context returned when creating the LimitStream, but we would
still send any events that those jobs sent after the context was
cancelled. This meant that, even though we were "limiting" the stream,
it was only a soft limit.
This makes it difficult to make guarantees for upstream consumers of a
limited stream. For example, with AND searches, we want strictly no more
than n results, but limit stream might return an unboundedly large
number of results. This causes errors when I try to depend on
LimitStream for AND searches.
We have a type for a collection of matches, and we have a few spots that contain inline logic for things that can be operations on this slice type. This adds Matches.Limit() and Matches.ResultCount() which better encapsulates the logic and simplifies the callsites.
It's quite annoying today for designers, reviewers, etc. to navigate to the
`/welcome` page because you need to:
1. Add the `enablePostSignupFlow` to your site config file in the `dev-private` repo.
2. Restart your dev server, ensuring you are running `sg start dotcom` mode.
3. Clear your browser local storage (because you may have completed the welcome flow
already and that apollo state is cached in local storage)
4. Run a GraphQL query to edit your "temporary settings" which are stored on the server
to enable this user flow:
```
mutation {
editTemporarySettings(settingsToEdit:"{\"signup.finishedWelcomeFlow\": false}") {
alwaysNil
}
}
```
Finally, you can navigate to `/welcome` to test the flow / check designs. That's insane.
So I've added a debug parameter, so all you need now is `sg start dotcom` and navigate to
`/welcome?debug=1` to get there. None of that stuff above.
Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
This modifies the `Run` signature on jobs to take a `db` handle instead
of a repo pager. The repo pager can be constructed from a db handle and
a set of repo options, and many of the jobs already store the repo
options on their struct.
By passing in a db handle to `Run()`, we remove all (I think) "runtime"
fields from the job structs. As a cool side effect, this means we could
theoretically fully serialize and deserialize a job tree. I don't have
any specific use cases for this in mind, but I can see some potentially
very cool things we could do there.
This converts repo exclusion to a job. This pulls the execution out of
doResults, and adds it to the list of jobs to be executed in
toSearchRoutine. This allows us to slim down doResults and to
describe the operation in our routine tree like we do our other jobs.
Now that jobs are statically defined within the scope of a basic query, we can make combinator jobs that control the runtime behavior of a set of jobs.
This creates two new combinator jobs; JobWithOptional and ParallelJob.
JobWithOptional now encapsulates our logic for optional and required searches, allowing us to remove the Required method from the Job interface.
ParallelJob encapsulates the process of running a set of jobs in parallel.
This commit makes it so we don't enqueue external service sync jobs for
cloud default external services also when there are no rows in the
external_service_sync_jobs table.
This case was unfortunately missed in #24412, which was a follow up from
a very similar incident to the one we are now handling, so it did not
prevent it from happening again :sadpanda:
Additionally, we prevent any cloud default service from syncing in the
Syncer.SyncExternalService method by early exiting with an error
(defense in depth).
* Update drill-down filters styles and copy
* Update badge and description styles
* Fix max width/height calculation when space isn't enough to fit tooltip
* Improve popover props interface for controlled isOpen prop
Co-authored-by: Valery Bugakov <skymk1@gmail.com>