Skip to content

feat: Add templates to create working release #422

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 47 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
94e5069
Add templates
kylecarbs Mar 10, 2022
688ab17
Move API structs to codersdk
kylecarbs Mar 10, 2022
8cee1fb
Back to green tests!
kylecarbs Mar 11, 2022
11e1d99
It all works, but now with tea! 🧋
kylecarbs Mar 11, 2022
b23a58c
It works!
kylecarbs Mar 11, 2022
c01b8f7
Add cancellation to provisionerd
kylecarbs Mar 13, 2022
99c8eb1
Tests pass!
kylecarbs Mar 13, 2022
6b4c8b5
Add deletion of workspaces and projects
kylecarbs Mar 13, 2022
21c3d1c
Fix agent lock
kylecarbs Mar 14, 2022
8d24602
Add clog
kylecarbs Mar 14, 2022
cfffbe5
Fix linting errors
kylecarbs Mar 14, 2022
926e59e
Remove unused CLI tests
kylecarbs Mar 14, 2022
1c9e124
Rename daemon to start
kylecarbs Mar 14, 2022
fdc17ee
Merge branch 'main' into workflow
kylecarbs Mar 14, 2022
2b9a849
Fix leaking command
kylecarbs Mar 14, 2022
f895d1f
Fix promptui test
kylecarbs Mar 14, 2022
72bc74c
Update agent connection frequency
kylecarbs Mar 15, 2022
e79f9b0
Skip login tests on Windows
kylecarbs Mar 15, 2022
8165782
Merge branch 'main' into workflow
kylecarbs Mar 15, 2022
55a0160
Increase tunnel connect timeout
kylecarbs Mar 15, 2022
6e53335
Merge branch 'main' into workflow
kylecarbs Mar 15, 2022
6ac95bf
Fix templater
kylecarbs Mar 15, 2022
b4c2aed
Merge branch 'workflow' of github.com:coder/coder into workflow
kylecarbs Mar 15, 2022
369c4a0
Merge branch 'workflow' of github.com:coder/coder into workflow
kylecarbs Mar 15, 2022
1402a08
Merge branch 'workflow' of github.com:coder/coder into workflow
kylecarbs Mar 15, 2022
c7dfb51
Lower test requirements
kylecarbs Mar 15, 2022
1005371
Fix embed
kylecarbs Mar 15, 2022
5677f22
Disable promptui tests for Windows
kylecarbs Mar 15, 2022
52e4d99
Fix write newline
kylecarbs Mar 15, 2022
82bceec
Fix PTY write newline
kylecarbs Mar 15, 2022
df885f5
Merge branch 'main' into workflow
kylecarbs Mar 15, 2022
749d1ac
Fix CloseReader
kylecarbs Mar 16, 2022
8bc5c1a
Fix compilation on Windows
kylecarbs Mar 16, 2022
53d489e
Fix linting error
kylecarbs Mar 16, 2022
c8ae865
Merge branch 'main' into workflow
kylecarbs Mar 16, 2022
def36fa
Remove bubbletea
kylecarbs Mar 16, 2022
fc8c950
Cleanup readwriter
kylecarbs Mar 16, 2022
2cc902f
Use embedded templates instead of serving over API
kylecarbs Mar 16, 2022
8146d00
Move templates to examples
kylecarbs Mar 17, 2022
5190438
Improve workspace create flow
kylecarbs Mar 18, 2022
fe925a3
Fix Windows build
kylecarbs Mar 18, 2022
4fa89d4
Fix tests
kylecarbs Mar 20, 2022
c2a7119
Fix linting errors
kylecarbs Mar 20, 2022
091fead
Merge branch 'main' into workflow
kylecarbs Mar 20, 2022
f482a85
Fix untar with extracting max size
kylecarbs Mar 21, 2022
9e29a51
Fix newline char
kylecarbs Mar 22, 2022
aa267e6
Merge branch 'main' into workflow
kylecarbs Mar 22, 2022
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
Prev Previous commit
Next Next commit
Cleanup readwriter
  • Loading branch information
kylecarbs committed Mar 16, 2022
commit fc8c9505291ce85ecd9599dde13dbf01ecd96770
5 changes: 2 additions & 3 deletions cli/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

func TestLogin(t *testing.T) {
t.Parallel()

t.Run("InitialUserNoTTY", func(t *testing.T) {
t.Parallel()
client := coderdtest.New(t, nil)
Expand All @@ -29,7 +28,7 @@ func TestLogin(t *testing.T) {
// accurately detect Windows ptys when they are not attached to a process:
// https://github.com/mattn/go-isatty/issues/59
doneChan := make(chan struct{})
root, _ := clitest.New(t, "login", client.URL.String())
root, _ := clitest.New(t, "login", "--force-tty", client.URL.String())
pty := ptytest.New(t)
root.SetIn(pty.Input())
root.SetOut(pty.Output())
Expand Down Expand Up @@ -61,7 +60,7 @@ func TestLogin(t *testing.T) {
coderdtest.CreateFirstUser(t, client)

doneChan := make(chan struct{})
root, _ := clitest.New(t, "login", client.URL.String(), "--no-open")
root, _ := clitest.New(t, "login", "--force-tty", client.URL.String(), "--no-open")
pty := ptytest.New(t)
root.SetIn(pty.Input())
root.SetOut(pty.Output())
Expand Down
2 changes: 1 addition & 1 deletion cli/projectcreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func projectCreate() *cobra.Command {
provisioner string
)
cmd := &cobra.Command{
Use: "create",
Use: "create <name>",
Short: "Create a project from the current directory",
RunE: func(cmd *cobra.Command, args []string) error {
client, err := createClient(cmd)
Expand Down
5 changes: 0 additions & 5 deletions cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/cli/config"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/pty"
)

var (
Expand Down Expand Up @@ -142,10 +141,6 @@ func isTTY(cmd *cobra.Command) bool {
if forceTty && err == nil {
return true
}
_, ok := cmd.InOrStdin().(pty.ReadWriter)
if ok {
return true
}
file, ok := cmd.InOrStdin().(*os.File)
if !ok {
return false
Expand Down
9 changes: 3 additions & 6 deletions pty/pty.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ type PTY interface {
// uses the output stream for writing.
//
// The same stream could be read to validate output.
Output() ReadWriter
Output() io.ReadWriter

// Input handles TTY input.
//
// cmd.SetInput(pty.Input()) would be used to specify a command
// uses the PTY input for reading.
//
// The same stream would be used to provide user input: pty.Input().Write(...)
Input() ReadWriter
Input() io.ReadWriter

// Resize sets the size of the PTY.
Resize(cols uint16, rows uint16) error
Expand All @@ -33,10 +33,7 @@ func New() (PTY, error) {
return newPty()
}

// ReadWriter implements io.ReadWriter, but is intentionally avoids
// using the interface to allow for direct access to the reader or
// writer. This is to enable a caller to grab file descriptors.
type ReadWriter struct {
type readWriter struct {
io.Reader
io.Writer
}
14 changes: 5 additions & 9 deletions pty/pty_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
package pty

import (
"io"
"os"
"sync"

"github.com/creack/pty"
"github.com/muesli/cancelreader"
)

func newPty() (PTY, error) {
Expand All @@ -28,15 +28,15 @@ type otherPty struct {
pty, tty *os.File
}

func (p *otherPty) Input() ReadWriter {
return ReadWriter{
func (p *otherPty) Input() io.ReadWriter {
return readWriter{
Reader: p.tty,
Writer: p.pty,
}
}

func (p *otherPty) Output() ReadWriter {
return ReadWriter{
func (p *otherPty) Output() io.ReadWriter {
return readWriter{
Reader: p.pty,
Writer: p.tty,
}
Expand Down Expand Up @@ -66,7 +66,3 @@ func (p *otherPty) Close() error {
}
return nil
}

func (rw ReadWriter) CancelReader() (cancelreader.CancelReader, error) {
return cancelreader.NewReader(rw.Reader)
}
12 changes: 4 additions & 8 deletions pty/pty_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ type ptyWindows struct {
closed bool
}

func (p *ptyWindows) Output() ReadWriter {
return ReadWriter{
func (p *ptyWindows) Output() io.ReadWriter {
return readWriter{
Reader: p.outputRead,
Writer: p.outputWrite,
}
}

func (p *ptyWindows) Input() ReadWriter {
return ReadWriter{
func (p *ptyWindows) Input() io.ReadWriter {
return readWriter{
Reader: p.inputRead,
Writer: p.inputWrite,
}
Expand Down Expand Up @@ -108,7 +108,3 @@ func (p *ptyWindows) Close() error {

return nil
}

func (rw ReadWriter) CancelReader() (cancelreader.CancelReader, error) {
return nil, xerrors.New("not implemented")
}