diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b1dbb1c03..71b66e869 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -2,23 +2,22 @@ First, thank you so much for wanting to contribute! It means so much that you care enough to want to contribute. We appreciate every PR from the smallest of typos to the be biggest of features. -## First time committing to a Go Repo? +## First time committing to a go Repo? -Support for Go Modules was introduced in [Release v0.13.0-beta.1](https://github.com/gobuffalo/buffalo/releases/tag/v0.13.0-beta.1), and you can now use them to easily set up a development environment. The steps involve: +Support for go Modules was introduced in [Release v0.13.0-beta.1](https://github.com/gobuffalo/buffalo/releases/tag/v0.13.0-beta.1), and you can now use them to easily set up a development environment. The steps involve: 1. Fork the repo 2. Clone the repo to any location in your work station -3. Add a `GO111MODULE` environment variable with `export GO111MODULE=on` -4. Run `make deps` to install dependencies -5. Read the contribution guideline below +3. Run `go get` to install dependencies +4. Read the contribution guideline below -## Contributing to Buffalo +## How to contribute 1. Check [https://github.com/gobuffalo/buffalo/issues](https://github.com/gobuffalo/buffalo/issues) to make sure you're not working on a duplicate issue or PR. 2. If you want to implement a new feature that doesn't have an issue open, please open one and ask for feedback on the feature before spending a lot of time working on it. It's possible the feature has already been discussed, or it's out of scope, or some other reason that might later prevent a PR from being accepted. The [#buffalo](https://gobuffalo.io/docs/slack) channel on gophers.slack.com is a great place to seek this kind of guidance. 3. Write your feature/fix and make sure to include tests. Tests are an **absolute** requirement for any pull request. Please make sure to use the same testing style and libraries as the rest of the tests. 4. Make sure tests run when doing `go test ./...`. You may need to do `go get -t ./...` first to get the testing dependencies. -5. (Optional) There is a much longer set of integration tests that can be run. These will be run by Travis-CI when you open a PR. If you want to run them locally, you can by running `docker build .`. +5. (Optional) There is a much longer set of integration tests that can be run. These will be run by github actions when you open a PR. If you want to run them locally, you can by running `docker build .`. Feel free to ask for help, but don't target a specific person (unless you're replying to this person). e.g. don't @ markbates, but @ gobuffalo/core-managers instead. diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1cdfe3e5d..619c466d0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,17 +7,17 @@ on: jobs: tests-off: - name: ${{matrix.go-version}} ${{matrix.os}} + name: ${{ matrix.os }} - Go v${{ matrix.go-version }} runs-on: ${{ matrix.os }} strategy: matrix: - go-version: - - '1.15.x' - - '1.16.x' - os: - - 'macos-latest' - - 'windows-latest' - - 'ubuntu-latest' + go-version: + - "1.16.x" + - "1.17.x" + os: + - "macos-latest" + - "windows-latest" + - "ubuntu-latest" steps: - uses: actions/checkout@v2 diff --git a/Dockerfile b/Dockerfile index c60090f43..ae5c2cb96 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,6 @@ FROM gobuffalo/buffalo:latest ARG CODECOV_TOKEN ENV GOPROXY https://proxy.golang.org -ENV GO111MODULE on ENV BP /src/buffalo RUN rm -rf $BP diff --git a/Dockerfile.build b/Dockerfile.build index e4b0a5044..26d4c194e 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -1,11 +1,8 @@ -FROM golang:latest +FROM golang:1.17 EXPOSE 3000 ENV GOPROXY=https://proxy.golang.org -ENV GO111MODULE=on - -RUN go version RUN apt-get update \ && apt-get install -y -q build-essential sqlite3 libsqlite3-dev postgresql libpq-dev vim @@ -32,9 +29,8 @@ RUN npm install -g --no-progress yarn \ # Install golangci RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0 # Installing buffalo binary -RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/buffalo@v0.16.26 | sh +RUN go install github.com/gobuffalo/cli/cmd/buffalo@latest RUN go get github.com/gobuffalo/buffalo-pop/v2 -RUN buffalo version RUN mkdir /src WORKDIR /src diff --git a/Dockerfile.slim.build b/Dockerfile.slim.build index 121132278..6ff5226bc 100644 --- a/Dockerfile.slim.build +++ b/Dockerfile.slim.build @@ -1,7 +1,7 @@ -FROM golang:alpine +FROM golang:1.17-alpine + EXPOSE 3000 -ENV GO111MODULE=on ENV GOPROXY=https://proxy.golang.org RUN apk add --no-cache --upgrade apk-tools \ @@ -16,10 +16,9 @@ RUN npm i -g --no-progress yarn \ && yarn config set yarn-offline-mirror /npm-packages-offline-cache \ && yarn config set yarn-offline-mirror-pruning true -# Pulling docker binary from releases -RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/buffalo@v0.16.26 | sh +# Installing buffalo binary +RUN go install github.com/gobuffalo/cli/cmd/buffalo@latest RUN go get github.com/gobuffalo/buffalo-pop/v2 -RUN buffalo version RUN mkdir /src WORKDIR /src diff --git a/Makefile b/Makefile index 2a0350c0f..388f671ec 100644 --- a/Makefile +++ b/Makefile @@ -7,17 +7,10 @@ install: deps make tidy tidy: -ifeq ($(GO111MODULE),on) $(GO_BIN) mod tidy -else - echo skipping go mod tidy -endif deps: $(GO_BIN) get github.com/gobuffalo/release -ifneq ($(GO111MODULE),on) - $(GO_BIN) get -tags ${TAGS} -u -t ./... -endif make tidy build: diff --git a/README.md b/README.md index d90e8102a..aa320768c 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,12 @@ Buffalo **isn't just a framework**; it's a holistic web development environment ## ⚠️ Important -Buffalo works only with Go -[modules](https://blog.golang.org/using-go-modules). `GOPATH` mode is likely to break most of the functionality of the Buffalo eco-system. Please see [this blog post](https://blog.gobuffalo.io/the-road-to-1-0-requiring-modules-5672c6b015e5) for more information. +Buffalo works only with Go [modules](https://blog.golang.org/using-go-modules). `GOPATH` mode is likely to break most of the functionality of the Buffalo eco-system. Please see [this blog post](https://blog.gobuffalo.io/the-road-to-1-0-requiring-modules-5672c6b015e5) for more information. Also, the Buffalo team actively gives support to the last 2 versions of Go, which at the moment are: -- 1.15.x - 1.16.x +- 1.17.x While Buffalo `may` work on older versions, we encourage you to upgrade to latest 2 versions of Go for a better development experience. @@ -34,9 +33,10 @@ While Buffalo `may` work on older versions, we encourage you to upgrade to lates Please visit [http://gobuffalo.io](http://gobuffalo.io) for the latest documentation, examples, and more. ### Quick Start -* [Installation](http://gobuffalo.io/docs/installation) -* [Create a new project](http://gobuffalo.io/docs/new-project) -* [Examples](http://gobuffalo.io/docs/examples) + +- [Installation](http://gobuffalo.io/docs/installation) +- [Create a new project](http://gobuffalo.io/docs/new-project) +- [Examples](http://gobuffalo.io/docs/examples) ## Shoulders of Giants @@ -58,7 +58,7 @@ Buffalo would not be possible if not for all of the great projects it depends on [github.com/gobuffalo/pop](https://github.com/gobuffalo/pop) - Accessing databases is nothing new in web applications. Pop, and its command line tool, Soda, were chosen because they strike a nice balance between simplifying common tasks, being idiomatic, and giving you the flexibility you need to build your app. Pop and Soda share the same core philosophies as Buffalo, so they were a natural choice. -### Sessions, Cookies, WebSockets, and more... +### Sessions, Cookies, WebSockets, and more [github.com/gorilla](https://github.com/gorilla) - The Gorilla toolkit is a great set of packages designed to improve upon the standard library for a variety of web-related packages. With these high-quality packages Buffalo can keep its "core" code to a minimum and focus on its goal of gluing them all together to make your life better. @@ -71,10 +71,11 @@ Oh, yeah, everyone wants benchmarks! What would a web framework be without its b First, thank you so much for wanting to contribute! It means so much that you care enough to want to contribute. We appreciate every PR from the smallest of typos to the be biggest of features. **Here are the core rules to respect**: -* If you have any question, please consider using the [Slack channel](https://gobuffalo.io/docs/slack) (*#buffalo*, *#buffalo_fr* or *#buffalo-dev* for contribution related questions) or [Stack Overflow](https://stackoverflow.com/questions/tagged/buffalo). We use GitHub issues for **bug reports and feature requests only**. -* All contributors of this project are working on their free time: be patient and kind. :) -* Consider opening an issue **BEFORE** creating a Pull request (PR): you won't lose your time on fixing non-existing bugs, or fixing the wrong bug. Also we can help you to produce the best PR! -* All PRs **MUST** be opened against the *development* branch. If you want to write an hot-fix, we'll first fix the *development* branch before moving the patch to *master* branch. + +- If you have any question, please consider using the [Slack channel](https://gobuffalo.io/docs/slack) (-#buffalo-, *#buffalo_fr* or *#buffalo-dev* for contribution related questions) or [Stack Overflow](https://stackoverflow.com/questions/tagged/buffalo). We use GitHub issues for **bug reports and feature requests only**. +- All contributors of this project are working on their free time: be patient and kind. :- +- Consider opening an issue **BEFORE** creating a Pull request (PR): you won't lose your -ime on fixing non-existing bugs, or fixing the wrong bug. Also we can help you to produce the best PR! +- All PRs **MUST** be opened against the *development* branch. If you want to write an ho--fix, we'll first fix the *development* branch before moving the patch to *master* branch. **WE WILL CLOSE ANY ISSUE OR PR NOT FOLLOWING THESE CORE RULES**. diff --git a/SHOULDERS.md b/SHOULDERS.md index c2f91351e..afac02772 100644 --- a/SHOULDERS.md +++ b/SHOULDERS.md @@ -4,7 +4,6 @@ github.com/gobuffalo/buffalo does not try to reinvent the wheel! Instead, it use 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) diff --git a/go.mod b/go.mod index ee5bfbb40..18a23027e 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/gobuffalo/buffalo -go 1.15 +go 1.16 require ( - github.com/BurntSushi/toml v0.3.1 + github.com/BurntSushi/toml v0.4.1 github.com/dustin/go-humanize v1.0.0 github.com/fatih/color v1.12.0 github.com/gobuffalo/envy v1.9.0 @@ -17,7 +17,7 @@ require ( github.com/gobuffalo/nulls v0.4.0 github.com/gobuffalo/packd v1.0.0 github.com/gobuffalo/packr/v2 v2.8.1 - github.com/gobuffalo/plush/v4 v4.1.5 + github.com/gobuffalo/plush/v4 v4.1.6 github.com/gobuffalo/pop/v5 v5.3.4 github.com/gobuffalo/tags/v3 v3.1.0 github.com/gorilla/handlers v1.5.1 diff --git a/go.sum b/go.sum index 87ff4ef93..f37892d95 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,9 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= +github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= @@ -184,8 +185,8 @@ github.com/gobuffalo/packr/v2 v2.8.0/go.mod h1:PDk2k3vGevNE3SwVyVRgQCCXETC9SaONC github.com/gobuffalo/packr/v2 v2.8.1 h1:tkQpju6i3EtMXJ9uoF5GT6kB+LMTimDWD8Xvbz6zDVA= github.com/gobuffalo/packr/v2 v2.8.1/go.mod h1:c/PLlOuTU+p3SybaJATW3H6lX/iK7xEz5OeMf+NnJpg= github.com/gobuffalo/plush/v4 v4.0.0/go.mod h1:ErFS3UxKqEb8fpFJT7lYErfN/Nw6vHGiDMTjxpk5bQ0= -github.com/gobuffalo/plush/v4 v4.1.5 h1:vXkdb99kUqlgJMcdW4KeewnZgwbo26heEDdTdJTTUi4= -github.com/gobuffalo/plush/v4 v4.1.5/go.mod h1:ErFS3UxKqEb8fpFJT7lYErfN/Nw6vHGiDMTjxpk5bQ0= +github.com/gobuffalo/plush/v4 v4.1.6 h1:oR66ytSOXB0sYtPYdQA4pUeqYjAMmeTV02Rv/9FRgFU= +github.com/gobuffalo/plush/v4 v4.1.6/go.mod h1:ErFS3UxKqEb8fpFJT7lYErfN/Nw6vHGiDMTjxpk5bQ0= github.com/gobuffalo/pop/v5 v5.3.4 h1:VWH74icA8khG8SyWDAq6Ch00jcPiC4n436JMFh0lLm0= github.com/gobuffalo/pop/v5 v5.3.4/go.mod h1:UiVurv2aTKC7MuR27PnMrQjAazoLr8SoC/LuTKTS/tQ= github.com/gobuffalo/tags/v3 v3.0.2/go.mod h1:ZQeN6TCTiwAFnS0dNcbDtSgZDwNKSpqajvVtt6mlYpA= diff --git a/install.sh b/install.sh deleted file mode 100644 index b747d22d0..000000000 --- a/install.sh +++ /dev/null @@ -1,385 +0,0 @@ -#!/bin/sh -set -e -# Code generated by godownloader on 2019-02-07T19:17:58Z. DO NOT EDIT. -# - -usage() { - this=$1 - cat </dev/null -} -echoerr() { - echo "$@" 1>&2 -} -log_prefix() { - echo "$0" -} -_logp=6 -log_set_priority() { - _logp="$1" -} -log_priority() { - if test -z "$1"; then - echo "$_logp" - return - fi - [ "$1" -le "$_logp" ] -} -log_tag() { - case $1 in - 0) echo "emerg" ;; - 1) echo "alert" ;; - 2) echo "crit" ;; - 3) echo "err" ;; - 4) echo "warning" ;; - 5) echo "notice" ;; - 6) echo "info" ;; - 7) echo "debug" ;; - *) echo "$1" ;; - esac -} -log_debug() { - log_priority 7 || return 0 - echoerr "$(log_prefix)" "$(log_tag 7)" "$@" -} -log_info() { - log_priority 6 || return 0 - echoerr "$(log_prefix)" "$(log_tag 6)" "$@" -} -log_err() { - log_priority 3 || return 0 - echoerr "$(log_prefix)" "$(log_tag 3)" "$@" -} -log_crit() { - log_priority 2 || return 0 - echoerr "$(log_prefix)" "$(log_tag 2)" "$@" -} -uname_os() { - os=$(uname -s | tr '[:upper:]' '[:lower:]') - case "$os" in - msys_nt) os="windows" ;; - esac - echo "$os" -} -uname_arch() { - arch=$(uname -m) - case $arch in - x86_64) arch="amd64" ;; - x86) arch="386" ;; - i686) arch="386" ;; - i386) arch="386" ;; - aarch64) arch="arm64" ;; - armv5*) arch="armv5" ;; - armv6*) arch="armv6" ;; - armv7*) arch="armv7" ;; - esac - echo ${arch} -} -uname_os_check() { - os=$(uname_os) - case "$os" in - darwin) return 0 ;; - dragonfly) return 0 ;; - freebsd) return 0 ;; - linux) return 0 ;; - android) return 0 ;; - nacl) return 0 ;; - netbsd) return 0 ;; - openbsd) return 0 ;; - plan9) return 0 ;; - solaris) return 0 ;; - windows) return 0 ;; - esac - log_crit "uname_os_check '$(uname -s)' got converted to '$os' which is not a GOOS value. Please file bug at https://github.com/client9/shlib" - return 1 -} -uname_arch_check() { - arch=$(uname_arch) - case "$arch" in - 386) return 0 ;; - amd64) return 0 ;; - arm64) return 0 ;; - armv5) return 0 ;; - armv6) return 0 ;; - armv7) return 0 ;; - ppc64) return 0 ;; - ppc64le) return 0 ;; - mips) return 0 ;; - mipsle) return 0 ;; - mips64) return 0 ;; - mips64le) return 0 ;; - s390x) return 0 ;; - amd64p32) return 0 ;; - esac - log_crit "uname_arch_check '$(uname -m)' got converted to '$arch' which is not a GOARCH value. Please file bug report at https://github.com/client9/shlib" - return 1 -} -untar() { - tarball=$1 - case "${tarball}" in - *.tar.gz | *.tgz) tar -xzf "${tarball}" ;; - *.tar) tar -xf "${tarball}" ;; - *.zip) unzip "${tarball}" ;; - *) - log_err "untar unknown archive format for ${tarball}" - return 1 - ;; - esac -} -mktmpdir() { - test -z "$TMPDIR" && TMPDIR="$(mktemp -d)" - mkdir -p "${TMPDIR}" - echo "${TMPDIR}" -} -http_download_curl() { - local_file=$1 - source_url=$2 - header=$3 - if [ -z "$header" ]; then - code=$(curl -w '%{http_code}' -sL -o "$local_file" "$source_url") - else - code=$(curl -w '%{http_code}' -sL -H "$header" -o "$local_file" "$source_url") - fi - if [ "$code" != "200" ]; then - log_debug "http_download_curl received HTTP status $code" - return 1 - fi - return 0 -} -http_download_wget() { - local_file=$1 - source_url=$2 - header=$3 - if [ -z "$header" ]; then - wget -q -O "$local_file" "$source_url" - else - wget -q --header "$header" -O "$local_file" "$source_url" - fi -} -http_download() { - log_debug "http_download $2" - if is_command curl; then - http_download_curl "$@" - return - elif is_command wget; then - http_download_wget "$@" - return - fi - log_crit "http_download unable to find wget or curl" - return 1 -} -http_copy() { - tmp=$(mktemp) - http_download "${tmp}" "$1" "$2" || return 1 - body=$(cat "$tmp") - rm -f "${tmp}" - echo "$body" -} -github_release() { - owner_repo=$1 - version=$2 - test -z "$version" && version="latest" - giturl="https://github.com/${owner_repo}/releases/${version}" - json=$(http_copy "$giturl" "Accept:application/json") - test -z "$json" && return 1 - version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name":"//' | sed 's/".*//') - test -z "$version" && return 1 - echo "$version" -} -hash_sha256() { - TARGET=${1:-/dev/stdin} - if is_command gsha256sum; then - hash=$(gsha256sum "$TARGET") || return 1 - echo "$hash" | cut -d ' ' -f 1 - elif is_command sha256sum; then - hash=$(sha256sum "$TARGET") || return 1 - echo "$hash" | cut -d ' ' -f 1 - elif is_command shasum; then - hash=$(shasum -a 256 "$TARGET" 2>/dev/null) || return 1 - echo "$hash" | cut -d ' ' -f 1 - elif is_command openssl; then - hash=$(openssl -dst openssl dgst -sha256 "$TARGET") || return 1 - echo "$hash" | cut -d ' ' -f a - else - log_crit "hash_sha256 unable to find command to compute sha-256 hash" - return 1 - fi -} -hash_sha256_verify() { - TARGET=$1 - checksums=$2 - if [ -z "$checksums" ]; then - log_err "hash_sha256_verify checksum file not specified in arg2" - return 1 - fi - BASENAME=${TARGET##*/} - want=$(grep "${BASENAME}" "${checksums}" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1) - if [ -z "$want" ]; then - log_err "hash_sha256_verify unable to find checksum for '${TARGET}' in '${checksums}'" - return 1 - fi - got=$(hash_sha256 "$TARGET") - if [ "$want" != "$got" ]; then - log_err "hash_sha256_verify checksum for '$TARGET' did not verify ${want} vs $got" - return 1 - fi -} -cat /dev/null <