feat(coderd): add provisioner build version and api_version on serve (#11369)

* assert provisioner daemon version and api_version in unit tests
* add build info in HTTP header, extract codersdk.BuildVersionHeader
* add api_version to codersdk.ProvisionerDaemon
* testutil.MustString -> testutil.MustRandString
This commit is contained in:
Cian Johnston
2024-01-03 09:01:57 +00:00
committed by GitHub
parent 9031b498ea
commit 1ef96022b0
22 changed files with 97 additions and 34 deletions

17
testutil/rand.go Normal file
View File

@ -0,0 +1,17 @@
package testutil
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/coder/coder/v2/cryptorand"
)
// MustRandString returns a random string of length n.
func MustRandString(t *testing.T, n int) string {
t.Helper()
s, err := cryptorand.String(n)
require.NoError(t, err)
return s
}