Skip to content

Commit 3239d07

Browse files
committed
Merge branch 'main' into 6828-support-ephemeral-parameters
2 parents de38911 + e088303 commit 3239d07

28 files changed

+348
-356
lines changed

Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,22 +622,23 @@ site/.eslintignore site/.prettierignore: .prettierignore Makefile
622622
echo "$${ignore}$${rule}" >> "$@"
623623
done < "$<"
624624

625-
test: test-clean
626-
gotestsum --format standard-quiet -- -v -short ./...
625+
test:
626+
gotestsum --format standard-quiet -- -v -short -count=1 ./...
627627
.PHONY: test
628628

629629
# When updating -timeout for this test, keep in sync with
630630
# test-go-postgres (.github/workflows/coder.yaml).
631631
# Do add coverage flags so that test caching works.
632-
test-postgres: test-clean test-postgres-docker
632+
test-postgres: test-postgres-docker
633633
# The postgres test is prone to failure, so we limit parallelism for
634634
# more consistent execution.
635635
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum \
636636
--junitfile="gotests.xml" \
637637
--jsonfile="gotests.json" \
638638
--packages="./..." -- \
639639
-timeout=20m \
640-
-failfast
640+
-failfast \
641+
-count=1
641642
.PHONY: test-postgres
642643

643644
test-postgres-docker:
@@ -668,6 +669,14 @@ test-postgres-docker:
668669
done
669670
.PHONY: test-postgres-docker
670671

672+
# Make sure to keep this in sync with test-go-race from .github/workflows/ci.yaml.
673+
test-race:
674+
gotestsum --junitfile="gotests.xml" -- -race -count=1 ./...
675+
.PHONY: test-race
676+
677+
# Note: we used to add this to the test target, but it's not necessary and we can
678+
# achieve the desired result by specifying -count=1 in the go test invocation
679+
# instead. Keeping it here for convenience.
671680
test-clean:
672681
go clean -testcache
673682
.PHONY: test-clean

agent/agentssh/agentssh.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ func (s *Server) startPTYSession(session ptySession, magicTypeLabel string, cmd
358358
}
359359
}
360360

361-
if !isQuietLogin(session.RawCommand()) {
361+
if !isQuietLogin(s.fs, session.RawCommand()) {
362362
manifest := s.Manifest.Load()
363363
if manifest != nil {
364364
err := showMOTD(s.fs, session, manifest.MOTDFile)
@@ -763,7 +763,7 @@ func isLoginShell(rawCommand string) bool {
763763
// isQuietLogin checks if the SSH server should perform a quiet login or not.
764764
//
765765
// https://github.com/openssh/openssh-portable/blob/25bd659cc72268f2858c5415740c442ee950049f/session.c#L816
766-
func isQuietLogin(rawCommand string) bool {
766+
func isQuietLogin(fs afero.Fs, rawCommand string) bool {
767767
// We are always quiet unless this is a login shell.
768768
if !isLoginShell(rawCommand) {
769769
return true
@@ -776,7 +776,7 @@ func isQuietLogin(rawCommand string) bool {
776776
return false
777777
}
778778

779-
_, err = os.Stat(filepath.Join(homedir, ".hushlogin"))
779+
_, err = fs.Stat(filepath.Join(homedir, ".hushlogin"))
780780
return err == nil
781781
}
782782

coderd/apidoc/docs.go

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/db2sdk/db2sdk.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ func TemplateVersionParameter(param database.TemplateVersionParameter) (codersdk
7575
ValidationError: param.ValidationError,
7676
ValidationMonotonic: codersdk.ValidationMonotonicOrder(param.ValidationMonotonic),
7777
Required: param.Required,
78-
LegacyVariableName: param.LegacyVariableName,
7978
}, nil
8079
}
8180

coderd/database/dbfake/dbfake.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3966,8 +3966,11 @@ func (q *fakeQuerier) InsertTemplateVersionParameter(_ context.Context, arg data
39663966
ValidationMonotonic: arg.ValidationMonotonic,
39673967
Required: arg.Required,
39683968
DisplayOrder: arg.DisplayOrder,
3969+
<<<<<<< HEAD
39693970
LegacyVariableName: arg.LegacyVariableName,
39703971
Ephemeral: arg.Ephemeral,
3972+
=======
3973+
>>>>>>> main
39713974
}
39723975
q.templateVersionParameters = append(q.templateVersionParameters, param)
39733976
return param, nil

coderd/database/dump.sql

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- Unfortunately we can't bring back deleted values.
2+
3+
ALTER TABLE template_version_parameters ADD COLUMN legacy_variable_name text NOT NULL DEFAULT '';
4+
5+
COMMENT ON COLUMN template_version_parameters.legacy_variable_name IS 'Name of the legacy variable for migration purposes';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE template_version_parameters DROP COLUMN legacy_variable_name;

coderd/database/models.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)