Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: replace todos with issues #1066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ endif
.PHONY: fmt/prettier

fmt/sql: $(wildcard coderd/database/queries/*.sql)
# TODO: this is slightly slow
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for fi in coderd/database/queries/*.sql; do \
npx sql-formatter \
--language postgresql \
Expand Down
2 changes: 0 additions & 2 deletions agent/usershell/usershell_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package usershell
import "os"

// Get returns the $SHELL environment variable.
// TODO: This should use "dscl" to fetch the proper value. See:
// https://stackoverflow.com/questions/16375519/how-to-get-the-default-shell
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func Get(username string) (string, error) {
return os.Getenv("SHELL"), nil
}
2 changes: 1 addition & 1 deletion cli/workspaceautostart.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func workspaceAutostart() *cobra.Command {
Short: "schedule a workspace to automatically start at a regular time",
Long: autostartDescriptionLong,
Example: "coder workspaces autostart enable my-workspace --minute 30 --hour 9 --days 1-5 --tz Europe/Dublin",
Hidden: true, // TODO(cian): un-hide when autostart scheduling implemented
Hidden: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

autostartCmd.AddCommand(workspaceAutostartEnable())
Expand Down
2 changes: 1 addition & 1 deletion cli/workspaceautostop.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func workspaceAutostop() *cobra.Command {
Short: "schedule a workspace to automatically stop at a regular time",
Long: autostopDescriptionLong,
Example: "coder workspaces autostop enable my-workspace --minute 0 --hour 18 --days 1-5 -tz Europe/Dublin",
Hidden: true, // TODO(cian): un-hide when autostop scheduling implemented
Hidden: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

autostopCmd.AddCommand(workspaceAutostopEnable())
Expand Down
3 changes: 0 additions & 3 deletions coderd/rbac/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ type Role struct {
Name string `json:"name"`
Site []Permission `json:"site"`
// Org is a map of orgid to permissions. We represent orgid as a string.
// TODO: Maybe switch to uuid, but tokens might need to support a "wildcard" org
// which could be a special uuid (like all 0s?)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Org map[string][]Permission `json:"org"`
User []Permission `json:"user"`
}
Expand Down Expand Up @@ -49,7 +47,6 @@ var (
RoleAuditor = Role{
Name: "auditor",
Site: permissions(map[Object][]Action{
// TODO: @emyrk when audit logs are added, add back a read perm
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//ResourceAuditLogs: {ActionRead},
// Should be able to read user details to associate with logs.
// Without this the user-id in logs is not very helpful
Expand Down
6 changes: 3 additions & 3 deletions peer/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ func (c *Channel) Write(bytes []byte) (n int, err error) {
if c.dc.BufferedAmount()+uint64(len(bytes)) >= maxBufferedAmount {
<-c.sendMore
}
// TODO (@kyle): There's an obvious race-condition here.
// This is an edge-case, as most-frequently data won't
// be pooled so synchronously, but is definitely possible.
// REMARK: There's an obvious race-condition here. This is an edge-case, as
// most-frequently data won't be pooled so synchronously, but is
// definitely possible.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//
// See: https://github.com/pion/sctp/issues/181
time.Sleep(time.Microsecond)
Expand Down
7 changes: 5 additions & 2 deletions site/e2e/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ interface WaitForClientSideNavigationOpts {
* @remark This is necessary in a client-side SPA world since playwright
* waitForNavigation waits for load events on the DOM (ex: after a page load
* from the server).
*
* @todo Better logging for this.
*/
export const waitForClientSideNavigation = async (page: Page, opts: WaitForClientSideNavigationOpts): Promise<void> => {
console.info(`--- waitForClientSideNavigation: start`)

await Promise.all([
waitFor(() => {
const conditions: boolean[] = []
Expand All @@ -74,9 +74,12 @@ export const waitForClientSideNavigation = async (page: Page, opts: WaitForClien
}

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

return Promise.resolve(unmetConditions.length === 0)
}),
page.waitForLoadState("networkidle"),
])

console.info(`--- waitForClientSideNavigation: done`)
}
2 changes: 0 additions & 2 deletions site/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ func secureHeaders(next http.Handler) http.Handler {

// Only scripts can manipulate the dom. This prevents someone from
// naming themselves something like '<svg onload="alert(/cross-site-scripting/)" />'.
// TODO: @emyrk we need to make FE changes to enable this. We get 'TrustedHTML' and 'TrustedURL' errors
// that require FE changes to work.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// "require-trusted-types-for" : []string{"'script'"},
}

Expand Down
11 changes: 3 additions & 8 deletions site/src/components/Form/FormTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface FormTextFieldProps<T>
* }}
* />
*/
eventTransform?: (value: string) => unknown
eventTransform?: (value: string) => string
/**
* isPassword uses a PasswordField component when `true`; otherwise a
* TextField component is used.
Expand Down Expand Up @@ -145,13 +145,8 @@ export const FormTextField = <T,>({
}

const event = e
if (typeof eventTransform !== "undefined") {
// TODO(Grey): Asserting the type as a string here is not quite
// right in that when an input is of type="number", the value will
// be a number. Type asserting is better than conversion for this
// reason, but perhaps there's a better way to do this without any
// assertions.
event.target.value = eventTransform(e.target.value) as string
if (typeof eventTransform !== "undefined" && typeof event.target.value === "string") {
event.target.value = eventTransform(e.target.value)
}
form.handleChange(event)
}}
Expand Down
5 changes: 2 additions & 3 deletions site/src/pages/templates/[organization]/[template]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ export const TemplatePage: React.FC = () => {
() => `/api/v2/organizations/${unsafeSWRArgument(organizationInfo).id}/templates/${templateName}`,
)

// TODO: The workspaces endpoint was recently changed, so that we can't get
// workspaces per-template. This just grabs all workspaces... and then
// later filters them to match the current template.
// This just grabs all workspaces... and then later filters them to match the
// current template.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { data: workspaces, error: workspacesError } = useSWR<Workspace[], Error>(() => `/api/v2/users/me/workspaces`)

if (organizationError) {
Expand Down