From 6310bf968970d2ecd33d35c3ca6e8b4a5e384268 Mon Sep 17 00:00:00 2001
From: Joshua Goldstein <92491720+joshua-goldstein@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:15:32 -0500
Subject: [PATCH] chore(ci): add workflows from main (#1828)
Add workflows to release branch from main so CI jobs run when PR's are
pushed against release branch.
---
.github/CODEOWNERS | 2 +-
.github/ISSUE_TEMPLATE | 1 -
.github/ISSUE_TEMPLATE/bug_report.yml | 62 +++++++++++++++++++
.../ISSUE_TEMPLATE/documentation_request.yml | 30 +++++++++
.github/ISSUE_TEMPLATE/feature_request.yml | 49 +++++++++++++++
.github/ISSUE_TEMPLATE/question.yml | 14 +++++
.github/PULL_REQUEST_TEMPLATE.md | 29 +++++++++
.../ci-badger-bank-tests-nightly.yml | 46 ++++++++++++++
.github/workflows/ci-badger-bank-tests.yml | 36 +++++++++++
.github/workflows/ci-badger-tests.yml | 35 +++++++++++
.github/workflows/ci-golang-lint.yml | 35 +++++++++++
11 files changed, 337 insertions(+), 2 deletions(-)
delete mode 100644 .github/ISSUE_TEMPLATE
create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml
create mode 100644 .github/ISSUE_TEMPLATE/documentation_request.yml
create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml
create mode 100644 .github/ISSUE_TEMPLATE/question.yml
create mode 100644 .github/PULL_REQUEST_TEMPLATE.md
create mode 100644 .github/workflows/ci-badger-bank-tests-nightly.yml
create mode 100644 .github/workflows/ci-badger-bank-tests.yml
create mode 100644 .github/workflows/ci-badger-tests.yml
create mode 100644 .github/workflows/ci-golang-lint.yml
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index cd7a5a19c..0672bafba 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1,4 +1,4 @@
# CODEOWNERS info: https://help.github.com/en/articles/about-code-owners
# Owners are automatically requested for review for PRs that changes code
# that they own.
-* @manishrjain @ashish-goswami @jarifibrahim
+* @akon-dey @nosql22 @billprovince @joshua-goldstein @skrdgraph
diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE
deleted file mode 100644
index 7b0145eef..000000000
--- a/.github/ISSUE_TEMPLATE
+++ /dev/null
@@ -1 +0,0 @@
-**GitHub Issues are deprecated. Use [Discuss Issues](https://discuss.dgraph.io/c/issues/badger/37) for reporting issues about this repository.**
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 000000000..aee27dbb5
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,62 @@
+name: "🐞 Bug Report"
+description: File a bug report
+title: "[BUG]:
"
+labels: ["kind/bug", "status/triage"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thank you for reporting an issue.
+ If you suspect this could be a bug, please follow this template.
+ - type: textarea
+ attributes:
+ label: What version of Badger are you using?
+ description: Copy and paste the tag or commit hash used in your application's go.mod file.
+ placeholder: |
+ Paste here.
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: What version of Go are you using?
+ description: Copy and paste all you see using the command 'go version'.
+ placeholder: |
+ Paste here.
+ validations:
+ required: false
+ - type: dropdown
+ attributes:
+ label: Have you tried reproducing the issue with the latest release?
+ options:
+ - "Yes"
+ - "No"
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: What is the hardware spec (RAM, CPU, OS)?
+ description: Share all possible context of your machine.
+ placeholder: |
+ Type here.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: What steps will reproduce the bug?
+ description: Enter details about your bug (command/config used to set up Ristretto).
+ placeholder: |
+ Type here.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Expected behavior and actual result.
+ description: Enter details about your expectations.
+ placeholder: |
+ Type here.
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: Additional information
+ description: Tell us anything else you think we should know.
diff --git a/.github/ISSUE_TEMPLATE/documentation_request.yml b/.github/ISSUE_TEMPLATE/documentation_request.yml
new file mode 100644
index 000000000..07b68092a
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/documentation_request.yml
@@ -0,0 +1,30 @@
+name: "📃 Documentation Request"
+description: Suggest improvements, additions, or revisions to Badger documentation
+title: "[Documentation]: "
+labels: ["area/documentation", "status/triage"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thank you for reporting an issue.
+ If you think Badger's documentation is lacking, please explain it here.
+ - type: textarea
+ attributes:
+ label: What version of Badger is the target?
+ description: Is it the latest version?
+ placeholder: |
+ Type here.
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: Documentation.
+ description: Explain which part of the documentation is lacking.
+ placeholder: |
+ Type here.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Additional information.
+ description: Tell us anything else you think we should know.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 000000000..5b2ad9288
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,49 @@
+name: "⚡ Feature Request"
+description: Suggest a new feature
+title: "[FEATURE]: "
+labels: ["kind/feature ", "status/triage"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thank you for reporting an issue.
+ If you think we can make Badger better, describe your feature request here.
+ Note: Feature requests are judged based on user experience and modeled on
+ [Go Experience Reports](https://github.com/golang/go/wiki/ExperienceReports).
+ These reports should focus on the problems - they should not focus on and need not propose solutions.
+ - type: dropdown
+ attributes:
+ label: Have you tried Badger before this proposal? and did not find anything similar?
+ options:
+ - "Yes"
+ - "No"
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: What you wanted to do.
+ description: Enter details about your expectations.
+ placeholder: |
+ Type here.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: What you actually did.
+ description: Enter details about your experience with Badger.
+ placeholder: |
+ Type here.
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: Why wasn't it great, with examples.
+ description: Enter details about your expectations.
+ placeholder: |
+ Type here.
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: Additional information.
+ description: Any external references to support your case.
diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml
new file mode 100644
index 000000000..14a93db0f
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/question.yml
@@ -0,0 +1,14 @@
+name: "🙋 Question"
+description: Question related to Badger
+title: "[QUESTION]: "
+labels: ["kind/question ", "status/triage"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ The issue tracker is primarily for code related issues, bug reports, missing documentation, or feature requests.
+ - If you have a question, please consider asking it on https://discuss.dgraph.io
+ - type: textarea
+ attributes:
+ label: Question.
+ description: Ask your Question.
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 000000000..64d1bf16f
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,29 @@
+
+
+## Problem
+
+
+## Solution
+
\ No newline at end of file
diff --git a/.github/workflows/ci-badger-bank-tests-nightly.yml b/.github/workflows/ci-badger-bank-tests-nightly.yml
new file mode 100644
index 000000000..95734786b
--- /dev/null
+++ b/.github/workflows/ci-badger-bank-tests-nightly.yml
@@ -0,0 +1,46 @@
+name: ci-badger-bank-tests-nightly
+on:
+ push:
+ branches:
+ - main
+ schedule:
+ - cron: "0 3 * * *"
+jobs:
+ badger-bank:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Get Go Version
+ run: |
+ #!/bin/bash
+ GOVERSION=$({ [ -f .go-version ] && cat .go-version; })
+ echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV
+ - name: Setup Go
+ uses: actions/setup-go@v3
+ with:
+ go-version: ${{ env.GOVERSION }}
+ - name: Install Dependencies
+ run: make dependency
+ - name: Install jemalloc
+ run: make jemalloc
+ - name: Install Badger
+ run: cd badger && go install --race --tags=jemalloc .
+ - name: Run Badger Bank Test
+ run: |
+ #!/bin/bash -x
+ set -o pipefail
+ # get 16 random bytes from /dev/urandom
+ hexdump -vn16 -e'4/4 "%08X" 1 "\n"' /dev/urandom > badgerkey16bytes
+ badger bank test --dir=. --encryption-key "badgerkey16bytes" -d=4h 2>&1 | tee badgerbanktest.log | grep -v 'Moved $5'
+ if [ $? -ne 0 ]; then
+ if grep -qi 'data race' badgerbanktest.log; then
+ echo "Detected data race via grep..."
+ cat badgerbanktest.log | grep -v 'Moved $5'
+ else
+ echo "No data race detected via grep. Assuming txn violation..."
+ tail -1000 badgerbanktest.log
+ badger bank disect --dir=. --decryption-key "badgerkey16bytes"
+ fi
+ exit 1
+ fi
+ echo 'Bank test finished with no issues.'
diff --git a/.github/workflows/ci-badger-bank-tests.yml b/.github/workflows/ci-badger-bank-tests.yml
new file mode 100644
index 000000000..be7c0f231
--- /dev/null
+++ b/.github/workflows/ci-badger-bank-tests.yml
@@ -0,0 +1,36 @@
+name: ci-badger-bank-tests
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+ schedule:
+ - cron: "*/30 * * * *"
+jobs:
+ badger-bank:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Get Go Version
+ run: |
+ #!/bin/bash
+ DEFAULT_VERSION="1.18"
+ GOVERSION=$({ [ -f .go-version ] && cat .go-version; } || echo $DEFAULT_VERSION)
+ echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV
+ - name: Setup Go
+ uses: actions/setup-go@v3
+ with:
+ go-version: ${{ env.GOVERSION }}
+ - name: Install Dependencies
+ run: make dependency
+ - name: Install jemalloc
+ run: make jemalloc
+ - name: Install Badger
+ run: cd badger && go install --race --tags=jemalloc .
+ - name: Run Badger Bank Test
+ run: |
+ #!/bin/bash
+ mkdir bank && cd bank
+ badger bank test -v --dir=. -d=20m
diff --git a/.github/workflows/ci-badger-tests.yml b/.github/workflows/ci-badger-tests.yml
new file mode 100644
index 000000000..35c1b416b
--- /dev/null
+++ b/.github/workflows/ci-badger-tests.yml
@@ -0,0 +1,35 @@
+name: ci-badger-tests
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+ schedule:
+ - cron: "*/30 * * * *"
+jobs:
+ badger-tests:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Get Go Version
+ run: |
+ #!/bin/bash
+ DEFAULT_VERSION="1.18"
+ GOVERSION=$({ [ -f .go-version ] && cat .go-version; } || echo $DEFAULT_VERSION)
+ echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV
+ - name: Setup Go
+ uses: actions/setup-go@v3
+ with:
+ go-version: ${{ env.GOVERSION }}
+ - name: Install Dependencies
+ run: make dependency
+ - name: Run Badger Tests
+ run: make test
+ - name: Install Goveralls
+ run: go install github.com/mattn/goveralls@latest
+ - name: Send Coverage Results
+ env:
+ COVERALLS_TOKEN: ${{ secrets.COVERALLSIO_TOKEN }}
+ run: goveralls -coverprofile=cover.out
diff --git a/.github/workflows/ci-golang-lint.yml b/.github/workflows/ci-golang-lint.yml
new file mode 100644
index 000000000..f3c44b04f
--- /dev/null
+++ b/.github/workflows/ci-golang-lint.yml
@@ -0,0 +1,35 @@
+name: ci-golang-lint
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+ schedule:
+ - cron: "*/30 * * * *"
+jobs:
+ go-lint:
+ name: lint
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Get Go Version
+ run: |
+ #!/bin/bash
+ GOVERSION=$({ [ -f .go-version ] && cat .go-version; })
+ echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV
+ - name: Setup Go
+ uses: actions/setup-go@v3
+ with:
+ go-version: ${{ env.GOVERSION }}
+ - name: golang-lint
+ env:
+ # prevent OOM
+ GOGC: 10
+ uses: golangci/golangci-lint-action@v3.2.0
+ with:
+ # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
+ version: v1.48
+ only-new-issues: true
+ args: --timeout=10m