Skip to content

Commit

Permalink
Merge branch 'sourcegraph:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
nipundev authored Nov 30, 2023
2 parents 948b57e + 098afc4 commit 6427404
Show file tree
Hide file tree
Showing 894 changed files with 21,807 additions and 13,252 deletions.
35 changes: 19 additions & 16 deletions .aspect/bazelrc/ci.sourcegraph.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,47 @@ try-import %workspace%/.aspect/bazelrc/ci.generated.bazelrc
# Use repo caching for building and testing.
# Article: https://buildkite.com/blog/how-bazel-built-its-ci-system-on-top-of-buildkite
# Docs: https://bazel.build/reference/command-line-reference#flag--repository_cache
build --repository_cache=/home/buildkite/repocache-sourcegraph
common --repository_cache=/home/buildkite/repocache-sourcegraph

# We need /usr/local/bin
# TODO(DevX) we should be narrower here.
build --test_env=PATH
common --test_env=PATH

# Needed for DB in CI
build --test_env=PGUSER
build --test_env=PGSSLMODE
build --test_env=PGDATABASE
common --test_env=PGUSER=postgres
common --test_env=PGPASSWORD=postgres
common --test_env=PGSSLMODE=disable
common --test_env=PGDATABASE=postgres

# Allow tests to understand they're running in CI, which forces dbtest to drop database even in case of failures.
# TODO(JH) we should instead wipe all templates after a job finishes.
build --test_env=CI
common --test_env=CI

# Ensure we're not exhausting database connections.
build --test_env=GOMAXPROCS=10
build --test_env=TESTDB_MAXOPENCONNS=15
common --test_env=GOMAXPROCS=10
common --test_env=TESTDB_MAXOPENCONNS=15

# Needed for E2E
build --test_env=BUILDKITE
common --test_env=BUILDKITE

# Needed for mocha tests
# We have to use the `--define` flag here instead of `--test_env` because
# the mocha tests target is the build target and it's tested with `build_test`.
build --define=E2E_HEADLESS=false
build --define=E2E_SOURCEGRAPH_BASE_URL="http://localhost:7080"
build --define=DISPLAY=:99
common --define=E2E_HEADLESS=false
# if we set this to localhost, chrome will refuse to conenct since local host is in its HTTP Strict Transport Security
# by setting the loopback address we get passed that
common --define=E2E_SOURCEGRAPH_BASE_URL="http://127.0.0.1:7080"
common --define=DISPLAY=:99

# Provides git commit, branch information to build targets like Percy via status file.
# https://bazel.build/docs/user-manual#workspace-status
build --workspace_status_command=./dev/bazel_buildkite_stamp_vars.sh
common --workspace_status_command=./dev/bazel_buildkite_stamp_vars.sh

# temp
build --test_env=INCLUDE_ADMIN_ONBOARDING=false
common --test_env=INCLUDE_ADMIN_ONBOARDING=false

# Used for container_structure_tests
build --test_env=DOCKER_HOST
common --test_env=DOCKER_HOST

# Used by migration rules
build --action_env=PGUSER=postgres
common --action_env=PGUSER=postgres
9 changes: 0 additions & 9 deletions .aspect/bazelrc/performance.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,3 @@ build --experimental_reuse_sandbox_directories
# author.
# Docs: https://bazel.build/reference/command-line-reference#flag--legacy_external_runfiles
build --nolegacy_external_runfiles

# Some actions are always IO-intensive but require little compute. It's wasteful to put the output
# in the remote cache, it just saturates the network and fills the cache storage causing earlier
# evictions. It's also not worth sending them for remote execution.
# For actions like PackageTar it's usually faster to just re-run the work locally every time.
# You'll have to look at an execution log to figure out what other action mnemonics you care about.
# In some cases you may need to patch rulesets to add a mnemonic to actions that don't have one.
# https://bazel.build/reference/command-line-reference#flag--modify_execution_info
build --modify_execution_info=PackageTar=+no-remote
3 changes: 3 additions & 0 deletions .aspect/workflows/bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
common --remote_download_minimal
common --nobuild_runfile_links
common --noexperimental_reuse_sandbox_directories
30 changes: 30 additions & 0 deletions .aspect/workflows/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
bazel:
rcfiles:
- ".aspect/bazelrc/ci.sourcegraph.bazelrc"
flags:
# This flag is required because otherwise the integration tests fail with `fcmod` Operation not permitted
# which is probably related to the launced containers writing to mapped in directories as root and then
# when the container exits the files that are left over are root.
# TODO(burmudar): launch containers with uid/guid mapped in
- --noexperimental_reuse_sandbox_directories
env:
REDIS_CACHE_ENDPOINT: ":6379"
GIT_PAGER: ''
tasks:
# Checks that BUILD files are formatted
buildifier:
# Checks that BUILD file content is up-to-date with sources
gazelle:
target: //:configure
fix_target: //:configure
# Checks that all tests are passing
test:
include_eternal_tests: true
targets:
- //...
- //testing:grpc_backend_integration_test
# This target should only really run when on main which we aren't handling. For the time being while we
# evaluate Aspect Workflows it is ok
# TODO(burmudar): Let this only run on main branch
- //testing:codeintel_integration_test
12 changes: 9 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ const config = {
'**/vendor/*.js',
'svelte.config.js',
'vite.config.ts',
'vitest.config.ts',
'postcss.config.js',
'playwright.config.ts',
'bundlesize.config.js',
'prettier.config.js',
'svgo.config.js',
'.vscode-test',
'**/*.json',
'**/*.d.ts',
'eslint-relative-formatter.js',
'typedoc.js',
'bundlesize.config.js',
'client/web/dev/**/*',
'graphql-schema-linter.config.js',
],
extends: ['@sourcegraph/eslint-config', 'plugin:storybook/recommended'],
env: {
Expand All @@ -37,8 +43,8 @@ const config = {
ecmaFeatures: {
jsx: true,
},
EXPERIMENTAL_projectService: true,
project: __dirname + '/tsconfig.all.json',
EXPERIMENTAL_useProjectService: true,
project: true,
},
settings: {
react: {
Expand Down
14 changes: 0 additions & 14 deletions .github/CODEOWNERS

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/good_first_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ T-shirt size estimate: **S**.
## Contributors

1. Check out [contributing guidelines](https://github.com/sourcegraph/sourcegraph/blob/main/CONTRIBUTING.md).
2. Join the Sourcegraph [Community Space](https://srcgr.ph/join-community-space) on Slack and join the `#help` channel where the Sourcegraph team can help you!
2. Join the Sourcegraph [Community Space](https://srcgr.ph/join-community-space) on Discord where the Sourcegraph team can help you!
3. Check out [the good first issues board](https://github.com/orgs/sourcegraph/projects/210) to find more curated issues.
2 changes: 1 addition & 1 deletion .github/workflows/licenses-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
ruby-version: "3.2.2" # Not needed with a .ruby-version file - uses: actions/setup-ruby@v1
- uses: actions/setup-go@v2
with: { go-version: "1.20" }
with: { go-version: "1.21" }


- name: Install license_finder
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-auditor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
with:
repository: 'sourcegraph/pr-auditor'
- uses: actions/setup-go@v4
with: { go-version: '1.20' }
with: { go-version: '1.21' }

- run: './check-pr.sh'
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sg-binary-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.20.8
go-version: 1.21.4

- name: Build and upload macOS
if: startsWith(matrix.os, 'macos-') == true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sg-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.20.10
go-version: 1.21.4

- name: Install asdf plugins
uses: asdf-vm/actions/install@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ sourcegraph-webapp-*.tgz
*.tsbuildinfo
graphql-operations.ts
*.module.scss.d.ts
*.module.css.d.ts
dll-bundle

# Extensions
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ vendor/
.nyc_output/
out/
dist/
dist-types/
client/web/dist/
client/shared/src/schema/*.d.ts
ts-node-*
testdata
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
golang 1.20.10
golang 1.21.4
nodejs 20.8.1
fd 8.6.0
shfmt 3.5.0
Expand All @@ -10,6 +10,6 @@ trivy 0.30.3
kustomize 4.5.7
awscli 2.4.7
python 3.11.3 system
rust 1.68.0
rust 1.73.0
ruby 3.1.3
pnpm 8.9.2
46 changes: 45 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ load("@io_bazel_rules_go//proto/wkt:well_known_types.bzl", "WELL_KNOWN_TYPES_API
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//dev/linters/staticcheck:analyzers.bzl", "STATIC_CHECK_ANALYZERS")
load("@npm//:eslint/package_json.bzl", eslint_bin = "bin")
load("//:stamp_tags.bzl", "stamp_tags")
load("//dev:eslint.bzl", "eslint_test_with_types")
load("@buildifier_prebuilt//:rules.bzl", "buildifier")

# Gazelle config
#
Expand Down Expand Up @@ -180,6 +180,28 @@ eslint_test_with_types(
],
)

buildifier(
name = "buildifier",
exclude_patterns = [
"./.git/*",
"cmd/symbols/squirrel/test_repos/starlark/**/*",
],
# TODO: enable these lint checks
# lint_mode = "fix",
mode = "fix",
)

buildifier(
name = "buildifier.check",
exclude_patterns = [
"./.git/*",
"cmd/symbols/squirrel/test_repos/starlark/**/*",
],
# TODO: enable these lint checks
# lint_mode = "warn",
mode = "diff",
)

# Go

gazelle_binary(
Expand All @@ -201,6 +223,13 @@ gazelle(
gazelle = ":gazelle-buf",
)

sh_binary(
name = "configure",
srcs = ["//dev/ci:bazel-configure.sh"],
data = ["@go_sdk//:bin/go"],
env = {"GO": "$(rootpath @go_sdk//:bin/go)"},
)

go_library(
name = "sourcegraph",
srcs = [
Expand Down Expand Up @@ -301,3 +330,18 @@ exports_files([
"CONTRIBUTING.md",
".swcrc",
])

# sg msp settings

bool_flag(
name = "sg_msp",
build_setting_default = False,
visibility = ["//visibility:public"],
)

config_setting(
name = "sg_msp_flag",
flag_values = {
"//:sg_msp": "True",
},
)
31 changes: 24 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ All notable changes to Sourcegraph are documented in this file.

- The setting `experimentalFeatures.searchQueryInput` now refers to the new query input as `v2` (not `experimental`). <!-- NOTE: If v2 becomes the default before this release is cut, then update this entry to mention that instead of adding a separate entry. -->
- Search-based code intel doesn't include the currently selected search context anymore. It was possible to get into a situation where search-based code intel wouldn't find any information due to being restricted by the current search context. [#58010](https://github.com/sourcegraph/sourcegraph/pull/58010)
- The last commit which changed a file/directory is now shown in the files panel on the repo and file pages. To avoid duplicating information and confusion, the commits panel was removed. [58328](https://github.com/sourcegraph/sourcegraph/pull/58328)
- Clicking on a search result now opens the blob view at the same commit as the search result. Before, blob views were opened at the tip of the default branch, which sometimes caused inconsistencies in line numbers if the index was out of date. [#58381](https://github.com/sourcegraph/sourcegraph/pull/58381)
- The `exclude` configuration for code host configuration has been updated to allow chaining multiple conditions together and filtering GitHub repositories based on their size or number of GitHub stars. [#58377](https://github.com/sourcegraph/sourcegraph/pull/58377) and [#58405](https://github.com/sourcegraph/sourcegraph/pull/58405)
- Multiple attributes on _a single_ `exclude` entry now have to be all true for a repository to be excluded. Example: `{"exclude": [{"name": "github.com/example/example"}, {"id": "my-id"}]}` will _only_ exclude repositories that have the name _and_ the id mentioned.
- GitHub code host connections can exclude by size and stars now: `{"exclude": [{"name": "github.com/example/example"}, {"stars": "< 100", "size": ">= 1GB"}]}`
- For `size` and `stars` the supported operators are `<`, `>`, `<=`, `>=`.
- For `size` the supported units are `B`, `b`, `kB`, `KB`, `kiB`, `KiB`, `MiB`, `MB`, `GiB`, `GB`. No decimals points are supported.

### Fixed

Expand All @@ -34,6 +41,7 @@ All notable changes to Sourcegraph are documented in this file.
- Fixed a bug where typing in the GraphQL editor in the Site Admin API console could cause the cursor to jump to the start of the editor. [#57862](https://github.com/sourcegraph/sourcegraph/pull/57862)
- The blame column no longer ignores whitespace-only changes by default. [#58134](https://github.com/sourcegraph/sourcegraph/pull/58134)
- Long lines now wrap correctly in the diff view. [#58138](https://github.com/sourcegraph/sourcegraph/pull/58138)
- Fixed an issue in the search input where pressing Enter after selecting a suggestion would sometimes insert another suggestions instead of submitting the query. [#58186](https://github.com/sourcegraph/sourcegraph/pull/58186)

### Removed

Expand All @@ -43,26 +51,35 @@ All notable changes to Sourcegraph are documented in this file.
- The GitHub Proxy service is no longer required and has been removed from deployment options. [#55290](https://github.com/sourcegraph/sourcegraph/issues/55290)
- The VSCode search extension "Sourcegraph for VS Code" has been sunset and removed from Sourcegraph
repository. [#58023](https://github.com/sourcegraph/sourcegraph/pull/58023)
- The `rateLimit` configuration for Perforce code host connections has been removed to avoid confusion, it was unused. [#58188](https://github.com/sourcegraph/sourcegraph/pull/58188)
- The feature flag `search-ranking` is now completely removed. [#58156](https://github.com/sourcegraph/sourcegraph/pull/58156)
- The notepad UI, notebook creation feature. [#58217](https://github.com/sourcegraph/sourcegraph/pull/58217)

## Unreleased 5.2.3
## Unreleased 5.2.4

### Added

-
- Added the ability to use Workload Identity, Managed Identity and Environmental credentials when using the Azure OpenAI completions and embeddings providers [#58289](https://github.com/sourcegraph/sourcegraph/pull/58289)
- Added support for cloning via SSH from Azure DevOps. [#58655](https://github.com/sourcegraph/sourcegraph/pull/58655)

### Fixed

- Fixed two issues in Zoekt that could cause out of memory errors during search indexing. [sourcegraph/zoekt#686](https://github.com/sourcegraph/zoekt/pull/686), [sourcegraph/zoekt#689](https://github.com/sourcegraph/zoekt/pull/689)

### Changed

-
### Removed

### Fixed
## 5.2.3

-
### Added

### Removed
- Added configurable GraphQL query cost limitations to prevent unintended resource exhaustion. Default values are now provided and enforced, replacing the previously unlimited behaviour. For more information, please refer to: [GraphQL Cost Limits Documentation](https://docs.sourcegraph.com/api/graphql#cost-limits). See details at [#58346](https://github.com/sourcegraph/sourcegraph/pull/58346).
- Sourcegraph now supports connecting to Bitbucket Cloud using Workspace Access Tokens. [#58465](https://github.com/sourcegraph/sourcegraph/pull/58465).

-
### Fixed

- Defining file filters for embeddings jobs no longer causes all files to be skipped if `MaxFileSizeBytes` isn't defined. [#58262](https://github.com/sourcegraph/sourcegraph/pull/58262)

## 5.2.2

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ All interactions with the Sourcegraph open source project are governed by the
6. Once you've chosen an issue, **comment on it to announce that you will be working on it**, making it visible for others that this issue is being tackled. If you end up not creating a pull request for this issue, please delete your comment.
7. If you have any questions, please [refer to the docs first](https://docs.sourcegraph.com/). If you don’t find any relevant information, mention the issue author.
8. The issue author will try to provide guidance. Sourcegraph always works in async mode. We will try to answer as soon as possible, but please keep time zones differences in mind.
9. Join the [Sourcegraph Community Space](https://srcgr.ph/join-community-space) on Discord where the Sourcegraph team can help you!

## Can I pick up this issue?

Expand All @@ -47,7 +48,6 @@ All open issues are not yet solved. If the task is interesting to you, take it a
### Pull Requests

- [How to structure](https://docs.sourcegraph.com/dev/background-information/pull_request_reviews#what-makes-an-effective-pull-request-pr)
- [PR guidelines](https://handbook.sourcegraph.com/departments/engineering/dev/onboarding/pr-checklist/)
- Git branch name convention: `[developer-initials]/short-feature-description`
- [Examples on Github](https://github.com/sourcegraph/sourcegraph/pulls?q=is%3Apr+label%3Ateam%2Ffrontend-platform)
- (For Sourcegraph team) [How to accept contributions](https://docs.sourcegraph.com/dev/contributing/accepting_contribution)
Loading

0 comments on commit 6427404

Please sign in to comment.