This commit fixes Maven dependency parsing. Yesterday's fix was
incomplete, in that it kept using a reposource.ParseMavenModule that
needed to be changed to parse dependencies from the DB with the
canonical `:` separator.
We add a backend integration test that exercises this code path to
prevent future regressions.
This caused problems before for oh-my-zsh users in the form of `sg
start` being stuck, because the checks it runs restarted ZSH under the
hood and oh-my-zsh was waiting for user input ("Do you want to update
oh-my-zsh?").
This fixes#33431.
I missed this in the previous commit. We also need to do this for
go-test.
Test Plan: ran the find incantation on both linux and mac. Both agreed
and found all go.mod files.
We had "-type file" which broke since this doesn't work on linux. This
was removed, but now we get a test directory called go.mod matching
which is incorrect. This adds back the find condition, but correctly
works on both mac and linux.
$ diff <(find . -name go.mod -type f) <(find . -name go.mod)
1a2
> ./internal/codeintel/dependencies/internal/lockfiles/testdata/parse/go.mod
Test Plan: ran the find incantation on both linux and mac. Both agreed
and found all go.mod files.
Previously we always set dockerCredentials from the store. However, if
that failed, that means dockerCredentials would become nil. We then
wrote to it. This commit instead uses an intermediate variable.
Note: this may have worked in the past and regressed due to the docker
dependency being updated.
Test Plan: I don't get a panic when releasing 3.39
My last commit failed because I forgot to remove get-started.tsx. Lets
just make this run on all tsx files rather than what seems to be a
fragile allow list.
Test Plan: I will actually test this before landing as described in the
previous commit. I landed due to the main check.
The about repository had a change which moved the version string from
website/src/components/GetStarted.tsx to
website/src/components/Install/index.tsx in b08d333. Without this update
the stage command fails (and is currently failing while I am doing this
release).
Test Plan: running stage command with this commit and it works.
The recent commit which added --reference-if-able assumed we always
cloned sourcegraph/sourcegraph. However, commands such as "yarn release
release:stage" clone the about repo. We didn't fail in those cases, but
by adjusting how we pick the reference we will often get the same
benefits.
Test Plan: dry run without main branch check then ran the release
command.
This drastically speeds up operations for me. Cloning the Sourcegraph
repo takes a minute or two for me thanks to Cape Town being a bit too
far from GitHub's data centers.
Reference will avoid fetching objects that are already in the local
clone. We use the -if-able variant just in case things go wrong, then we
still proceed with the normal clone (if not a little slower).
Test Plan: dry run without main branch check then ran the release
command. Total time was 28s instead of 1m38s.
10 seems like a weird magic number copy pasted from somewhere. The
operations we do on the repo don't seem like they need more than the
latest commit.
Test Plan: dry run for tags and commented out main branch check.
Then ran "yarn release release:create-candidate 3"
This commit removes NPM specific warnings from dependencies
search snippets and modifies the respective search alerts to work for Go
dependency repos too.
Linux users on Slack reported that `sg update` produces this error:
> sg update
error: rename /tmp/sg1226370089/sg /home/fkling/.local/bin/sg: invalid cross-device link
As Geoffrey pointed out:
> rename only works within the same filesystem. I think the implementation should just copy / delete the file instead.
And the [man page for rename](https://linux.die.net/man/2/rename) says:
> oldpath and newpath are not on the same mounted file system. (Linux permits a file system to be mounted at multiple points, but rename() does not work across different mount points, even if the same file system is mounted on both.)
So what this here does is to use code from `gitserver` that does an
in-place update of a file safele. I extracted the code into an
`internal/fileutil` package (couldn't think of a better name).
The code avoids the across-filesystem problem by creating a temp file
next to the destination file. And it also does more things, like making
sure the changes are synced to the filesystem.
Adds a new dependency in `sg setup` that writes the appropriate completion script for your shell into `~/.sourcegraph` and adds a line to your shell config to use the completion script. Completions are generated by `sg` itself, so there is no need to be able to update this script (and if we do need to update it, we can consider a migration path then)
`urfave/cli` completions work by providing command suggestions by default, and if you use `-` <tab><tab> you can get flag completions as well.
Also adds:
1. Custom completions based on config for `sg start`, `sg run`, `sg test`
2. Custom completions based on valid values for`sg live`, `sg ci build`
Cuts the pipeline generation step from ~60s to ~25s - doing a fresh asdf install golang seems significantly faster than using the asdf tools cache.
Together with #33821 , this significantly reduces the time it takes for builds to get to an "actually running" state (~120s -> ~50s)