Age | Commit message (Collapse) | Author |
|
These tests know nothing of object hashes and so are safe to run.
|
|
Also expand reach of Markdown linting to more files
|
|
With recent changes `gofmt` [1] started reformatting godoc comments.
This causes a problem wherein it reformats `//nolint: staticcheck` to
`// nolint: staticcheck`.
But it does ignore directives [2]. So let's change all our nolint to
directive format. This avoids the conflict with `gofmt`.
This fix was done by running `grep -r --include="*.go" -E "//nolint:
.*"` and manually fixing the issues.
[1]:
https://github.com/golangci/golangci-lint/issues/1658#issuecomment-1183148066
[2]:
https://github.com/golangci/golangci-lint/issues/3098#issuecomment-1214364533
|
|
We're about to add the ability to test with SHA256 hashes. We assume
none of the tests work with this object format.
With this change we add the build constraint to not run any test when
the tag 'gitaly_test_sha256' is set.
|
|
This commit changes the major version in the package name from v14 to
v15
Updating go.mod & go.sum with new module name v15
Update Makefile to bump major version to v15
Update the gitaly package name in the Makefile. Also update
gitaly-git2go-v14 -> gitaly-git2go-v15. We need to keep
gitaly-git2go-v14 for a release however, for zero downtime upgrades.
This pulls directly from a sha that is v14.
Update package name from v14->v15 for auth, client, cmd, internal packages
This commit changes the package name from v14 to v15 in go and proto
files in the internal, auth, client, cmd packages.
proto: Update major package number in package name
tools: Change major version number in package name from v14 to v15
gitaly-git2go: Change the package name from v14 to v15
update module updater for v15
Update the documentation for the module updater to reflect v15
|
|
testhelper.Context() currently return a cancellation function as a
second return value. Majority of the tests do not need to explicitly
cancel the context but they simply defer its cancellation to clean up
after the test. Given this, we can reduce the test verbosity and make
testhelper.Context easier to compose by removing the unnecessary second
return value. This adds a t.Cleanup function to automatically cancel the
context at the end of the tests and omits the returned cancellation
function.
Tests which simply `defer cancel()` have had the extra call removed. Some
tests explicitly call the cancellation, and these tests have been modified
to add context.WithCancel around the testhelper.Context call. There are a
few loctions where testing.TB was passed down to test helpers that create the
context.
|
|
We're about to disallow use of "normal" contexts created via the
`context` package given that they do not perform sanity checks for
feature flags. Instead, contexts should be created via the testhelper
package.
Convert tests to use the testhelper context.
|
|
Reformat sources with gofumpt.
|
|
It is not common to use snake case names for packages
and package aliases in Go.
The change renames aliases to a preferred single word name.
We also use 'gitaly' prefix for the project-defined packages
that clashes with standard or 3-rd party package names.
|
|
|
|
We're currently missing error checks for various invocations of
`Write()` functions. Fix this issue by properly checking returned errors
and drop the corresponding linter ignore rule.
|
|
In order to support our ldflags hack which was removed in the preceding
commit, we had separate variables for the token validation string and
the actual duration. This was done so that one could pass a `-X` flag to
the linker in order to override the string value and parse it into the
real duration at initialization time. But given that we don't use that
hack anymore, it's now useless.
Let's remove this infrastructure now and just use the timeout directly.
|
|
Right now, it's not possible to modify the duration for which a token is
valid outside of the `auth` package, but in fact we do rely on being
able to do so in the authentication tests in `internal/gitaly/server`.
As it's not possible to modify it via code, we instead rely on modifying
its value via the Go's `-X` linker flag, which is quite awkward.
This commit introduces a new function `SetTokenValidityDuration()` which
allows us to fix this weirdness.
|
|
The `timestampThreshold` records how long a token is going to stay valid
for authentication purposes. It's not quite obvious going by its name,
so let's rename it to `tokenValidityDuration` to hopefullymake its
purpose a bit more obvious.
|
|
|
|
Removal of `RPCCredentials` as it was completely the same
implementation as `RPCCredentialsV2`.
Fix all places where `RPCCredentials` was used.
Removal of `v1` token representation check and validation.
Closes: https://gitlab.com/gitlab-org/gitaly/-/issues/2498
|
|
New linter 'unconvert' reports about unneeded type conversions.
|
|
`unused` linter was enabled to report about unused code.
Unused code removed.
|
|
This change swaps V1 authentication with V2 without the caller knowing
it did. This allows for a smooth transition toward V2.
Idea taken from: https://gitlab.com/gitlab-org/gitaly/issues/2498#note_293995290
|
|
|
|
|
|
|
|
Leveraging `go fix` these changes were made, I only applied some regexp
to get the import grouping correct.
The old package can't be removed from vendor directory yet, as other
dependencies depend on it.
|
|
|
|
|
|
|
|
|