Commit Graph

3869 Commits

Author SHA1 Message Date
Kyle Carberry a461bc1454
test: Increase disconnectTimeout to reduce test flakes (#26)
* test: Increase disconnectTimeout to reduce test flakes

WebRTC uses UDP, which means a network connection is never open or closed. It uses timeouts to determine connection state; on a slow CI runner, these timeouts could be reached. Increasing this timeout should reduce flakes, but is unlikely to remove this flake entirely.

* Fix close after offline

* Run tests in parallel
2022-01-14 10:12:07 -06:00
Bryan 423611b001
chore: Add initial jest tests + code coverage (#13)
- Adds initial infra for running front-end tests (`jest`, `ts-jest`, `jest.config.js`, etc)
- Adds codecov integration front-end code
2022-01-13 18:48:23 -08:00
Kyle Carberry afc2fa3b62
feat: Add Coder Daemon to serve the API (#18)
* feat: Add v1 schema types

This adds compatibility for sharing data with Coder v1. Since the tables are the same, all CRUD operations should function as expected.

* Add license table

* feat: Add Coder Daemon to serve the API

coderd is a public package which will be consumed by v1 to support running both at the same time. The frontend will need to be compiled and statically served as part of this eventually.

* Fix initial migration

* Move to /api/v2

* Increase peer disconnectedTimeout to reduce flakes on slow machines

* Reduce timeout again

* Fix version for pion/ice
2022-01-13 16:55:28 -06:00
Kyle Carberry 4308f169d6
fix: Lock when obtaining a peer connection answer<->offer (#24)
* fix: Lock when obtaining a peer connection answer<->offer

This fixes a race in the peerbroker package where ICE candidates could be added before the connection was negotiated. This would result in the connection failing.

* Remove unnecessary log
2022-01-13 15:02:22 -06:00
Kyle Carberry 550c4fbbb3
ci: Run tests 3 times to reduce flakes (#20)
* ci: Run tests 10 times to reduce flakes

* Reduce runs to 3

* Use forked dependency

* Fix formatting
2022-01-13 12:05:39 -06:00
Bryan 92710ede54
chore: Add caching for node_modules (#19) 2022-01-13 09:11:52 -08:00
Bryan ace89161fb
feat(cdr): Initial UI scaffolding
This is testing out [Approach 3](https://www.notion.so/coderhq/Workspaces-v2-Initial-UI-Scaffolding-3b07d2847eed48839a7e6f0f2bb9bf56#56256f25d2954897a8ee315f0820cedd) in the UI scaffolding RFC.

Fixes https://github.com/coder/coder/issues/11

The folder structure looks like:
- `site`
    - `components` (buttons, empty state, etc)
    - `pages` (large sections of UI -> composition of components)
    - `theme` (files defining our palette)

Several components were able to be brought in essentially unmodified:
- `SplitButton`
- `EmptyState`
- `Footer`
-  All the icons / logos
- Theming (removed several items that aren't necessary, yet, though)

Other components had more coupling, and need more refactoring:
- `NavBar`
- `Confetti`

Current State:

![2022-01-06 17 16 31](https://user-images.githubusercontent.com/88213859/148475521-96e080cc-1d33-4b8e-a434-29e388936e3f.gif)

For a full working app, there's potentially a lot more to bring in:
- User / Account Settings Stuff
- Users Page
- Organizations Page
(and all the supporting dependencies)
2022-01-12 14:25:12 -08:00
Kyle Carberry 0778f3e738
feat: Add v1 schema types (#17)
* feat: Add v1 schema types

This adds compatibility for sharing data with Coder v1. Since the tables are the same, all CRUD operations should function as expected.

* Add license table
2022-01-12 12:04:11 -06:00
Bryan ec3685bc14
chore: Add documentation of our phased approach to the UX (#15) 2022-01-11 13:05:49 -08:00
Kyle Carberry 53cfa8a45a
feat: Create broker for negotiating connections (#14)
* feat: Create broker for negotiating connections

WebRTC require an exchange of encryption keys and network hops to connect. This package pipes the exchange over gRPC. This will be used in all connecting clients and agents.

* Regenerate protobuf definition

* Cache Go build and test

* Fix gRPC language with dRPC

Co-authored-by: Bryan <bryan@coder.com>

Co-authored-by: Bryan <bryan@coder.com>
2022-01-11 09:28:41 -06:00
Kyle Carberry 7c260f88d1
feat: Create provisioner abstraction (#12)
* feat: Create provisioner abstraction

Creates a provisioner abstraction that takes prior art from the Terraform plugin system. It's safe to assume this code will change a lot when it becomes integrated with provisionerd.

Closes #10.

* Ignore generated files in diff view

* Check for unstaged file changes

* Install protoc-gen-go

* Use proper drpc plugin version

* Fix serve closed pipe

* Install sqlc with curl for speed

* Fix install command

* Format CI action

* Add linguist-generated and closed pipe test

* Cleanup code from comments

* Add dRPC comment

* Add Terraform installer for cross-platform

* Build provisioner tests on Linux only
2022-01-08 11:24:02 -06:00
Bryan 2769f4c2e0
chore: Formatting - bring .prettierrc over from cdr/m (#9)
This brings over the same `.prettierrc` we used in `cdr/m`, and runs the formatter w/ the new settings
2022-01-06 13:02:05 -08:00
Bryan 3a3161aa63
chore: Add semantic pull requests (#5)
Add a semantic-pull-requests configuration (like we have for `coder/m`), to validate commit messages.
2022-01-06 12:49:40 -08:00
Kyle Carberry 2618ce4694
chore: Add pubsub (#7)
* chore: Add pubsub

Exposes new in-memory and PostgreSQL pubsubs. This will be used for negotiating WebRTC connections.

* Don't run PostgreSQL tests on non-Linux
2022-01-06 08:35:44 -06:00
Kyle Carberry 8accb815e1
chore: Add peer package for networking (#6)
This package was pulled straight from github.com/coder/m. Nothing has been changed.

It will be used for networking clients<->workspaces, and coderd<->provisionerd.
2022-01-05 11:18:29 -06:00
Kyle Carberry 025b55f7be
chore: Initial database scaffolding (#2)
* chore: Initial database scaffolding

This implements migrations and code generation for interfacing with a PostgreSQL database.

A dependency is added for the "postgres" binary on the host, but that seems like an acceptable requirement considering it's our primary database.

An in-memory database object can be created for simple cross-OS and fast testing.

* Run tests in CI

* Use Docker instead of binaries on the host

* Skip database tests on non-Linux operating systems

* chore: Add golangci-lint and codecov

* Use consistent file names
2022-01-05 09:20:56 -06:00
Kyle Carberry a6b2dd76a0
chore: Add golangci-lint and codecov (#3)
* chore: Add golangci-lint and codecov

* Use consistent file names

* Format settings.json

* Add golangci-lint and codecov GitHub Actions

* Add base Go file for linting

* Add test coverage
2022-01-05 08:48:56 -06:00
Bryan 78973eaf3f
chore: Initial GHA workflow (#1)
This implements an initial GitHub Actions workflow for us - to be run on PRs and on `main` commits.

This just implements a really simple `style/fmt` check - running `prettier` on the `README.md`.

I assumed we'll stick with using a top-level `Makefile` for commands like in `m` and `link` - but open to alternatives, too!

Since I was adding a `package.json` and `node_modules` for this, I realized we were missing `.gitignore`s, so I added some a subset of the ignore files from `coder/m`
2022-01-03 18:54:27 -08:00
Bryan Phelps 8203bf0d2d
chore: Initial README 2022-01-03 18:52:07 +00:00