Code AI platform with Code Search & Cody
Go to file
Robert Lin a9f2ba5e46
telemetrygateway: support arbitrary privateMetadata types from graphqlbackend (#57741)
The bug fix in #57719 (backported in #57720) fixed support for the common case, a JSON object `privateMetadata`, but the GraphQL schema describes that any valid JSON should be accepted, and GraphQL validation permits primitives like `string`:

![image](https://github.com/sourcegraph/sourcegraph/assets/23356519/657a023c-876a-46dc-a768-eba3af820ef2)

This change improves on #57719 with support for arbitrary types in case they get submitted. Similar to #57719, this is not a customer-affecting bug today as there are no usages, but it is important we land this fix to minimize the impact of this bug as we introduce usages like https://github.com/sourcegraph/cody/pull/1192.

The diff is mostly tests, as the fix is fairly minimal.

## Test plan

- [x] Updated unit tests assert that the GraphQL library we use does indeed accept incoming types as the equivalent Go type in `JSONValue.Value`
- [x] Updated unit tests assert that marshalling of arbitrary types to proto works as expected
- [x] Manual testing with `sg start` demonstrates GraphQL requests with arbitrary `privateMetadata` types are accepted: 
![image](https://github.com/sourcegraph/sourcegraph/assets/23356519/946b9ca2-8afd-479a-833b-85478542454c)
![image](https://github.com/sourcegraph/sourcegraph/assets/23356519/59aea94a-02f5-4ad6-8d1e-633ee091dd37)
![image](https://github.com/sourcegraph/sourcegraph/assets/23356519/fe62e257-1c70-4e46-ab88-4eb445f9009e)
2023-10-19 13:08:59 -07:00
.aspect bzl: update skylib, bazellib, rules_js, rules_rust (#57622) 2023-10-16 11:51:29 +00:00
.buildkite update reference to #discuss-dev-experience channel (#57661) 2023-10-17 10:11:23 +00:00
.github Chore: remove old issue templates (#57710) 2023-10-18 18:42:09 +00:00
.vscode use esbuild for building client/vscode (#57447) 2023-10-08 14:05:37 +09:00
client Make repo settings pages available for uncloned repos (#57609) 2023-10-19 21:15:16 +02:00
cmd telemetrygateway: support arbitrary privateMetadata types from graphqlbackend (#57741) 2023-10-19 13:08:59 -07:00
dev bext: Fix SG button in file page header (#57695) 2023-10-19 17:04:50 +02:00
doc monitoring/telemetry: un-hide panels, improve docstrings (#57740) 2023-10-19 12:52:21 -07:00
docker-images logger: update log lib and remove use of description (#57690) 2023-10-18 17:29:08 +02:00
internal conf: enable Prometheus to sample the lastUpdateTime metric concurrently with the actual config update process (#57747) 2023-10-19 19:14:43 +00:00
lib logger: update log lib and remove use of description (#57690) 2023-10-18 17:29:08 +02:00
migrations Remove tags column from users table (#57660) 2023-10-19 06:27:25 +00:00
monitoring monitoring/telemetry: un-hide panels, improve docstrings (#57740) 2023-10-19 12:52:21 -07:00
schema Make lookAhead optional in Perforce connection config (#57701) 2023-10-19 06:26:08 +00:00
src-tauri Chore: move app scripts out of enterprise (#57388) 2023-10-05 17:52:58 +00:00
testing bzl: bump oci_rules to 1.3.4 (#57013) 2023-09-26 10:23:30 +02:00
third_party local: fix issues when cross-compiling syntax-highlighter to produce a container image on Mac machines (#55969) 2023-08-22 12:46:43 +02:00
third-party-licenses chore: update third-party licenses (#57611) 2023-10-18 15:16:13 +00:00
ui/assets Enable bazel for web-sveltekit and make it available in production builds (#55177) 2023-10-16 14:15:59 +02:00
windows/installer/cody call it "Cody" not "Cody AI" (#56863) 2023-09-21 08:49:02 -05:00
wolfi-images deps: update exporter packages (#57698) 2023-10-18 15:58:40 +00:00
wolfi-packages switching ctags to tagged versions (#57259) 2023-10-02 15:51:20 +00:00
.bazel_fix_commands.json bazel: add command sets that uses bazel under the hood (#48460) 2023-03-02 11:31:51 +01:00
.bazelignore bazelignore storybook static files (#57501) 2023-10-10 09:00:30 +09:00
.bazeliskrc build: update to Aspect CLI 5.5.4 (#54468) 2023-06-29 22:44:05 -07:00
.bazelrc bzl: update skylib, bazellib, rules_js, rules_rust (#57622) 2023-10-16 11:51:29 +00:00
.bazelversion Update bazel to 6.1.1 (#50472) 2023-04-11 10:51:21 +02:00
.browserslistrc web: migrate from yarn to pnpm (#46143) 2023-01-11 19:50:09 -08:00
.dockerignore web: migrate from yarn to pnpm (#46143) 2023-01-11 19:50:09 -08:00
.editorconfig proto: Add editorconfig to ident using two spaces (#57281) 2023-10-03 00:39:42 +00:00
.eslintignore bazel: implement custom ESLint Bazel rule (#52062) 2023-05-22 04:05:45 -07:00
.eslintrc.js Enable bazel for web-sveltekit and make it available in production builds (#55177) 2023-10-16 14:15:59 +02:00
.gitattributes github: show bazel diff again (#54719) 2023-07-07 16:43:45 +00:00
.gitignore rename {webpack => web}.manifest.json (#57449) 2023-10-07 14:02:41 -10:00
.graphqlrc.yml
.hadolint.yaml bump comby version to 1.7.1 (#35830) 2022-05-20 20:12:01 -07:00
.mailmap mailmap: add entries for Eric and Renovate (#50966) 2023-04-25 09:42:22 +02:00
.mocharc.js build: still need BAZEL_BINDIR for webpack_bundle custom rule (#48796) 2023-03-07 20:02:11 -08:00
.npmrc pnpm: remove update notifier message (#51630) 2023-05-10 08:53:39 +02:00
.percy.yml ci: percy defer snapshots upload (#54116) 2023-06-25 18:57:49 -07:00
.pre-commit-config.yaml dev: add a pre-commit hook to searches for tokens (#56499) 2023-09-12 16:20:44 +02:00
.prettierignore Enable bazel for web-sveltekit and make it available in production builds (#55177) 2023-10-16 14:15:59 +02:00
.stylelintignore rework plugin structure and implement frontside blogpost (#46883) 2023-02-15 11:49:51 +02:00
.stylelintrc.json web: drop bootstrap depenedency (#41401) 2022-09-07 03:11:26 -07:00
.tool-versions go: update to 1.20.10 (#57525) 2023-10-12 14:13:46 +02:00
.trivyignore ci: ignore benign CVE-2021-43816 in prometheus (#31069) 2022-02-11 16:49:10 +00:00
babel.config.jest.js bazel: fix the web application bundle in Bazel (#50383) 2023-04-10 21:16:12 -07:00
babel.config.js bazel: fix the web application bundle in Bazel (#50383) 2023-04-10 21:16:12 -07:00
BUILD.bazel migrate to storybook 7 (#57437) 2023-10-07 21:55:42 +00:00
CHANGELOG.app.md update code references to "Sourcegraph App" -> "Cody App" (#56747) 2023-09-19 12:31:12 -10:00
CHANGELOG.md doc/admin/telemetry: telemetry export reference and changelog (#57606) 2023-10-18 08:21:30 -07:00
CODENOTIFY nix: update pnpm hash (#51512) 2023-05-05 12:51:59 +00:00
CONTRIBUTING.md enterprise: Move last directory out (#57392) 2023-10-05 20:15:40 +00:00
deps.bzl logger: update log lib and remove use of description (#57690) 2023-10-18 17:29:08 +02:00
doc.go
eslint-relative-formatter.js bazel: implement custom ESLint Bazel rule (#52062) 2023-05-22 04:05:45 -07:00
flake.lock nix: use go1.21 (#57422) 2023-10-06 18:09:02 +02:00
flake.nix nix: separate nixpkgs-unstable pin from nixpkgs pin for static binaries (#56959) 2023-09-22 17:12:18 +00:00
gen.go chore: Update go-mockgen (#44305) 2022-11-11 19:24:00 +00:00
go.mod logger: update log lib and remove use of description (#57690) 2023-10-18 17:29:08 +02:00
go.sum logger: update log lib and remove use of description (#57690) 2023-10-18 17:29:08 +02:00
graphql-schema-linter.config.js
gulpfile.js Enable bazel for web-sveltekit and make it available in production builds (#55177) 2023-10-16 14:15:59 +02:00
jest.config.base.js bazel: wildcard jest tests (#49282) 2023-03-17 03:38:49 -07:00
jest.config.js tests: use glob for jest projects field (#29681) 2022-01-13 01:11:52 -08:00
jest.snapshot-resolver.js bazel: wildcard jest tests (#49282) 2023-03-17 03:38:49 -07:00
LICENSE relicense all paths other than MIT licensed code, client/cody*, jetbrains, VS code, and browser extension to enterprise (#53345) (#53345) 2023-06-13 10:28:11 -07:00
LICENSE.enterprise
linter_deps.bzl bzl: port go compiler directives linter from sg lint to nogo (#54485) 2023-06-30 14:31:15 +02:00
mockgen.temp.yaml repoupdater: Remove endpoints for external services (#57441) 2023-10-09 13:48:07 +00:00
mockgen.test.yaml gitserver: Introduce subpackages 2023-10-04 21:16:24 +02:00
mockgen.yaml mocks: Reorganize mock definitions into multiple files (#36967) 2022-06-27 20:59:16 +00:00
nogo_config.json gitserver: Replace P4Exec endpoint with properly typed and individually tested RPC calls (#57247) 2023-10-09 15:06:49 +02:00
package.json remove storybook addon-docs (#57497) 2023-10-09 13:24:32 -10:00
pnpm-lock.yaml Enable bazel for web-sveltekit and make it available in production builds (#55177) 2023-10-16 14:15:59 +02:00
pnpm-workspace.yaml cody: development branch (#49761) 2023-03-23 20:41:11 +01:00
postcss.config.js
prettier.config.js clean up Cody CSS to increase shareability and improve display in web app (#50279) 2023-04-03 12:29:05 -07:00
README.md relicense all paths other than MIT licensed code, client/cody*, jetbrains, VS code, and browser extension to enterprise (#53345) (#53345) 2023-06-13 10:28:11 -07:00
renovate.json Require approval to run Renovate (#57608) 2023-10-18 20:36:53 +02:00
SECURITY.md
service-catalog.yaml lib/servicecatalog: init to distribute catalog (#46999) 2023-01-26 17:22:27 -08:00
sg.config.yaml Enable bazel for web-sveltekit and make it available in production builds (#55177) 2023-10-16 14:15:59 +02:00
shell.nix nix: do not manage bazel on MacOS (#57423) 2023-10-06 16:11:34 +00:00
sonar-project.properties Use Buildkite to run Sonarcloud (#54875) 2023-07-21 12:16:03 -04:00
stamp_tags.bzl Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
svgo.config.js Performance: Optimize static SVG assets with SVGO (#26285) 2021-10-27 15:27:36 +01:00
tsconfig.all.json remove cody code that was moved to separate cody repo (#54729) 2023-07-10 00:31:47 -10:00
tsconfig.base.json web: fix pnpm-lock issue (#47478) 2023-02-09 22:04:31 -08:00
tsconfig.eslint.json web: fix pnpm-lock issue (#47478) 2023-02-09 22:04:31 -08:00
WORKSPACE bzl: update skylib, bazellib, rules_js, rules_rust (#57622) 2023-10-16 11:51:29 +00:00

DocsContributingTwitterDiscord

Build status Scorecard Latest release Discord Contributors


Sourcegraph makes it easy to read, write, and fix code—even in big, complex codebases.

  • Code search: Search all of your repositories across all branches and all code hosts.
  • Code intelligence: Navigate code, find references, see code owners, trace history, and more.
  • Fix and refactor: Roll out large-scale changes to many repositories at once and track big migrations.

Getting started



Development

Refer to the Developing Sourcegraph guide to get started.

Documentation

The doc directory has additional documentation for developing and understanding Sourcegraph:

License

This repository contains primarily non-OSS-licensed files, and some OSS licensed files (for example, IDE extensions). We maintain one repository rather than two separate repositories mainly for development convenience.

See the LICENSE for an explanation of how files are licensed.