Commit Graph

60 Commits

Author SHA1 Message Date
Jean-Hadrien Chabran
486a30d8d1
bzl: bump src-cli to 5.2.0 (#57989) 2023-10-31 13:42:29 +00:00
Jean-Hadrien Chabran
0ac93dadfe
bzl: fix schema.go not being up todate and still passing (#57308) 2023-10-03 16:40:23 +02:00
Jean-Hadrien Chabran
588463afbb
bzl: bazelify docsite and doc/cli/reference generation (#54538)
This PR is on top of #54517 

---

This PR rework how we handle the docsite and some of its related tasks: 

- While we _could_ avoid committing the generated files to disk, the way
that docsite currently works, requires to have all files available in
git, so the docsite can serve various versions.
- `bazel run //doc/cli/references:write_doc_files` handles this (and
it's umbreall `//dev:write_all_generated`.
- Its generation is now handled by `//doc/cli/references:generate_doc`
and its associated test.
- `sg run docsite` now calls `bazel run //doc:serve`, we don't need to
install the docsite directly anymore (but it's available under `bazel
run //dev/tools:docsite` if needed).

As a byproduct, we can now run `src-cli` with `bazel run
//dev/tools:src-cli` which will pick the correct binary for your machine
transparently.

## Test plan

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

Locally tested + CI
2023-07-03 16:12:44 +02:00
Jean-Hadrien Chabran
33f3021b01
bzl: wrap docsite check into //doc:test (#54376)
Shaves about 30/40s from `sg lint` where docs are detected as well as
all builds on `main`, as doc changes are pretty rare, and we're
unecessarily testing those in every commit reaching `main`.

## Test plan

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

Locally tested + CI
2023-06-28 21:00:54 +02:00
Sander Ginn
09c0e2941e
Revert "v5.1.0 bake constants and static content" (#53753)
Reverts sourcegraph/sourcegraph#53718

This broke main because `src-cli` 5.1.0 is not yet released on its GH
release page, but executor docker images are trying to download this
release already.

## Test plan
CI go green
2023-06-20 12:52:26 +00:00
Joe Chen
8d940c6021
v5.1.0 bake constants and static content (#53718)
This pull request was automatically generated by the release-tool.
Bake constants and static content into version v5.1.0.
## Test Plan:
N/A
2023-06-20 08:20:41 +02:00
Erzhan Torokulov
bb3b0c36ee
docs(src-cli): update src-cli commands to use 'metadata' instead of 'kvp' for consistency and clarity (#51031) 2023-04-24 15:05:21 +06:00
coury-clark
7e5ac7aafe
v5.0.0 bake constants and static content (#49257)
This pull request was automatically generated by the release-tool.
Bake constants and static content into version v5.0.0.
## Test Plan:
N/A
2023-03-13 14:49:37 -07:00
coury-clark
93c73da2c6
release-tool: automate src-cli release in sourcegraph major and minor releases (#48511)
Closes
https://github.com/orgs/sourcegraph/projects/240?pane=issue&itemId=18474973

This PR does a few things:
1. Automates the significant versions (major / minor) src-cli release 
2. Automates the src-cli changelog
3. Provides a command to validate all distribution channels have the
updated version

There is some sequencing trouble in how src-cli is released that is
worth explaining here. So when we perform a release of sourcegraph we
also bake in a minimum src-cli version constant, as well as the
documentation for that version of src-cli. This documentation is
actually generated from the src-cli tool itself, and naively requires
the latest version is available on github.

That's something I don't want to interrupt the release process, so in
this PR we do something slightly different. First, we assume that the
head of main is the release commit, which is reasonable since we are the
ones performing the release. Second, we checkout src-cli and use the
local checkout to bake the documentation into the sourcegraph release.
Third, we perform the src-cli release by tagging the build and pushing
the tag.

To do that this PR also adds a new optional flag into the go program
that installs the software to pass a local path instead of downloading
the latest release.

For some quality of life we autodetect the latest src-cli version from
the src-cli repo instead of assuming it's always the same as the
Sourcegraph version. This is just to hedge against any future
divergence.

Here is an example
[PR](https://github.com/sourcegraph/sourcegraph/pull/48573) after
running the update command (the diff won't necessarily reflect a real
diff)

Using the validate command we can check that github, brew, and npm all
have the latest release that matches the expected version.

## Test plan

To test this I had to do a few janky things:

1. replace the clone path with a constant src-cli path (I just cloned it
once, then grabbed the directory)
2. replace the actual ./release.sh script with something that won't
release. I just edited the script to echo and return early after all the
validations in the same repo above

Here is the output showing the diff and the release script

<img width="1112" alt="image"
src="https://user-images.githubusercontent.com/5090588/222289405-bc1a0632-6af0-4e72-b883-a1cf786f0aec.png">


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

To test verify-src-cli simply run the command:
<img width="953" alt="CleanShot 2023-03-02 at 11 35 35@2x"
src="https://user-images.githubusercontent.com/5090588/222552782-72ae3e9f-03dd-4433-9a2b-7356df33849c.png">

And finally a minified example of the full flow
<img width="944" alt="CleanShot 2023-03-02 at 13 55 11@2x"
src="https://user-images.githubusercontent.com/5090588/222552934-7b49aa80-a2ad-4f54-9f27-ab8bf3d1408a.png">
2023-03-03 08:29:38 -07:00
Bolaji Olajide
712db97b9d
batches: bump src-cli constant for 4.5 release (#47670) 2023-02-15 19:02:29 +01:00
Jacob Pleiness
24e5ce9059
Docs: update docs for src validate command to add new kube subcommand (#46794)
* Update docs for `src validate kube` command

* Fix types in docs

* Add `deleteWhenDone` to example configs
2023-01-25 09:38:23 -05:00
Jean-Hadrien Chabran
bc5490c4bb
bazel: introduce build files for Go (#46770) 2023-01-23 14:00:01 +01:00
Naman Kumar
c779796f64
[Org Members] Add pagination (#46067)
- Add pagination to org members page
- Improve UI by adding avatar and user role
- Remove version of org members page which was available under a feature flag but not used.
2023-01-17 12:25:22 +01:00
Naman Kumar
202a984759
Add pagination to saved searches pages (#45705)
* [Saved Searches] add pagination 
* [Search Page] remove old home panels
2023-01-05 21:11:42 +05:30
Quinn Slack
80024726b7
remove extension registry UI and related GraphQL API (#45891)
Removes the extension registry UI and the GraphQL API that is necessary for the registry extension UI.

Any extensions that already exist locally or remotely can still be used with the enableLegacyExtensions site config flag and by enabling the extensions in your user settings.

This change is an intermediate step toward removing the extension registry (except the endpoint that's needed to support pre-4.0 Sourcegraph instances).

I think this PR has a 99% chance of going into the 4.4 release (2023-01-20) and not needing to be reverted. Subsequent PRs that actually make it impossible to use local or custom legacy extensions are still pending customer communication and confirmation. I hope we can merge other future PRs there as well, but there is a greater chance we'd need to revert them before 4.4. By making this PR first, it means less of a revert and more progress regardless of what we learn from customers.
2022-12-22 00:10:56 -08:00
Stephen Gutekanst
2a2278f45f
all: introduce sourcegraph/blobstore; add option to cmd/server (#44255)
* all: add new sg blobstore backend to supersede minio
* cmd/server: optionally run sg blobstore backend over minio
* lsifuploadstore: add minio back to help text
* sg generate
* uploadstore: add DeleteObjects / NewListObjectsV2Paginator to s3API interface
* uploadstore: regenerate mocks
* uploadstore: add gcsAPI.Objects listing API
* uploadstore: regenerate mocks
* uploadstore: add Store.ExpireObjects stub implementation (thanks eric)
* uploadstore: implement ExpireObjects in GCS/S3/Lazy interfaces
* worker: integrate lsifuploadstore expirer
* uploadstore: update test API calls
* uploadstore: add TODO for myself
* uploadstore: batch S3 object deletions
* uploadstore: use operation logger instead of log15
* cmd/server: use sglog
* cmd/server: fix image build

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
2022-11-30 16:04:48 -07:00
Kelli Rockwell
617d185782
Bump src-cli minimum version (#44043) 2022-11-07 20:03:48 +00:00
Varun Gandhi
b82d88c705
chore: Bump src-cli dependency + regenerate docs. (#42685) 2022-10-07 08:36:10 +00:00
Eric Fritz
3a163e7685
lint: Fix main (#40581) 2022-08-18 18:41:31 +00:00
Erzhan Torokulov
b4f1c8102d
admin-analytics: add user administration backend API endpoints (#39926)
* Add "site.users" GraphQL API query endpoint
* Add "invalidateSessionsByUserIDs" GraphQL API bulk mutation endpoint
* Add "deleteUsers" GraphQL API bulk mutation endpoint. It handles both hard and soft deletion of users, similar to the existing mutation "deleteUser" API endpoint.
2022-08-05 17:18:21 +06:00
Maria Craig
39b43b5604
Renaming code intel test (#39509)
rename docs
2022-07-27 19:12:07 +02:00
Eric Fritz
8cd586d708
migration: Add -noop-privileged flag (#38687) 2022-07-13 12:41:25 -05:00
Erik Seliger
35e8a6f64a
Bump src-cli version to 3.41.1 (#38577) 2022-07-11 17:47:01 +00:00
Erik Seliger
0c2ed651b4
Bump src-cli for 3.41.0 release (#37376) 2022-06-17 11:54:29 +00:00
Erik Seliger
9f067eac53
Use native executor git repo support in SSBC (#36230)
This PR turns on repo cloning in executors for batch changes. It clones the repo into the workspace, adds cache files and the input and spawns the execution from that. [This requires a change in src-cli](https://github.com/sourcegraph/src-cli/pull/768) and makes the repo fetching process faster, more resilient (in my testing) and enables to run on the largest repos without bigger problems. Also, we have a grafana dashboard for executor cloning performance.

**Stats for nerds**

Ran on my Mac: 

---

120 workspaces total, some of them are workspaces in subdirectories with `onlyFetchWorkspaces` on.
Total execution time: Before: 03:35 minutes, after: 01:09 minutes.
Also, in the 03:35 minute run the mac would start heating up a lot, it stayed mostly cool in the 01:09 minute run.

---

sgtest/megarepo:
Setting up the workspace before: ~8 minutes, now 2 minutes.

---

Also, see this: https://github.com/sourcegraph/sourcegraph/pull/37299 PR; it's the follow-up for post-3.41 cut to remove the access_token_id column from the database as well.
2022-06-16 18:01:42 +02:00
Taras Yemets
8e6e5701aa
extensions: update docs for the air-gapped instances (#37186) 2022-06-15 11:01:43 +03:00
Ólafur Páll Geirsson
eea9e6ade9
Update to the latest src-cli release (#36050) 2022-05-25 20:06:26 +00:00
Keegan Carruthers-Smith
18f487ccaa
all: use any instead of interface{} (#35102)
Now that we require go1.18, we can use a builtin type alias for
"interface{}": "any". I've updated all code except lib, which can be
imported by external modules. That is currently pinned at go1.16.
Additionally I had to rerun generate since rewriting generated go code
will fail CI.

  find -name '*.go' | xargs gofmt -s -r 'interface{} -> any' -w
  git checkout lib
  go generate ./...

Test Plan: CI will exercise that the code still compiles. Otherwise this
is a noop.
2022-05-09 10:59:39 +02:00
Keegan Carruthers-Smith
2b8bf443f3
doc/cli: use latest release of src-cli (#34931)
go1.18 doesn't support go get to install a binary anymore. go install
still doesn't work due to the replace directive. So I have over
engineered something which instead fetches the latest release of src-cli
and runs that.

Test Plan: go generate ./doc/cli/references
2022-05-05 05:43:35 +02:00
Varun Gandhi
9929d37a16
Bump src-cli version to 3.39.2 for new release. (#34854) 2022-05-04 05:55:31 -07:00
topebali
e71c33eb55
Update upload md (#34062) 2022-04-19 15:35:24 +01:00
Erik Seliger
6ed6520917
Bump src-cli to latest release (#33902) 2022-04-14 14:23:44 +02:00
Pietrorosa77
5ebe697aae
[CloudSaas] - Send reactivate account link for locked accounts (#33810)
* reset account link

* added unit tests to unlock account url generation

* fixed lint and prettier issues

* fixing mock for handle sign in test

* fixed linter error

* comment iteration on PR

* comment iteration on PR

* comment iteration on PR

* comment iteration on PR

* renamed it
2022-04-13 17:07:50 +02:00
Erik Seliger
16636267ce
Bump src-cli version for 3.38 release (#32724) 2022-03-17 14:09:52 +01:00
Varun Gandhi
73e054d477
Spell npm consistently. (#32575)
- Spelled as Npm or NPM depending on local case convention.
  For local variables and in types, Npm should be preferred.
  For fully uppercase spellings, NPM should be used.
- Default to spelling it as npm otherwise.

This matches the convention in the npm/cli code and the
recommendation in the npm/cli README.
2022-03-14 12:38:09 -07:00
Pietrorosa77
5c63b28ad8
Adding user search autocomplete to new org member invitation (#31994)
* added search users autocomplete API

* added autocomplete control first version

* autocomplete user search

* fixed styles

* optimized ux while loading search results

* fixed css lint

* added db test for autocomplete search

* moved method into org membership

* reverted md file

* added ut
2022-03-02 17:20:16 +01:00
Camden Cheek
4239fe8a45
GraphQL: remove deprecated resultCount field (#31573)
The resultCount field was marked as deprecated back in 2019, but is
still seeing new uses. This removes remaining references to it and
removes it since all clients should now be using `matchCount`.
2022-02-21 12:03:36 -07:00
Adam Harvey
9841a334de
cli: update for 3.36.4 (#31097) 2022-02-11 12:27:18 -08:00
Eric Fritz
7148009913
errors: Introduce internal package (#30558) 2022-02-07 15:03:45 +00:00
Erik Seliger
da76710a6b
Bump src-cli version to latest (#30743) 2022-02-07 15:54:30 +01:00
Kelli Rockwell
0a6f2c886c
Bump src-cli to latest release (#29667) 2022-01-12 16:06:10 -08:00
Noah S-C
1eed8d765c
fix main (#27507) 2021-11-12 14:45:55 +00:00
Erik Seliger
05eee6210f
Bump src-cli version (#27394) 2021-11-11 09:28:46 +01:00
Keegan Carruthers-Smith
5b5ef282ef
doc: references generator does not have build tag (#26277)
This confuses some tools since you end up with a main package with no
main function. I don't really see the point of having the ignore build
tag, since it won't run unless someone explicitly runs it.

Additionally I remove gen.go since we can just have the go generate
command inside of the file.
2021-10-20 07:14:17 +02:00
Thorsten Ball
195e44d87e
Bump src-cli min version to 3.32.0 and re-gen docs (#25108) 2021-09-20 14:15:32 +00:00
Camden Cheek
e102d21ce2
build with go 1.17 (#24566)
Upgrade our tool versions to build with go 1.17. Additionally, fix the new linting errors that come along with that.
2021-09-03 14:46:55 +00:00
Erik Seliger
7fb093a897
Bump src cli version for 3.31 release (#24089) 2021-08-18 23:53:35 +02:00
Adam Harvey
9e38d89d1b
src-cli: update for 3.30.5 (#23870) 2021-08-12 16:54:57 -07:00
Erik Seliger
8bbd7718dc
Bump src cli version and update cli docs (#22968) 2021-07-19 15:40:48 +02:00
Indradhanush Gupta
a1075bf6b8
all: Replace github.com/pkg/errors with github.com/cockroachdb/errors (#21684)
In this commit, along with moving to
github.com/cockroachdb/errors, we update a few tests and some
error checks in non-test code.

List of files that have code changes apart from changes in the
error package import:

    enterprise/internal/batches/sources/gitlab.go
    enterprise/internal/batches/sources/gitlab_test.go
    internal/conf/client.go
    internal/store/store_test.go

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <joe@sourcegraph.com>
2021-06-11 13:49:21 +05:30