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

🏷️ Version 4.5.0 #2

Open
wants to merge 679 commits into
base: libre
Choose a base branch
from
Open

🏷️ Version 4.5.0 #2

wants to merge 679 commits into from

Conversation

fungiboletus
Copy link
Member

No description provided.

leo and others added 30 commits February 7, 2023 12:29
This adds linting to the default set of sg lints
* udpate visibility

* build enterprise in CI

* Revert "udpate visibility"

This reverts commit de47188.

* Fix visibility

* Regen buildfiles

* Force add the missing file

* Remove spaces from filenames

* Fix some issues with conflicting protobuf defs

* Fix the remaining mess with googleapis

* Fix coreos/iptable dependency

The `build` file at the root of their repo is mistaken by Gazelle for
being a Bazel buildfile whereas it's just a shell script.

We can fix this by simply forcing bazel to generate the buildfile
regardless.

* Fix one last issue with googleapis and proto

* Since I'm here, let's fix some visibility as well

* Update buildfiles

* Build //...

* Comment on the iptable issue

* Remove unecessary visibility tweak

* fixup

---------

Co-authored-by: Jean-Hadrien Chabran <[email protected]>
* Extend Team/members() signatures with context. Add db and teamID to members resolver

* Draft and inefficient team members resolver query implementation

* Team members pagination test serving usernames

* Remove TODOs, we have a task list in the ticket now
chore: clean up pagination relater code.

Test plan:
CI.
…cegraph#46612)

* Migrate shared form component to MultiCombobox UI

* Update creation ui validators and types (from string to array of strings)

* Support valid/invalid states in MultiCombobox UI

* Fix className problem in MultiCombobox root element

* Migrate Dynamic Code Insights example to the new UI

* Migrate Language insight to the new UI

* Migrate Search insight to the new UI

* Migrate Compute insight to the new UI

* Migrate Capture group insight to the new UI

* Migrate Line chart preview card to the new UI

* Fix edit pages

* Fix integration tests

* Fixed new MultiCombobox repo UI after main rebasing

* Support smart paste logic for the repo multicombobox input

* Fix edit insight integration test

* Fix wildcard MultiCombobox component (comments and styles)

* Unify creation UI layout
* Add new setup wizard core UI

* Fix setup wizard experimental flag check and visual background issue

* Remove old setup tabs UI

* Fix after rebasing main

* Remove top level route

* Use v6 router parts

* Adjust colors and fonts for the light/dark theme

* Revert "Remove top level route"

This reverts commit 3763721.

* Use calculated from URL context instead of local state

* Fix URL match calculation logic

* Revert setting cascade check
taras-yemets and others added 30 commits February 17, 2023 13:19
…#47700)

This is a follow-up to [this
comment](https://github.com/sourcegraph/sourcegraph/pull/47406#discussion_r1106606664)
on [sourcegraph#47406](https://github.com/sourcegraph/sourcegraph/pull/47406).

This ensures that we don't have `zombie` users (users without any role
assigned to them) on a Sourcegraph instance.

## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
* Manually tested
* Updated unit tests
## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
Manually tested

---------

Co-authored-by: Milan Freml <[email protected]>
Co-authored-by: Milan Freml <[email protected]>
…7813)

Fixes https://github.com/sourcegraph/sourcegraph/issues/47810

## Test plan
- Go to the search 
- Try to create insight from it 
- See that you don't have context value in the repo query or data series
query
Closes [sourcegraph#47557](https://github.com/sourcegraph/sourcegraph/issues/47557)

This is a somewhat gruesome PR to read, so sorry for that. I wanted to
keep this change atomic so it's easy to revert if we need.

So, I set out to automate the dates in the release config and realized
that fundamentally the architecture of the release tool was coupled to
this config in a way that was making life more difficult than it needed
to be.

This PR refactors the release config in the release tool. It uses an
entirely new schema, and for the most part automates every interaction
anyone will have with the config. The new schema is designed to do a few
things:
1. Deprecate the annoying cached version by specifying two sections of
the release config, both a definition and an active releases field.
Anything in the active releases is considered in progress.
2. Sets up some architecture to support multi-release functionality from
the release tool. There are guard rails right now since this isn't fully
supported.

Also,
* Automatically detect and suggest versions
* Automatically generate release dates from a specified date or current
time
* QOL changes to flow to the appropriate commands if the release config
is in the wrong state. For example it will prompt for input if the
config is empty for a given version for commands that require a valid
state
* Guardrails around every interaction I could find that causes problems
* New commands to interact with the release config (activate-release,
deactivate-release, util:previous-version)

## Usage

To set a release as active, either use the activate command directly
```
pnpm run release release:activate-release
```
or transitively through another dependent command.

All release commands that interact with the _current_ release will read
from the active release in the release config.
All release commands that interact with _future_ releases will read and
write to the release definitions in the release config.

To deactivate the release:
```
pnpm run release release:deactivate-release
```

Most of these steps are not explicitly mandatory, and are coupled into
other relevant commands (for example closing the release will deactivate
the release also).

To add new scheduled release definitions:
```
pnpm run release release:prepare
```

To remove scheduled releases:
```
pnpm run release release:remove
```

To determine previous versions:
```
pnpm run release util:previous-version 4.2.1
Getting previous version from: 4.2.1...
4.2.0
```

or

```
pnpm run release util:previous-version
Getting previous version...
4.4.2
```


## Test plan

I did a lot of manual testing since so many commands were impacted. Some
example output is below, and here is an example of a fake issue that was
generated from the release tool:
https://github.com/sourcegraph/sourcegraph/issues/47760

Example of how the input will flow if the config is not in the correct
state, including version suggestions:
```
> @sourcegraph/[email protected] release /Users/[email protected]/Documents/code/sourcegraph/dev/release
> ts-node --transpile-only ./src/main.ts "release:status"

No active releases are defined! Attempting to activate...
Next minor release: 4.5.0
Next patch release: 4.4.3
Enter the version to activate: 
```

```
> @sourcegraph/[email protected] release /Users/[email protected]/Documents/code/sourcegraph/dev/release
> ts-node --transpile-only ./src/main.ts "release:status"

No active releases are defined! Attempting to activate...
Next minor release: 4.5.0
Next patch release: 4.4.3
Enter the version to activate: 4.4.3
Attempting to detect previous version...
Detected previous version: 4.4.2
Release definition not found for: 4.4.3, enter release information.

Enter the release date (YYYY-MM-DD). Enter blank to use current date: 
Using current time: 2023-02-16T11:01:34.710-08:00
Enter the github username of the release captain: coury-clark
Enter the slack username of the release captain: coury
Version created:
{
  "codeFreezeDate": "2023-02-09T10:01:34.710-08:00",
  "securityApprovalDate": "2023-02-09T10:01:34.710-08:00",
  "releaseDate": "2023-02-16T10:01:34.710-08:00",
  "current": "4.4.3",
  "captainGitHubUsername": "coury-clark",
  "captainSlackUsername": "coury"
}
Release: 4.4.3 activated!
```


<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

## App preview:

-
[Web](https://sg-web-cclark-refactor-release-config.onrender.com/search)

Check out the [client app preview
documentation](https://docs.sourcegraph.com/dev/how-to/client_pr_previews)
to learn more.
Document new insights settings for controlling backfills
Update docs regarding limitations and scale.
The underlying paging controls made the assumption that any sort field
is both non-null and unique. This caused problems because we were
allowing sorting by fields that can be null (queue position) and state
which is not unique.

This change simplifies the paging cursor so that it will only contain
the backfill id then builds the where clause using that instead of the
relying on the underlying paging controller.

There does still remain the possibility that if a series were shared
between multiple insights and thus shared the same backfill and that
backfill fell at the border of a page, that paging could skip the
additional instances of that backfill. I consider this low ok for now
because at least one instance of the backfill will always appear and any
action on that will apply to all items.

## Test plan
Verify paging works for each sort option
verify search worked case insensitve
…47781)

This adds minimal coverage for the file-based ranking logic (the
`search-ranking` feature flag):
* Add a case to horizontal search tests
* Exercise the feature flag in API integration tests
Update the multi version upgrade constants

## Test Plan
N/A
…cegraph#47970)

Backporting to 4.5

Original PR:

Earlier today (or some days/ months ago depending on when you're reading
this), I noticed that on S2 the OOB migration for assigning roles to
existing users was at 99% for quite some time.

<img width="918" alt="CleanShot 2023-02-21 at 12 44 21@2x"
src="https://user-images.githubusercontent.com/25608335/220336203-2fe406cb-e8bd-4c6b-9066-af14fd03d50a.png">

I did some digging to find out what happened, and I found out we had
some site admins who weren't assigned the `USER` role. I confirmed they
weren't newly created admins since the PR for assigning roles on
creation merged pretty recently - they weren't. I suspect it's a case of
the instance getting restarted when the OOB migration was in progress.

The existing logic for checking users that need to be assigned roles
just checked the `user_roles` table to see if you had any record; we
didn't check specifically for what roles were assigned.

```sql
SELECT
	id, site_admin
FROM users u
WHERE
	u.id NOT IN (SELECT user_id from user_roles)
```

This PR updates that query to check for the assigned roles and only sets
what's needed. I also updated the test to test for this scenario.

## Test plan

<!-- All pull requests REQUIRE a test plan:

https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
The test added validates that the `Up` method checks for specific role
assignments on a `USER` and `SITE_ADMINISTRATOR` level.



## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

Co-authored-by: Bolaji Olajide <[email protected]>
Cherry-picks commit for
https://github.com/sourcegraph/sourcegraph/pull/47701 and one dependent
commit (from https://github.com/sourcegraph/sourcegraph/pull/47911) into
4.5.

## Test plan

Will wait to ensure buildkite passes.

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

---------

Co-authored-by: Bolaji Olajide <[email protected]>
…code and use default value instead (sourcegraph#47988)

Backport f9b7f74 from sourcegraph#47969.

---------

Co-authored-by: Noah S-C <[email protected]>
MIgration graph was broken after latest backport

## Test plan
N/A

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
Updating migration graph for 4.5 branch

## Test plan
N/A

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.