Skip to content

Commit

Permalink
Go 1.17 (flipt-io#684)
Browse files Browse the repository at this point in the history
* WIP: update to go 1.17

* try providing tag in dev-image workflow

* Fix IT

* README updates

* Rm github-release-notes

* workflow updates

* Rm github-release-notes from bootstrap script
  • Loading branch information
markphelps committed Feb 11, 2022
1 parent ddae3ae commit a663d4c
Show file tree
Hide file tree
Showing 21 changed files with 60 additions and 82 deletions.
2 changes: 0 additions & 2 deletions .env

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: "1.16.x"
go-version: "1.17.x"

- id: go-cache-paths
run: |
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/buf.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Buf
on: pull_request
on:
pull_request:
paths-ignore:
- "*.md"
- ".all-contributorsrc"

jobs:
lint:
Expand All @@ -11,13 +15,13 @@ jobs:

- uses: bufbuild/buf-setup-action@v0.7.0
with:
version: 'latest'
version: "latest"

- uses: bufbuild/buf-lint-action@v1
with:
input: 'rpc/flipt'
input: "rpc/flipt"

- uses: bufbuild/buf-breaking-action@v1
with:
input: 'rpc/flipt'
against: 'https://github.com/${GITHUB_REPOSITORY}.git#branch=master'
input: "rpc/flipt"
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=master"
4 changes: 2 additions & 2 deletions .github/workflows/database-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: "1.16.x"
go-version: "1.17.x"

- id: go-cache-paths
run: |
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: "1.16.x"
go-version: "1.17.x"

- id: go-cache-paths
run: |
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/dev.yml → .github/workflows/dev-image.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Build Dev Image
name: Build/Push Dev Image

on:
workflow_dispatch:
inputs:
tag:
description: "Docker Tag"
required: true
default: "latest"
schedule:
# monthly
- cron: "0 0 1 * *"
Expand Down Expand Up @@ -39,4 +44,4 @@ jobs:
with:
context: .
push: true
tags: ghcr.io/markphelps/flipt-dev:latest
tags: ghcr.io/markphelps/flipt-dev:${{ github.event.inputs.tag }}
4 changes: 2 additions & 2 deletions .github/workflows/integration-test-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build/Push Integration Test Image
on:
workflow_dispatch:
schedule:
- cron: 0 0 1 * *
- cron: 0 0 1 * *

jobs:
build:
name: Build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: "1.16.x"
go-version: "1.17.x"

- uses: actions/setup-node@v2.5.1
with:
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Build the binary
run: |
task bootstrap
task build
task
- name: Test API
uses: ./.github/actions/integration-test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nancy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: "1.16.x"
go-version: "1.17.x"

- run: go list -json -m all > go.list

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Lint/Test
on:
push:
branches:
- "master"
pull_request:
paths-ignore:
- "*.md"
Expand Down Expand Up @@ -36,7 +39,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: "1.16.x"
go-version: "1.17.x"

- id: go-cache-paths
run: |
Expand Down
3 changes: 0 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ builds:
flags:
- -tags=assets

release:
mode: replace # opts: keep-existing, append, prepend, replace

sboms:
- artifacts: archive

Expand Down
19 changes: 0 additions & 19 deletions .vscode/tasks.json

This file was deleted.

5 changes: 3 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Before starting, make sure you have the following installed:

- GCC Compiler
- [SQLite](https://sqlite.org/index.html)
- [Go 1.16+](https://golang.org/doc/install)
- [Go 1.17+](https://golang.org/doc/install)
- [NodeJS >= 16](https://nodejs.org/en/)
- [Yarn](https://yarnpkg.com/en/)
- [Task](https://taskfile.dev/#/)
Expand All @@ -19,11 +19,12 @@ Before starting, make sure you have the following installed:
1. Run `task bootstrap` to install required development tools. See [#bootstrap](#bootstrap) below.
1. Run `task test` to execute the test suite
1. Run `task dev` to run the server and ui in development mode.
1. Run `task build` to build the binary with embedded assets.
1. Run `task --list-all` to see a full list of possible commands

## Go

Flipt is built with Go 1.16+.
Flipt is built with Go 1.17+.

## Bootstrap

Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.16
ARG GO_VERSION=1.17

FROM golang:${GO_VERSION}

Expand All @@ -11,6 +11,7 @@ RUN apt-get update && \
sudo \
openssh-server \
postgresql-client && \
silversearcher-ag && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align=center>
<img src="logo.svg" alt="Flipt" width=200 height=200 />
<img src="logo.svg" alt="Flipt" width=200 height=200 />
</p>

<p align="center">An open-source, on-prem feature flag solution</p>
Expand All @@ -9,24 +9,24 @@
![Flipt](demo.gif)

<div align="center">
<a href="https://github.com/markphelps/flipt/releases">
<img src="https://img.shields.io/github/release/markphelps/flipt.svg?style=flat" alt="Releases" />
</a>
<a href="https://github.com/markphelps/flipt/actions">
<img src="https://github.com/markphelps/flipt/workflows/Tests/badge.svg" alt="Build Status" />
</a>
<a href="https://bestpractices.coreinfrastructure.org/projects/3498">
<img src="https://bestpractices.coreinfrastructure.org/projects/3498/badge">
<a href="https://github.com/markphelps/flipt/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/markphelps/flipt.svg" alt="GPL 3.0" />
</a>
<a href="https://hub.docker.com/r/markphelps/flipt">
<img src="https://img.shields.io/docker/pulls/markphelps/flipt.svg" alt="Docker Pulls" />
</a>
<a href="https://codecov.io/gh/markphelps/flipt">
<img src="https://codecov.io/gh/markphelps/flipt/branch/master/graph/badge.svg" alt="Coverage" />
</a>
<a href="https://goreportcard.com/report/github.com/markphelps/flipt">
<img src="https://goreportcard.com/badge/github.com/markphelps/flipt" alt="Go Report Card" />
</a>
<a href="https://github.com/markphelps/flipt/releases">
<img src="https://img.shields.io/github/release/markphelps/flipt.svg?style=flat" alt="Releases" />
</a>
<a href="https://hub.docker.com/r/markphelps/flipt">
<img src="https://img.shields.io/docker/pulls/markphelps/flipt.svg" alt="Docker Pulls" />
</a>
<a href="https://github.com/avelino/awesome-go">
<img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Go" />
</a>
Expand Down Expand Up @@ -113,12 +113,12 @@ The [Flipt REST API](https://flipt.io/docs/api/) can also be used with any langu

Client libraries built by awesome people from the Open Source community:

| Library | Language | Author | Desc |
| --- | --- | --- | --- |
| [flipt-grpc-python](https://github.com/getsentry/flipt-grpc-python) | Python | [@getsentry](https://github.com/getsentry) | Python GRPC bindings for Flipt |
| [rflipt](https://github.com/christopherdiehl/rflipt) | React | [@christopherdiehl](https://github.com/christopherdiehl) | Components/example project to control React features backed by Flipt |
| [flipt-php](https://github.com/fetzi/flipt-php) | PHP | [@fetzi](https://github.com/fetzi) | Package for evaluating feature flags via the Flipt REST API using [HTTPlug](http://httplug.io/) |
| [flipt-js](https://github.com/betrybe/flipt-js) | Javascript | [@betrybe](https://github.com/betrybe) | Flipt library for JS that allows rendering components based on Feature Flags 🎉 |
| Library | Language | Author | Desc |
| ------------------------------------------------------------------- | ---------- | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [flipt-grpc-python](https://github.com/getsentry/flipt-grpc-python) | Python | [@getsentry](https://github.com/getsentry) | Python GRPC bindings for Flipt |
| [rflipt](https://github.com/christopherdiehl/rflipt) | React | [@christopherdiehl](https://github.com/christopherdiehl) | Components/example project to control React features backed by Flipt |
| [flipt-php](https://github.com/fetzi/flipt-php) | PHP | [@fetzi](https://github.com/fetzi) | Package for evaluating feature flags via the Flipt REST API using [HTTPlug](http://httplug.io/) |
| [flipt-js](https://github.com/betrybe/flipt-js) | Javascript | [@betrybe](https://github.com/betrybe) | Flipt library for JS that allows rendering components based on Feature Flags 🎉 |

### Generate Your Own

Expand Down
18 changes: 9 additions & 9 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ vars:
SOURCE_FILES: ./...

tasks:
default:
desc: Build the binary
deps: [clean, assets]
cmds:
- go build -tags assets -ldflags "-X main.commit={{.GIT_COMMIT}}" -o ./bin/{{.PROJECT}} ./cmd/{{.PROJECT}}/.
vars:
GIT_COMMIT:
sh: set -e && git rev-parse --verify HEAD || ""

assets:
desc: Build the UI
deps: [assets:deps]
Expand Down Expand Up @@ -37,15 +46,6 @@ tasks:
cmds:
- ./script/bootstrap

build:
desc: Build the binary
deps: [clean, assets]
cmds:
- go build -tags assets -ldflags "-X main.commit={{.GIT_COMMIT}}" -o ./bin/{{.PROJECT}} ./cmd/{{.PROJECT}}/.
vars:
GIT_COMMIT:
sh: set -e && git rev-parse --verify HEAD || ""

build:clients:
desc: Generate Ruby and Go proto clients
cmds:
Expand Down
3 changes: 0 additions & 3 deletions _tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ module tools
go 1.16

require (
github.com/buchanae/github-release-notes v0.0.0-20180827045457-200e1dacadbb
github.com/bufbuild/buf v0.56.0
github.com/cortesi/modd v0.0.0-20211215124449-6083f9d1c171
github.com/golangci/golangci-lint v1.43.0
github.com/google/go-github v17.0.0+incompatible // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2
golang.org/x/tools v0.1.8
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0
Expand Down
8 changes: 0 additions & 8 deletions _tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ github.com/bombsimon/wsl/v3 v3.3.0 h1:Mka/+kRLoQJq7g2rggtgQsjuI/K5Efd87WX96EWFxj
github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/breml/bidichk v0.1.1 h1:Qpy8Rmgos9qdJxhka0K7ADEE5bQZX9PQUthkgggHpFM=
github.com/breml/bidichk v0.1.1/go.mod h1:zbfeitpevDUGI7V91Uzzuwrn4Vls8MoBMrwtt78jmso=
github.com/buchanae/github-release-notes v0.0.0-20180827045457-200e1dacadbb h1:1JIKG3zt7fIMG3Hr1sZ3LcQxEROJYJ2qwpjdvD3FCw4=
github.com/buchanae/github-release-notes v0.0.0-20180827045457-200e1dacadbb/go.mod h1:YlY7IAd5TVq6+Bv/iDwCjc122k6aynvrHRJ2E+E82pg=
github.com/bufbuild/buf v0.56.0 h1:oBx0OPMc62HE73dXLQWu6AH+WzA0h0p8/TyA1JeVhks=
github.com/bufbuild/buf v0.56.0/go.mod h1:IGK996ntty37odzh5iWRUrK7G16Y8GYE8484mhXZxak=
github.com/butuzov/ireturn v0.1.1 h1:QvrO2QF2+/Cx1WA/vETCIYBKtRjc30vesdoPUNo1EbY=
Expand Down Expand Up @@ -329,10 +327,6 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
Expand Down Expand Up @@ -973,7 +967,6 @@ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -1238,7 +1231,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww
google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
Expand Down
1 change: 0 additions & 1 deletion _tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package tools

import (
_ "github.com/buchanae/github-release-notes"
_ "github.com/bufbuild/buf/cmd/buf"
_ "github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking"
_ "github.com/bufbuild/buf/cmd/protoc-gen-buf-lint"
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.16
ARG GO_VERSION=1.17

FROM golang:${GO_VERSION}-alpine

Expand Down
2 changes: 1 addition & 1 deletion script/bootstrap
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

GREEN='\033[1;32m'
NC='\033[0m' # No Color
Expand All @@ -10,7 +11,6 @@ if [ ! -f go.mod ]; then
fi

go install \
github.com/buchanae/github-release-notes \
github.com/bufbuild/buf/cmd/buf \
github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking \
github.com/bufbuild/buf/cmd/protoc-gen-buf-lint \
Expand Down
2 changes: 1 addition & 1 deletion script/build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd "$(dirname "$0")/.." || exit

case "$1" in
"release")
goreleaser --rm-dist --release-notes <(github-release-notes -org markphelps -repo flipt --since-latest-release)
goreleaser --rm-dist
;;

"snapshot")
Expand Down

0 comments on commit a663d4c

Please sign in to comment.