Skip to content

Commit

Permalink
chore: add .github configurations (#1)
Browse files Browse the repository at this point in the history
* chore: add .github configurations

* chore: add Makefile, .gitignore files

* fix: wrong test github workflow

* chore: add .golangci.yml

* chore: complete apiserver.local.config/ to .gitignore

* chore: remove @KusionStack/go-reviewer in CODEOWNERS

* chore: rename test.yaml => check.yaml and cla.yml => cla.yaml
  • Loading branch information
elliotxx authored Apr 10, 2023
1 parent 8ca6db1 commit ffc2208
Show file tree
Hide file tree
Showing 12 changed files with 643 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
# * @global-owner1 @global-owner2
* @elliotxx @panshuai-ps @adohe

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.
# *.js @js-owner

# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.
# *.go [email protected]

# Teams can be specified as code owners as well. Teams should
# be identified in the format @org/team-name. Teams must have
# explicit write access to the repository. In this example,
# the octocats team in the octo-org organization owns all .txt files.
# *.txt @octo-org/octocats
*.go @elliotxx @panshuai-ps @adohe

# In this example, @doctocat owns any files in the build/logs
# directory at the root of the repository and any of its
# subdirectories.
# /build/logs/ @doctocat
/.github/ @elliotxx @panshuai-ps @adohe

# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
# docs/* [email protected]

# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.
# apps/ @octocat

# In this example, @doctocat owns any file in the `/docs`
# directory in the root of your repository and any of its
# subdirectories.
# /docs/ @doctocat
/docs/ @elliotxx @panshuai-ps @adohe

# In this example, @octocat owns any file in the `/apps`
# directory in the root of your repository except for the `/apps/github`
# subdirectory, as its owners are left empty.
# /apps/ @octocat
# /apps/github
77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Bug Report
description: Report a bug encountered while operating Karbour
labels: kind/bug
body:
- type: textarea
id: problem
attributes:
label: What happened?
description: |
Please provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner.
validations:
required: true

- type: textarea
id: expected
attributes:
label: What did you expect to happen?
validations:
required: true

- type: textarea
id: repro
attributes:
label: How can we reproduce it (as minimally and precisely as possible)?
validations:
required: true

- type: textarea
id: additional
attributes:
label: Anything else we need to know?

- type: textarea
id: KarbourVersion
attributes:
label: Karbour version
value: |
<details>
```console
$ karbour -V
# paste output here
```
</details>
validations:
required: true

- type: textarea
id: osVersion
attributes:
label: OS version
value: |
<details>
```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```
</details>
- type: textarea
id: installer
attributes:
label: Install tools
value: |
<details>
</details>
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Enhancement Tracking Issue
description: Provide supporting details for a feature in development
labels: kind/feature
body:
- type: textarea
id: feature
attributes:
label: What would you like to be added?
validations:
required: true

- type: textarea
id: rationale
attributes:
label: Why is this needed?
validations:
required: true
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/failing-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Failing Test
description: Report continuously failing tests or jobs in Karbour
labels: kind/failing-test
body:
- type: textarea
id: jobs
attributes:
label: Which jobs are failing?
placeholder: |
Please only use this template for submitting reports about continuously failing tests or jobs in Karbour.
validations:
required: true

- type: textarea
id: tests
attributes:
label: Which tests are failing?
validations:
required: true

- type: textarea
id: since
attributes:
label: Since when has it been failing?
validations:
required: true

- type: input
id: testgrid
attributes:
label: Testgrid link

- type: textarea
id: reason
attributes:
label: Reason for failure (if possible)

- type: textarea
id: additional
attributes:
label: Anything else we need to know?
62 changes: 62 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!-- Thank you for contributing to KusionStack!
Note:
1. With pull requests:
- Open your pull request against "main"
- Your pull request should have no more than three commits, if not you should squash them.
- It should pass all tests in the available continuous integration systems such as GitHub Actions.
- You should add/modify tests to cover your proposed code changes.
- If your pull request contains a new feature, please document it on the README.
2. Please create an issue first to describe the problem.
We recommend that link the issue with the PR in the following question.
For more info, check https://kusionstack.io/docs/governance/contribute/
-->

#### What type of PR is this?

<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->

#### What this PR does / why we need it:

#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
```

#### Additional documentation e.g., design docs, usage docs, etc.:

<!--
Please use the following format for linking documentation:
- [Design]: <link>
- [Usage]: <link>
- [Other doc]: <link>
-->
```docs
```
52 changes: 52 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Reference from:
# https://github.com/c-bata/go-prompt/blob/master/.github/workflows/test.yml
name: Check
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
Test:
name: Unit tests with coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.19

- run: go build ./...
- run: go vet ./...

- name: Running go tests with coverage
env:
GO111MODULE: on
run: make cover
# - name: Send coverage
# uses: shogo82148/actions-goveralls@v1
# with:
# path-to-profile: coverage.out
Lint:
name: Lint checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.52.2
41 changes: 41 additions & 0 deletions .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CLA Assistant"
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened,closed,synchronize]

jobs:
CLAssistant:
runs-on: ubuntu-latest
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
# Beta Release
uses: cla-assistant/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret
PERSONAL_ACCESS_TOKEN : ${{ secrets.KUSIONSTACK_BOT_TOKEN }}
with:
path-to-document: 'https://github.com/KusionStack/.github/blob/main/CLA.md' # e.g. a CLA or a DCO document

# branch should not be protected
lock-pullrequest-aftermerge: True
path-to-signatures: 'signatures/version1/cla.json'
remote-organization-name: KusionStack
remote-repository-name: cla.db
branch: 'main'
allowlist: 'test'

#below are the optional inputs - If the optional inputs are not given, then default values will be taken
#remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
#remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
#signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
#use-dco-flag: true - If you are using DCO instead of CLA

Loading

0 comments on commit ffc2208

Please sign in to comment.