Skip to content

Commit

Permalink
Merge pull request #29 from fasmat/feature/upgrade-pop
Browse files Browse the repository at this point in the history
Upgrade pop dependency
  • Loading branch information
paganotoni authored Nov 24, 2021
2 parents 91a3771 + fb4053e commit 5273af5
Show file tree
Hide file tree
Showing 23 changed files with 709 additions and 1,154 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
23 changes: 12 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
name: Release
on:
create:
tags:
- v*.*.*
release:
types:
- published

jobs:
release:
name: Release
runs-on: ubuntu-latest
container:
image: bepsays/ci-goreleaser:1.13-4
steps:
- name: Checkout Code
uses: actions/checkout@master
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
go-version: 1.17
id: go

- name: Checkout Code
uses: actions/checkout@v2

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
uses: goreleaser/goreleaser-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
with:
Expand Down
40 changes: 25 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
name: Tests
on: [push]
jobs:
on:
push:
branches:
- main
pull_request:

tests-on:
name: ${{matrix.go-version}} ${{matrix.os}}
jobs:
tests-off:
name: ${{ matrix.os }} - Go v${{ matrix.go-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.12.x, 1.13.x]
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout Code
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Test
run: |
go mod tidy -v
go test -tags sqlite -race ./...
go-version:
- "1.16.x"
- "1.17.x"
os:
- "macos-latest"
- "windows-latest"
- "ubuntu-latest"

steps:
- uses: actions/checkout@v2
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Test
run: |
go mod tidy -v
go test -tags "sqlite" -cover ./...
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
test:
packr2 clean
go test -tags sqlite -failfast -short -cover ./...
packr2
go mod tidy -v

cov:
packr2 clean
go test -short -coverprofile cover.out ./...
go tool cover -html cover.out
packr2
go mod tidy -v

install:
packr2 clean
packr2
go install -v .

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ This is the home for all things that combine [Buffalo](https://github.com/gobuff
## Installation

```bash
$ go get -u -v github.com/gobuffalo/buffalo-pop/v2
go install github.com/gobuffalo/buffalo-pop/v3@latest
```

Or with SQLite 3 support:

```bash
$ go get -tags sqlite -u -v github.com/gobuffalo/buffalo-pop/v2
go get -tags sqlite -v github.com/gobuffalo/buffalo-pop/v3
```

## Transaction Middleware
Expand All @@ -30,7 +30,7 @@ The `popmw.Transaction` will wrap each request inside of a new database transact
First you need to add the middleware to your application giving it access to your `*pop.Connection`, typically found at `models.DB`.

```go
import "github.com/gobuffalo/buffalo-pop/v2/pop/popmw"
import "github.com/gobuffalo/buffalo-pop/v3/pop/popmw"

func App() *buffalo.App {
// ...
Expand Down
7 changes: 0 additions & 7 deletions SHOULDERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ github.com/gobuffalo/buffalo-pop does not try to reinvent the wheel! Instead, it

Thank you to the following **GIANTS**:


* [cloud.google.com/go](https://godoc.org/cloud.google.com/go)

* [dmitri.shuralyov.com/app/changes](https://godoc.org/dmitri.shuralyov.com/app/changes)
Expand Down Expand Up @@ -149,12 +148,6 @@ Thank you to the following **GIANTS**:

* [github.com/gobuffalo/nulls](https://godoc.org/github.com/gobuffalo/nulls)

* [github.com/gobuffalo/packd](https://godoc.org/github.com/gobuffalo/packd)

* [github.com/gobuffalo/packr](https://godoc.org/github.com/gobuffalo/packr)

* [github.com/gobuffalo/packr/v2](https://godoc.org/github.com/gobuffalo/packr/v2)

* [github.com/gobuffalo/plush](https://godoc.org/github.com/gobuffalo/plush)

* [github.com/gobuffalo/plushgen](https://godoc.org/github.com/gobuffalo/plushgen)
Expand Down
6 changes: 3 additions & 3 deletions cmd/available.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"encoding/json"
"os"

"github.com/gobuffalo/buffalo-pop/v2/cmd/destroy"
"github.com/gobuffalo/pop/v5"
"github.com/gobuffalo/pop/v5/logging"
"github.com/gobuffalo/buffalo-pop/v3/cmd/destroy"
"github.com/gobuffalo/pop/v6"
"github.com/gobuffalo/pop/v6/logging"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/destroy.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/gobuffalo/buffalo-pop/v2/cmd/destroy"
"github.com/gobuffalo/buffalo-pop/v3/cmd/destroy"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/pop.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/gobuffalo/pop/v5/soda/cmd"
"github.com/gobuffalo/pop/v6/soda/cmd"
)

// popCmd represents the pop command
Expand Down
8 changes: 0 additions & 8 deletions genny/newapp/newapp-packr.go

This file was deleted.

22 changes: 17 additions & 5 deletions genny/newapp/newapp.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
package newapp

import (
"embed"
"io/fs"

"github.com/gobuffalo/genny/v2"
"github.com/gobuffalo/genny/v2/plushgen"
"github.com/gobuffalo/packr/v2"
"github.com/gobuffalo/plush/v4"
"github.com/gobuffalo/pop/v5"
"github.com/gobuffalo/pop/v5/genny/config"
"github.com/gobuffalo/pop/v6"
"github.com/gobuffalo/pop/v6/genny/config"
)

var AvailableDialects = pop.AvailableDialects

//go:embed templates/*
var templates embed.FS

func New(opts *Options) (*genny.Group, error) {
gg := &genny.Group{}

if err := opts.Validate(); err != nil {
return gg, err
}

sub, err := fs.Sub(templates, "templates")
if err != nil {
return gg, err
}

g := genny.New()
g.Box(packr.New("github.com/gobuffalo/buffalo-pop/v2/genny/newapp/templates", "../newapp/templates"))
if err := g.FS(sub); err != nil {
return gg, err
}

ctx := plush.NewContext()
ctx.Set("opts", opts)
Expand All @@ -28,7 +40,7 @@ func New(opts *Options) (*genny.Group, error) {

gg.Add(g)

g, err := config.New(&config.Options{
g, err = config.New(&config.Options{
Dialect: opts.Dialect,
Prefix: opts.Prefix,
FileName: "database.yml",
Expand Down
2 changes: 1 addition & 1 deletion genny/newapp/newapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/gobuffalo/genny/v2/gentest"
"github.com/gobuffalo/pop/v5"
"github.com/gobuffalo/pop/v6"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion genny/newapp/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"strings"

"github.com/gobuffalo/pop/v5"
"github.com/gobuffalo/pop/v6"
)

type Options struct {
Expand Down
2 changes: 1 addition & 1 deletion genny/newapp/templates/models/models.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"log"

"github.com/gobuffalo/envy"
"github.com/gobuffalo/pop/v5"
"github.com/gobuffalo/pop/v6"
)

// DB is a connection to your database to be used
Expand Down
4 changes: 2 additions & 2 deletions genny/newapp/templates/models/models_test.go.plush
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package models

import (
"os"
"testing"

"github.com/gobuffalo/packr/v2"
"github.com/gobuffalo/suite"
)

Expand All @@ -12,7 +12,7 @@ type ModelSuite struct {
}

func Test_ModelSuite(t *testing.T) {
model, err := suite.NewModelWithFixtures(packr.New("app:models:test:fixtures","../fixtures"))
model, err := suite.NewModelWithFixtures(os.DirFS("fixtures"))
if err != nil {
t.Fatal(err)
}
Expand Down
31 changes: 14 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
module github.com/gobuffalo/buffalo-pop/v2
module github.com/gobuffalo/buffalo-pop/v3

go 1.13
go 1.16

require (
github.com/fatih/color v1.9.0
github.com/gobuffalo/buffalo v0.15.5
github.com/gobuffalo/events v1.4.1
github.com/gobuffalo/flect v0.2.1
github.com/gobuffalo/genny/v2 v2.0.5
github.com/gobuffalo/httptest v1.5.0
github.com/gobuffalo/packr/v2 v2.8.0
github.com/gobuffalo/plush/v4 v4.0.0
github.com/gobuffalo/pop/v5 v5.3.0
github.com/gofrs/uuid v3.2.0+incompatible
github.com/markbates/errx v1.1.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.6
github.com/stretchr/testify v1.5.1
github.com/fatih/color v1.13.0
github.com/gobuffalo/buffalo v0.18.0
github.com/gobuffalo/events v1.4.2
github.com/gobuffalo/flect v0.2.4
github.com/gobuffalo/genny/v2 v2.0.8
github.com/gobuffalo/httptest v1.5.1
github.com/gobuffalo/plush/v4 v4.1.9
github.com/gobuffalo/pop/v6 v6.0.0
github.com/gofrs/uuid v4.1.0+incompatible
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.2.1
github.com/stretchr/testify v1.7.0
)
Loading

0 comments on commit 5273af5

Please sign in to comment.