Skip to content

Commit 5ce0676

Browse files
authored
chore: replace todos with issues (coder#1066)
1 parent 04985a1 commit 5ce0676

File tree

10 files changed

+15
-26
lines changed

10 files changed

+15
-26
lines changed

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ endif
3535
.PHONY: fmt/prettier
3636

3737
fmt/sql: $(wildcard coderd/database/queries/*.sql)
38-
# TODO: this is slightly slow
3938
for fi in coderd/database/queries/*.sql; do \
4039
npx sql-formatter \
4140
--language postgresql \

agent/usershell/usershell_darwin.go

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package usershell
33
import "os"
44

55
// Get returns the $SHELL environment variable.
6-
// TODO: This should use "dscl" to fetch the proper value. See:
7-
// https://stackoverflow.com/questions/16375519/how-to-get-the-default-shell
86
func Get(username string) (string, error) {
97
return os.Getenv("SHELL"), nil
108
}

cli/workspaceautostart.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func workspaceAutostart() *cobra.Command {
2222
Short: "schedule a workspace to automatically start at a regular time",
2323
Long: autostartDescriptionLong,
2424
Example: "coder workspaces autostart enable my-workspace --minute 30 --hour 9 --days 1-5 --tz Europe/Dublin",
25-
Hidden: true, // TODO(cian): un-hide when autostart scheduling implemented
25+
Hidden: true,
2626
}
2727

2828
autostartCmd.AddCommand(workspaceAutostartEnable())

cli/workspaceautostop.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func workspaceAutostop() *cobra.Command {
2222
Short: "schedule a workspace to automatically stop at a regular time",
2323
Long: autostopDescriptionLong,
2424
Example: "coder workspaces autostop enable my-workspace --minute 0 --hour 18 --days 1-5 -tz Europe/Dublin",
25-
Hidden: true, // TODO(cian): un-hide when autostop scheduling implemented
25+
Hidden: true,
2626
}
2727

2828
autostopCmd.AddCommand(workspaceAutostopEnable())

coderd/rbac/role.go

-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ type Role struct {
2020
Name string `json:"name"`
2121
Site []Permission `json:"site"`
2222
// Org is a map of orgid to permissions. We represent orgid as a string.
23-
// TODO: Maybe switch to uuid, but tokens might need to support a "wildcard" org
24-
// which could be a special uuid (like all 0s?)
2523
Org map[string][]Permission `json:"org"`
2624
User []Permission `json:"user"`
2725
}
@@ -49,7 +47,6 @@ var (
4947
RoleAuditor = Role{
5048
Name: "auditor",
5149
Site: permissions(map[Object][]Action{
52-
// TODO: @emyrk when audit logs are added, add back a read perm
5350
//ResourceAuditLogs: {ActionRead},
5451
// Should be able to read user details to associate with logs.
5552
// Without this the user-id in logs is not very helpful

peer/channel.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ func (c *Channel) Write(bytes []byte) (n int, err error) {
245245
if c.dc.BufferedAmount()+uint64(len(bytes)) >= maxBufferedAmount {
246246
<-c.sendMore
247247
}
248-
// TODO (@kyle): There's an obvious race-condition here.
249-
// This is an edge-case, as most-frequently data won't
250-
// be pooled so synchronously, but is definitely possible.
248+
// REMARK: There's an obvious race-condition here. This is an edge-case, as
249+
// most-frequently data won't be pooled so synchronously, but is
250+
// definitely possible.
251251
//
252252
// See: https://github.com/pion/sctp/issues/181
253253
time.Sleep(time.Microsecond)

site/e2e/util.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ interface WaitForClientSideNavigationOpts {
5757
* @remark This is necessary in a client-side SPA world since playwright
5858
* waitForNavigation waits for load events on the DOM (ex: after a page load
5959
* from the server).
60-
*
61-
* @todo Better logging for this.
6260
*/
6361
export const waitForClientSideNavigation = async (page: Page, opts: WaitForClientSideNavigationOpts): Promise<void> => {
62+
console.info(`--- waitForClientSideNavigation: start`)
63+
6464
await Promise.all([
6565
waitFor(() => {
6666
const conditions: boolean[] = []
@@ -74,9 +74,12 @@ export const waitForClientSideNavigation = async (page: Page, opts: WaitForClien
7474
}
7575

7676
const unmetConditions = conditions.filter((condition) => !condition)
77+
console.info(`--- waitForClientSideNavigation: ${unmetConditions.length} conditions not met`)
7778

7879
return Promise.resolve(unmetConditions.length === 0)
7980
}),
8081
page.waitForLoadState("networkidle"),
8182
])
83+
84+
console.info(`--- waitForClientSideNavigation: done`)
8285
}

site/embed.go

-2
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,6 @@ func secureHeaders(next http.Handler) http.Handler {
270270

271271
// Only scripts can manipulate the dom. This prevents someone from
272272
// naming themselves something like '<svg onload="alert(/cross-site-scripting/)" />'.
273-
// TODO: @emyrk we need to make FE changes to enable this. We get 'TrustedHTML' and 'TrustedURL' errors
274-
// that require FE changes to work.
275273
// "require-trusted-types-for" : []string{"'script'"},
276274
}
277275

site/src/components/Form/FormTextField.tsx

+3-8
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export interface FormTextFieldProps<T>
6262
* }}
6363
* />
6464
*/
65-
eventTransform?: (value: string) => unknown
65+
eventTransform?: (value: string) => string
6666
/**
6767
* isPassword uses a PasswordField component when `true`; otherwise a
6868
* TextField component is used.
@@ -145,13 +145,8 @@ export const FormTextField = <T,>({
145145
}
146146

147147
const event = e
148-
if (typeof eventTransform !== "undefined") {
149-
// TODO(Grey): Asserting the type as a string here is not quite
150-
// right in that when an input is of type="number", the value will
151-
// be a number. Type asserting is better than conversion for this
152-
// reason, but perhaps there's a better way to do this without any
153-
// assertions.
154-
event.target.value = eventTransform(e.target.value) as string
148+
if (typeof eventTransform !== "undefined" && typeof event.target.value === "string") {
149+
event.target.value = eventTransform(e.target.value)
155150
}
156151
form.handleChange(event)
157152
}}

site/src/pages/templates/[organization]/[template]/index.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ export const TemplatePage: React.FC = () => {
2525
() => `/api/v2/organizations/${unsafeSWRArgument(organizationInfo).id}/templates/${templateName}`,
2626
)
2727

28-
// TODO: The workspaces endpoint was recently changed, so that we can't get
29-
// workspaces per-template. This just grabs all workspaces... and then
30-
// later filters them to match the current template.
28+
// This just grabs all workspaces... and then later filters them to match the
29+
// current template.
3130
const { data: workspaces, error: workspacesError } = useSWR<Workspace[], Error>(() => `/api/v2/users/me/workspaces`)
3231

3332
if (organizationError) {

0 commit comments

Comments
 (0)