Skip to content

Commit

Permalink
Om
Browse files Browse the repository at this point in the history
  • Loading branch information
purplefox committed Apr 27, 2022
0 parents commit eb5d17e
Show file tree
Hide file tree
Showing 501 changed files with 137,081 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Pull Request"
on:
pull_request:
push:
branches:
- main
jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/.cache/golangci-lint
~/go/pkg/mod
key: ${{ runner.os }}-go
restore-keys: |
${{ runner.os }}-go
- name: Checkout code
uses: actions/checkout@v2
- name: Init Hermit
run: |
./bin/hermit env --raw >> $GITHUB_ENV
./bin/hermit install
- name: Build
run: go build ./...
- name: Go lint
run: golangci-lint run
- name: Proto lint
run: make -C protos lint
- name: Test
run: go test -race -count=1 -timeout 20m -failfast -p 1 -tags integration ./...
50 changes: 50 additions & 0 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Continuous Integration Tests"
on:
schedule:
- cron: '*/30 * * * *'
push:
branches:
- force-integration-tests # Push this branch to force this job to run
jobs:
integration:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/.cache/golangci-lint
~/go/pkg/mod
key: ${{ runner.os }}-go
restore-keys: |
${{ runner.os }}-go
- name: Checkout code
uses: actions/checkout@v2
- name: Init Hermit
run: |
./bin/hermit env --raw >> $GITHUB_ENV
./bin/hermit install
- name: Build
run: go build ./...
- name: SQLTests
run: go test -race -count=1 -timeout 20m -failfast -p 1 -tags confluent ./sqltest
if: ${{ always() }}
- name: Kafka tests using RedPanda and Confluent Kafka client
run: go test -race -count=1 -timeout 20m -failfast -p 1 -tags confluent,integration ./kafkatest -- -kafka-provider=redpanda
if: ${{ always() }}
- name: Kafka tests using Kafka and Confluent Kafka client
run: go test -race -count=1 -timeout 20m -failfast -p 1 -tags confluent,integration ./kafkatest -- -kafka-provider=kafka
if: ${{ always() }}
slack-on-fail:
runs-on: [ self-hosted, linux ]
needs: [ integration ]
if: always() && (needs.integration.result == 'failure' || needs.integration.result == 'error')
steps:
- run: git clone --depth 1 https://github.com/squareup/github-actions --branch v1 --single-branch
- uses: ./github-actions/slack-on-fail
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_TEXT: Integration tests failed.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.DS_Store
.gradle
**/out/
.idea
build/
*.iml
*.swp
polyrepo-settings.gradle
dev/
docker-sources/
polyrepo-settings.gradle.kts
vendor
.hermit/
kafkaserver/
prana-data/
107 changes: 107 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
run:
tests: true
timeout: 5m
max-same-issues: 50
modules-download-mode: readonly
skip-dirs:
- resources
- old
- apps/nimbus/third_party
- tidb

output:
print-issued-lines: false

linters:
enable-all: true
disable:
- maligned
- megacheck
- lll
- typecheck # `go build` catches this, and it doesn't currently work with Go 1.11 modules
- goimports # horrendously slow with go modules :(
- dupl # has never been actually useful
- gochecknoglobals
- gochecknoinits
- interfacer # author deprecated it because it provides bad suggestions
- funlen
- whitespace
- godox
- wsl
- dogsled
- gomnd
- gocognit
- testpackage
- nestif
- nolintlint
- goerr113
- godot
- gci # completely broken and unmaintained: https://github.com/daixiang0/gci/issues
- gofumpt # a bit excessive
- exhaustivestruct
- nlreturn
- noctx # Nice idea, but don't have time. It would be good to re-enable and fix at some point.
- errorlint # Nice idea, but don't have time. It would be good to re-enable and fix at some point.
- forbidigo
- paralleltest
- prealloc # annoying
- golint # deprecated
- scopelint # deprecated
- wrapcheck # we should decide if we want to use this
- cyclop # duplicates gocyclo
- tagliatelle # snake case json!

linters-settings:
govet:
check-shadowing: true
use-installed-packages: true
dupl:
threshold: 100
goconst:
min-len: 8
min-occurrences: 3
gocyclo:
min-complexity: 20
gocritic:
disabled-checks:
- commentFormatting
- ifElseChain
disabled-tags:
- experimental
depguard:
list-type: blacklist
include-go-root: true
packages-with-error-message:
- errors: "use pranadb/errors"
- github.com/pkg/errors: "use pranadb/errors"
- github.com/pingcap/errors: "use pranadb/errors"
- github.com/gogo/protobuf: "use github.com/golang/protobuf"
exhaustive:
default-signifies-exhaustive: true


issues:
max-per-linter: 0
max-same: 0
exclude-use-default: false
exclude-rules:
- path: _test\.go
linters:
- exportloopref
exclude:
# gosec overenthusiasm
- '^(G104|G204|G307|G306|G404):'
# Very commonly not checked.
- 'Error return value of .(.*\.Help|.*\.MarkFlagRequired|(os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*Unlock|.*Print(f|ln|)|os\.(Un)?Setenv). is not checked'
# Weird error only seen on Kochiku...
- 'internal error: no range for'
- 'exported method `.*\.(MarshalJSON|UnmarshalJSON|URN|Payload|GoString|Close|Provides|Requires|ExcludeFromHash|MarshalText|UnmarshalText|Description|Check|Poll|Severity)` should have comment or be unexported'
- 'composite literal uses unkeyed fields'
- 'declaration of "err" shadows declaration'
- 'by other packages, and that stutters'
- 'Potential file inclusion via variable'
- 'at least one file in a package should have a package comment'
# errors.As() is error-prone and difficult to use.
- 'Use errors.As to check for specific errors'
- 'should have comment.* or be unexported' # Disabled until we start deciding to write function docs...
- "don't use leading k in Go names"
Loading

0 comments on commit eb5d17e

Please sign in to comment.