diff --git a/cli/configssh.go b/cli/configssh.go index f618418e5d303..db344ed6c2a7a 100644 --- a/cli/configssh.go +++ b/cli/configssh.go @@ -7,7 +7,6 @@ import ( "fmt" "io" "io/fs" - "net/http" "os" "path/filepath" "runtime" @@ -456,15 +455,7 @@ func (r *RootCmd) configSSH() *serpent.Command { coderdConfig, err := client.SSHConfiguration(ctx) if err != nil { - // If the error is 404, this deployment does not support - // this endpoint yet. Do not error, just assume defaults. - // TODO: Remove this in 2 months (May 31, 2023). Just return the error - // and remove this 404 check. - var sdkErr *codersdk.Error - if !xerrors.As(err, &sdkErr) || sdkErr.StatusCode() != http.StatusNotFound { - return xerrors.Errorf("fetch coderd config failed: %w", err) - } - coderdConfig.HostnamePrefix = "coder." + return xerrors.Errorf("fetch coderd config failed: %w", err) } configOptions, err := mergeSSHOptions(sshConfigOpts, coderdConfig, string(root), coderBinary) diff --git a/coderd/httpmw/organizationparam.go b/coderd/httpmw/organizationparam.go index 349ffe25e6c93..089188b9c91df 100644 --- a/coderd/httpmw/organizationparam.go +++ b/coderd/httpmw/organizationparam.go @@ -66,16 +66,9 @@ func ExtractOrganizationParam(db database.Store) func(http.Handler) http.Handler var organization database.Organization var dbErr error - // If the name is exactly "default", then we fetch the default - // organization. This is a special case to make it easier - // for single org deployments. - // - // arg == uuid.Nil.String() should be a temporary workaround for - // legacy provisioners that don't provide an organization ID. - // This prevents a breaking change. - // TODO: This change was added March 2024. Nil uuid returning the - // default org should be removed some number of months after - // that date. + // If the name is exactly "default" or the nil UUID, then we fetch + // the default organization. This is a special case to make it + // easier for single org deployments. if arg == codersdk.DefaultOrganization || arg == uuid.Nil.String() { organization, dbErr = db.GetDefaultOrganization(ctx) } else { diff --git a/coderd/httpmw/organizationparam_test.go b/coderd/httpmw/organizationparam_test.go index 5ebbc429e1587..3d12e805847ce 100644 --- a/coderd/httpmw/organizationparam_test.go +++ b/coderd/httpmw/organizationparam_test.go @@ -228,10 +228,7 @@ func TestOrganizationParam(t *testing.T) { defer res.Body.Close() require.Equal(t, http.StatusOK, res.StatusCode, "by default keyword") - // Try by legacy - // TODO: This can be removed when legacy nil uuids are no longer supported. - // This is a temporary measure to ensure as legacy provisioners use - // nil uuids as the org id and expect the default org. + // Try by nil uuid, which resolves to the default org. chi.RouteContext(r.Context()).URLParams.Add("organization", uuid.Nil.String()) chi.RouteContext(r.Context()).URLParams.Add("user", user.ID.String()) rtr.ServeHTTP(rw, r) diff --git a/coderd/wsbuilder/wsbuilder.go b/coderd/wsbuilder/wsbuilder.go index 45071f0ccbeaf..16cac866d695f 100644 --- a/coderd/wsbuilder/wsbuilder.go +++ b/coderd/wsbuilder/wsbuilder.go @@ -1394,9 +1394,5 @@ func (b *Builder) usingDynamicParameters() bool { if err != nil { return false // Let another part of the code get this error } - if tpl.UseClassicParameterFlow { - return false - } - - return true + return !tpl.UseClassicParameterFlow } diff --git a/codersdk/users.go b/codersdk/users.go index c784c13e8c916..98925146c89f6 100644 --- a/codersdk/users.go +++ b/codersdk/users.go @@ -2,7 +2,6 @@ package codersdk import ( "context" - "encoding/json" "fmt" "net/http" "strconv" @@ -165,26 +164,7 @@ type CreateFirstUserResponse struct { OrganizationID uuid.UUID `json:"organization_id" format:"uuid"` } -// CreateUserRequest -// Deprecated: Use CreateUserRequestWithOrgs instead. This will be removed. -// TODO: When removing, we should rename CreateUserRequestWithOrgs -> CreateUserRequest -// Then alias CreateUserRequestWithOrgs to CreateUserRequest. -// @typescript-ignore CreateUserRequest type CreateUserRequest struct { - Email string `json:"email" validate:"required,email" format:"email"` - Username string `json:"username" validate:"required,username"` - Name string `json:"name" validate:"user_real_name"` - Password string `json:"password"` - // UserLoginType defaults to LoginTypePassword. - UserLoginType LoginType `json:"login_type"` - // DisableLogin sets the user's login type to 'none'. This prevents the user - // from being able to use a password or any other authentication method to login. - // Deprecated: Set UserLoginType=LoginTypeDisabled instead. - DisableLogin bool `json:"disable_login"` - OrganizationID uuid.UUID `json:"organization_id" validate:"" format:"uuid"` -} - -type CreateUserRequestWithOrgs struct { Email string `json:"email" validate:"required_unless=ServiceAccount true,omitempty,email" format:"email"` Username string `json:"username" validate:"required,username"` Name string `json:"name" validate:"user_real_name"` @@ -201,33 +181,7 @@ type CreateUserRequestWithOrgs struct { Roles []string `json:"roles,omitempty"` } -// UnmarshalJSON implements the unmarshal for the legacy param "organization_id". -// To accommodate multiple organizations, the field has been switched to a slice. -// The previous field will just be appended to the slice. -// Note in the previous behavior, omitting the field would result in the -// default org being applied, but that is no longer the case. -// TODO: Remove this method in it's entirety after some period of time. -// This will be released in v1.16.0, and is associated with the multiple orgs -// feature. -func (r *CreateUserRequestWithOrgs) UnmarshalJSON(data []byte) error { - // By using a type alias, we prevent an infinite recursion when unmarshalling. - // This allows us to use the default unmarshal behavior of the original type. - type AliasedReq CreateUserRequestWithOrgs - type DeprecatedCreateUserRequest struct { - AliasedReq - OrganizationID *uuid.UUID `json:"organization_id" format:"uuid"` - } - var dep DeprecatedCreateUserRequest - err := json.Unmarshal(data, &dep) - if err != nil { - return err - } - *r = CreateUserRequestWithOrgs(dep.AliasedReq) - if dep.OrganizationID != nil { - r.OrganizationIDs = append(r.OrganizationIDs, *dep.OrganizationID) - } - return nil -} +type CreateUserRequestWithOrgs = CreateUserRequest type UpdateUserProfileRequest struct { Username string `json:"username" validate:"required,username"` diff --git a/provisioner/terraform/testdata/timings-aggregation/fake-terraform.sh b/provisioner/terraform/testdata/timings-aggregation/fake-terraform.sh index 582df28c62161..96a310a59388b 100755 --- a/provisioner/terraform/testdata/timings-aggregation/fake-terraform.sh +++ b/provisioner/terraform/testdata/timings-aggregation/fake-terraform.sh @@ -123,9 +123,6 @@ function terraform_apply() { EOL } -# TODO: remove -echo "$@" >>/tmp/blah - case "$1" in version) terraform_version