Skip to content
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

Prepare for openflagr merge #493

Merged
merged 6 commits into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .auto-changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"template": "keepachangelog",
"unreleased": true,
"startingDate": "2021-08-08",
"tagPattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
}
46 changes: 0 additions & 46 deletions .circleci/config.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ _data/
.env.local
flagr.sqlite
./browser/flagr-ui/node_modules
Dockerfile
integration_tests/
13 changes: 13 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
pull_request_rules:
- name: Automatic merge on approval
conditions:
- "#approved-reviews-by>=2"
- check-success=ui_lint
- check-success=unit_test
- check-success=integration_test
- base=main
- label!=wip
- -title~=(?i)wip
actions:
merge:
method: merge
38 changes: 38 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: changelog

on:
release:
types: [published]
workflow_dispatch:

jobs:
create_changelog_pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: create changelog PR
uses: technote-space/create-pr-action@v2
with:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
EXECUTE_COMMANDS: |
npm install -g auto-changelog
auto-changelog
COMMIT_MESSAGE: 'chore: update changelog'
PR_BRANCH_PREFIX: 'changelog/'
PR_BRANCH_NAME: 'chore-update-changelog-${PR_ID}'
PR_TITLE: 'chore: update changelog'
PR_BODY: |
<!-- START pr-commits -->
<!-- END pr-commits -->
## Base PullRequest
${PR_TITLE} (${PR_NUMBER_REF})
## Command results
<details>
<summary>Details: </summary>
${COMMANDS_OUTPUT}
</details>
## Changed files
<details>
<summary>${FILES_SUMMARY}: </summary>
${FILES}
</details>
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: ci

on:
push:
branches: ['main']
pull_request:

jobs:
unit_test:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.19
- name: Check out source code
uses: actions/checkout@v1
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- run: make deps
- run: make verify_swagger_nochange
- run: make ci
- run: make benchmark
- uses: codecov/codecov-action@v2
ui_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out source code
uses: actions/checkout@v1
- run: cd browser/flagr-ui && npm install
- run: cd browser/flagr-ui && npm run lint
integration_test:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v1
- run: cd integration_tests && make build-image
- run: cd integration_tests && make down
- run: cd integration_tests && make up
- run: cd integration_tests && make test
19 changes: 19 additions & 0 deletions .github/workflows/deploy_demo_heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: deploy_demo_heroku

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "try-openflagr"
heroku_email: ${{secrets.HEROKU_EMAIL}}
usedocker: true
23 changes: 0 additions & 23 deletions .github/workflows/main.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: publish_docker

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV
- name: Publish Docker SemVer Tag
uses: elgohr/[email protected]
with:
name: openflagr/flagr
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
tags: "latest,${{ env.RELEASE_VERSION }}"
22 changes: 22 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: '17 21 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ stage/
_tools/
_data
coverage.txt
/vendor
.history
22 changes: 0 additions & 22 deletions .gometalinter.json

This file was deleted.

58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

<!-- auto-changelog-above -->

## [1.1.13](https://github.com/openflagr/flagr/compare/1.1.12...1.1.13) - 2021-08-07

### Merged

- Prepare for 1.1.13 release [`#13`](https://github.com/openflagr/flagr/pull/13)
- Remove github.com/dgrijalva/jwt-go [`#10`](https://github.com/openflagr/flagr/pull/10)
- [skip ci] Add try-openflagr website [`#6`](https://github.com/openflagr/flagr/pull/6)
- Add codecov and fix docs [`#5`](https://github.com/openflagr/flagr/pull/5)
- Add github CI [`#1`](https://github.com/openflagr/flagr/pull/1)
- Upgrade to 1.16 [`#460`](https://github.com/checkr/flagr/pull/460)
- Fix markdown-it xss and sqlite3 build issue [`#451`](https://github.com/checkr/flagr/pull/451)
- Bump y18n from 4.0.0 to 4.0.3 in /browser/flagr-ui [`#444`](https://github.com/checkr/flagr/pull/444)
- Bump ssri from 6.0.1 to 6.0.2 in /browser/flagr-ui [`#441`](https://github.com/checkr/flagr/pull/441)
- Fix integration tests [`#443`](https://github.com/checkr/flagr/pull/443)
- Bump elliptic from 6.5.3 to 6.5.4 in /browser/flagr-ui [`#435`](https://github.com/checkr/flagr/pull/435)
- Add dropdown by state to filter flags [`#433`](https://github.com/checkr/flagr/pull/433)
- Bump swagger cli / golangci-lint / UI related package.json [`#432`](https://github.com/checkr/flagr/pull/432)
- Fix typo in home.md [`#415`](https://github.com/checkr/flagr/pull/415)
- Add support for kafka auth using SASL with PLAIN mechanism [`#412`](https://github.com/checkr/flagr/pull/412)
- Evaluation with FlagTagsOperator to match any or all tags [`#408`](https://github.com/checkr/flagr/pull/408)
- Allow /api/v1/health bypass auth default [`#407`](https://github.com/checkr/flagr/pull/407)

### Commits

- Fix markdown-it xss [`f039933`](https://github.com/openflagr/flagr/commit/f03993346f7cd573b4afe2995ef1e3d24ff5a105)
- Bump UI related package.json [`827f199`](https://github.com/openflagr/flagr/commit/827f199b1ebc4b124b326e674e9a68b57410711a)
- Bump golangci and swagger cli [`fd23dd1`](https://github.com/openflagr/flagr/commit/fd23dd1e57fa880055c054c2f11a1a27641d883e)


### Migration Guide

All the integration tests are the same, which guarantees the
- API backward compatibility with `checkr/flagr:1.1.12`
- Environment variables are the same and don't need any changes

Docker users:
```
docker pull checkr/flagr:1.1.12
=>
docker pull ghcr.io/openflagr/flagr:1.1.13
```

Golang users:
```
go get github.com/checkr/flagr
=>
go get github.com/openflagr/flagr
```

## [1.1.12](https://github.com/checkr/flagr/tree/1.1.12) (2020-09-16)

[Full Changelog](https://github.com/checkr/flagr/compare/1.1.11...1.1.12)
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Expand Down
24 changes: 10 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
######################################
# Prepare npm_builder
######################################
FROM node:10 as npm_builder
WORKDIR /go/src/github.com/checkr/flagr
FROM node:16 as npm_builder
WORKDIR /go/src/github.com/openflagr/flagr
ADD . .
ARG FLAGR_UI_POSSIBLE_ENTITY_TYPES=null
ENV VUE_APP_FLAGR_UI_POSSIBLE_ENTITY_TYPES ${FLAGR_UI_POSSIBLE_ENTITY_TYPES}
Expand All @@ -11,29 +11,25 @@ RUN make build_ui
######################################
# Prepare go_builder
######################################
FROM golang:1.16 as go_builder
WORKDIR /go/src/github.com/checkr/flagr
FROM golang:1.19.0-alpine3.16 as go_builder
WORKDIR /go/src/github.com/openflagr/flagr

RUN apk add --no-cache git make build-base
ADD . .
RUN make build

######################################
# Copy from builder to alpine image
######################################
FROM frolvlad/alpine-glibc:alpine-3.15.0
RUN apk add --no-cache curl
WORKDIR /go/src/github.com/checkr/flagr
VOLUME ["/data"]

ENV HOST=0.0.0.0
ENV PORT=18000
ENV FLAGR_DB_DBDRIVER=sqlite3
ENV FLAGR_DB_DBCONNECTIONSTR=/data/demo_sqlite3.db
ENV FLAGR_RECORDER_ENABLED=false

COPY --from=go_builder /go/src/github.com/checkr/flagr/flagr ./flagr
COPY --from=npm_builder /go/src/github.com/checkr/flagr/browser/flagr-ui/dist ./browser/flagr-ui/dist
ADD ./buildscripts ./buildscripts
COPY --from=npm_builder /go/src/github.com/openflagr/flagr/browser/flagr-ui/dist ./browser/flagr-ui/dist
ADD ./buildscripts/demo_sqlite3.db /data/demo_sqlite3.db

RUN addgroup -S appgroup && adduser -S appuser -G appgroup
USER appuser

EXPOSE 18000
CMD ./flagr
Loading