Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #163 from gobuffalo/development
Browse files Browse the repository at this point in the history
v0.18.6
  • Loading branch information
paganotoni committed May 27, 2022
2 parents b8fdd2e + 7b08785 commit 4ed613d
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v3

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/gobuffalo/logger v1.0.6
github.com/gobuffalo/meta v0.3.1
github.com/gobuffalo/plush/v4 v4.1.11
github.com/gobuffalo/pop/v6 v6.0.3
github.com/gobuffalo/pop/v6 v6.0.4
github.com/gobuffalo/refresh v1.13.1
github.com/google/go-cmp v0.5.8
github.com/markbates/grift v1.5.0
Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ github.com/gobuffalo/pop/v6 v6.0.0/go.mod h1:5rd3OnViLhjteR8+0i/mT9Q4CzkTzCoR7tm
github.com/gobuffalo/pop/v6 v6.0.1/go.mod h1:5NO7ehmyRjRctnbMDhIqKkkg6zvdueufYltxErfp9BU=
github.com/gobuffalo/pop/v6 v6.0.3 h1:nwA/SL7oSCbQRiIYaCSAf53dyp27qsj3PhsuNQkMVbw=
github.com/gobuffalo/pop/v6 v6.0.3/go.mod h1:UJ3ESOX8rKr2leurHKaIFPK61MtUraFqUe+N6t4sftc=
github.com/gobuffalo/pop/v6 v6.0.4 h1:ayJcBapz8usirToDprc7hPwB5AC66SD1ngrnr4RiWBc=
github.com/gobuffalo/pop/v6 v6.0.4/go.mod h1:dFcrMNPOwk+sl1Oa0lOb/jGbmjv+JV+5CZjMWNYR3KI=
github.com/gobuffalo/refresh v1.13.1 h1:P5/F+aGusF2Jg829tVf/SSGBmMyaFQekYGFG+0t90Xw=
github.com/gobuffalo/refresh v1.13.1/go.mod h1:9kiOSpIPMKq67avFt3bkPHYIdzZSAsKwDr6TH5/etNk=
github.com/gobuffalo/tags/v3 v3.0.2/go.mod h1:ZQeN6TCTiwAFnS0dNcbDtSgZDwNKSpqajvVtt6mlYpA=
Expand Down Expand Up @@ -442,6 +444,7 @@ github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ=
github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/luna-duclos/instrumentedsql v1.1.3 h1:t7mvC0z1jUt5A0UQ6I/0H31ryymuQRnJcWCiqV3lSAA=
github.com/luna-duclos/instrumentedsql v1.1.3/go.mod h1:9J1njvFds+zN7y85EDhN9XNQLANWwZt2ULeIC8yMNYs=
github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w=
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/new/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func RunE(cmd *cobra.Command, args []string) error {
}

run.Root = app.Root
if nopts.Force {
if nopts.Force && !nopts.DryRun {
os.RemoveAll(app.Root)
}

Expand Down
18 changes: 18 additions & 0 deletions internal/cmd/new/new_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package new
Expand Down Expand Up @@ -77,6 +78,23 @@ func TestNew(t *testing.T) {
}
}

func TestNewDryRun(t *testing.T) {
r := require.New(t)
r.NoError(testhelpers.EnsureBuffaloCMD(t))

testhelpers.RunWithinTempFolder(t, func(t *testing.T) {
r := require.New(t)
out, err := testhelpers.RunBuffaloCMD(t, []string{"new", "app", "--api", "-f", "--vcs", "none"})
r.Contains(out, "Congratulations", "out: %s", out)
r.NoError(err)
r.DirExists("app")
out, err = testhelpers.RunBuffaloCMD(t, []string{"new", "app", "--api", "-f", "-d", "--vcs", "none"})
r.Contains(out, "Congratulations", "out: %s", out)
r.NoError(err)
r.DirExists("app", "dryrun should not destroy anything but...")
})
}

func TestNewAppAPIContent(t *testing.T) {
r := require.New(t)
r.NoError(testhelpers.EnsureBuffaloCMD(t))
Expand Down
2 changes: 1 addition & 1 deletion internal/plugins/plugdeps/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// bin, module version, and tag
var re = regexp.MustCompile(`.*(buffalo-[^/]+)/?(v[0-9]+)?@?(.*)?`)
var re = regexp.MustCompile(`.*(buffalo-[^/@]+)/?(v[0-9]+)?@?(.*)?`)

// Plugin represents a Go plugin for Buffalo applications
type Plugin struct {
Expand Down
58 changes: 58 additions & 0 deletions internal/plugins/plugdeps/plugin_test.go
Original file line number Diff line number Diff line change
@@ -1 +1,59 @@
package plugdeps

import (
"testing"

"github.com/gobuffalo/meta"
"github.com/stretchr/testify/require"
)

func TestNewPlugin_NoVersionNoTag(t *testing.T) {
r := require.New(t)

p := NewPlugin("example.com/user/buffalo-awesome")
r.Equal("buffalo-awesome", p.key())
r.Equal("buffalo-awesome", p.Binary)
r.Equal("example.com/user/buffalo-awesome@latest", p.GoGet)

r.Equal(meta.BuildTags(nil), p.Tags)
r.Equal(`{"binary":"buffalo-awesome","go_get":"example.com/user/buffalo-awesome@latest"}`, p.String())
}

func TestNewPlugin_BuildTags(t *testing.T) {
r := require.New(t)

p := NewPlugin("example.com/user/buffalo-awesome", meta.BuildTags{"sqlite", "awesome"})
r.Equal("buffalo-awesome", p.key())
r.Equal("buffalo-awesome", p.Binary)
r.Equal("example.com/user/buffalo-awesome@latest", p.GoGet)

r.Equal(meta.BuildTags{"sqlite", "awesome"}, p.Tags)
r.Equal(`{"binary":"buffalo-awesome","go_get":"example.com/user/buffalo-awesome@latest","tags":["sqlite","awesome"]}`, p.String())
}

func TestNewPlugin_NoVersionTag(t *testing.T) {
r := require.New(t)

p := NewPlugin("example.com/user/buffalo-awesome@v3.1")
r.Equal("buffalo-awesome", p.key())
r.Equal("buffalo-awesome", p.Binary)
r.Equal("example.com/user/buffalo-awesome@v3.1", p.GoGet)
}

func TestNewPlugin_VersionNoTag(t *testing.T) {
r := require.New(t)

p := NewPlugin("example.com/user/buffalo-awesome/v3")
r.Equal("buffalo-awesome", p.key())
r.Equal("buffalo-awesome", p.Binary)
r.Equal("example.com/user/buffalo-awesome/v3@latest", p.GoGet)
}

func TestNewPlugin_VersionTag(t *testing.T) {
r := require.New(t)

p := NewPlugin("example.com/user/buffalo-awesome/v3@v3.1")
r.Equal("buffalo-awesome", p.key())
r.Equal("buffalo-awesome", p.Binary)
r.Equal("example.com/user/buffalo-awesome/v3@v3.1", p.GoGet)
}
2 changes: 1 addition & 1 deletion internal/plugins/plugdeps/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (plugs *Plugins) Decode(r io.Reader) error {
tp := &tomlPlugins{
Plugins: []Plugin{},
}
if _, err := toml.DecodeReader(r, tp); err != nil {
if _, err := toml.NewDecoder(r).Decode(tp); err != nil {
return err
}
for _, p := range tp.Plugins {
Expand Down
2 changes: 1 addition & 1 deletion internal/runtime/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package runtime

// Version is the current version of the buffalo binary
var Version = "v0.18.4"
var Version = "v0.18.6"

0 comments on commit 4ed613d

Please sign in to comment.