diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 37593169e..fcdedb727 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,7 +2,8 @@
## About KubeVela
-KubeVela project is initialized and maintained by the cloud native community since day 0 with [bootstrapping contributors from 8+ different organizations](https://github.com/oam-dev/kubevela/graphs/contributors). We intend for KubeVela to have a open governance since the very beginning and donate the project to neutral foundation as soon as it's released.
+KubeVela project is initialized and maintained by the cloud native community since day 0 with [bootstrapping contributors from 8+ different organizations](https://github.com/oam-dev/kubevela/graphs/contributors).
+We intend for KubeVela to have an open governance since the very beginning and donate the project to neutral foundation as soon as it's released.
This doc explains how to set up a development environment, so you can get started
contributing to `kubevela` or build a PoC (Proof of Concept).
@@ -27,15 +28,22 @@ We also recommend you to learn about KubeVela's [design](docs/en/design.md) befo
git clone git@github.com:oam-dev/kubevela.git
```
+KubeVela includes two parts, `vela core` and `vela cli`.
+
+- The `vela core` is actually a K8s controller, it will watch OAM Spec CRD and deploy resources.
+- The `vela cli` is a command line tool that can build, run apps(with the help of `vela core`).
+
+For local development, we probably need to build both of them.
+
* Build Vela CLI
```shell script
make
```
-* Configure vela to PATH
+After the vela cli built successfully, `make` command will create `vela` binary to `bin/` under the project.
-after build, make will create `vela` binary to `bin/`, Set this path to PATH.
+* Configure `vela` binary to System PATH
```shell script
export PATH=$PATH:/your/path/to/project/kubevela/bin
@@ -51,7 +59,7 @@ make manager
* Run Vela Core
-Firstly make sure your cluster has CRDs.
+Firstly make sure your cluster has CRDs, below is the command that can help install all CRDs.
```shell script
make core-install
@@ -66,74 +74,19 @@ make core-run
This command will run controller locally, it will use your local KubeConfig which means you need to have a k8s cluster
locally. If you don't have a one, we suggest that you could setup up a cluster with [kind](https://kind.sigs.k8s.io/).
+When you're developing `vela-core`, make sure the controller installed by `vela install` is not running.
+Otherwise, it will conflict with your local running controller.
+
+You can check and uninstall it by using helm.
+
+```shell script
+helm list -A
+helm uninstall -n vela-system kubevela
+```
+
### Use
-* Create environment
-
-```shell script
-vela env init myenv --namespace myenv --email my@email.com --domain kubevela.io
-```
-
-* Create Component
-
-For example, use the following command to create and run an application.
-
-```shell script
-$ vela svc deploy mysvc -t webservice --image crccheck/hello-world --port 8000 -a abc
- App abc deployed
-```
-
-* Add Trait
-
-```shell script
-$ vela route abc
- Adding route for app mysvc
- ⠋ Deploying ...
- ✅ Application Deployed Successfully!
- - Name: mysvc
- Type: webservice
- HEALTHY Ready: 1/1
- Last Deployment:
- Created at: 2020-11-02 11:17:28 +0800 CST
- Updated at: 2020-11-02T11:21:23+08:00
- Routes:
- - route: Visiting URL: http://abc.kubevela.io IP: 47.242.68.137
-```
-
-* Check Status
-
-```
-$ vela status abc
- About:
-
- Name: abc
- Namespace: default
- Created at: 2020-11-02 11:17:28.067738 +0800 CST
- Updated at: 2020-11-02 11:28:13.490986 +0800 CST
-
- Services:
-
- - Name: mysvc
- Type: webservice
- HEALTHY Ready: 1/1
- Last Deployment:
- Created at: 2020-11-02 11:17:28 +0800 CST
- Updated at: 2020-11-02T11:28:13+08:00
- Routes:
- - route: Visiting URL: http://abc.kubevela.io IP: 47.242.68.137
-```
-
-* Delete App
-
-```shell script
-$ vela ls
- SERVICE APP TYPE TRAITS STATUS CREATED-TIME
- mysvc abc Deployed 2020-11-02 11:17:28 +0800 CST
-
-$ vela delete abc
- Deleting Application "abc"
- delete apps succeed abc from default
-```
+You can try use your local built binaries follow [the documentation](https://kubevela.io/#/en/quick-start).
## Testing
@@ -158,7 +111,18 @@ make e2e-test
```
## Make a pull request
-Remember to write unit-test and e2e test before making a pull request.
+
+Remember to write unit-test and e2e-test after you have finished your code.
+
+Run following checks before making a pull request.
+
+```shell script
+make reviewable
+```
+
+The command will do some lint checks and clean code.
+
+After that, check in all changes and send a pull request.
## Merge Regulations
diff --git a/cmd/core/main.go b/cmd/core/main.go
index 5623d4ebc..21489eaae 100644
--- a/cmd/core/main.go
+++ b/cmd/core/main.go
@@ -94,6 +94,8 @@ func main() {
flag.StringVar(&healthAddr, "health-addr", ":9440", "The address the health endpoint binds to.")
flag.BoolVar(&controllerArgs.ApplyOnceOnly, "apply-once-only", false,
"For the purpose of some production environment that workload or trait should not be affected if no spec change")
+ flag.StringVar(&controllerArgs.CustomRevisionHookURL, "custom-revision-hook-url", "",
+ "custom-revision-hook-url is a webhook url which will let KubeVela core to call with applicationConfiguration and component info and return a customized component revision")
flag.StringVar(&disableCaps, "disable-caps", "", "To be disabled builtin capability list.")
flag.Parse()
diff --git a/dashboard/README.md b/dashboard/README.md
index e8f207808..b47c064f1 100644
--- a/dashboard/README.md
+++ b/dashboard/README.md
@@ -1,31 +1,68 @@
-# Vela Dashboard
+# KubeVela Dashboard
+
+## Quick start
+
+In the root folder of this project, run `make start-dashboard` to start backend OpenAPI server and Dashboard at the same time.
+
+```shell
+➜ xxx/src/github.com/oam-dev/kubevela $ make start-dashboard
+go run pkg/server/main/startAPIServer.go &
+cd dashboard && yarn && yarn start && cd ..
+yarn install v1.22.4
+warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
+[1/5] 🔍 Validating package.json...
+[2/5] 🔍 Resolving packages...
+success Already up-to-date.
+$ umi g tmp
+✨ Done in 5.89s.
+yarn run v1.22.4
+$ umi dev
+Starting the development server...
+I1230 10:37:54.157092 14236 request.go:621] Throttling request took 1.04915427s, request: GET:https://47.242.145.141:6443/apis/split.smi-spec.io/v1alpha2?timeout=32s
+[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
+ - using env: export GIN_MODE=release
+ - using code: gin.SetMode(gin.ReleaseMode)
+
+[GIN-debug] POST /api/envs/ --> github.com/oam-dev/kubevela/pkg/server.(*APIServer).CreateEnv-fm (6 handlers)
+[GIN-debug] PUT /api/envs/:envName --> github.com/oam-dev/kubevela/pkg/server.(*APIServer).UpdateEnv-fm (6 handlers)
+...
+[GIN-debug] GET /api/version --> github.com/oam-dev/kubevela/pkg/server.(*APIServer).GetVersion-fm (6 handlers)
+[GIN-debug] GET /swagger/*any --> github.com/swaggo/gin-swagger.CustomWrapHandler.func1 (7 handlers)
+
+✔ Webpack
+ Compiled successfully in 26.86s
+
+ DONE Compiled successfully in 26865ms 10:38:22 AM
-## Environment Prepare
+ App running at:
+ - Local: http://localhost:8000 (copied to clipboard)
+ - Network: http://192.168.31.114:8000
+```
-Install `node_modules`:
+## Development
+
+### Install dependencies
```bash
yarn
```
-## Provided Scripts
-
-Scripts provided in `package.json`. It's safe to modify or add additional script:
-
-### Start project
-
-```bash
-yarn start
-```
-
-### Build project
+### Build
```bash
yarn build
```
-### Check code style
+### Start up
+
+```bash
+yarn start
+```
+
+### Lint and Test
+
+- Check code style
```bash
yarn lint
@@ -34,11 +71,11 @@ yarn lint
You can also use script to auto fix some lint error:
```bash
-yarn lint:fix
+yarn prettier
```
-### Test code
+- Test code
```bash
yarn test
-```
\ No newline at end of file
+```
diff --git a/dashboard/src/pages/Capability/Components/ShowComponent/index.tsx b/dashboard/src/pages/Capability/Components/ShowComponent/index.tsx
index bbc7b8bb8..c1d9c5c1b 100644
--- a/dashboard/src/pages/Capability/Components/ShowComponent/index.tsx
+++ b/dashboard/src/pages/Capability/Components/ShowComponent/index.tsx
@@ -31,14 +31,14 @@ export default ({ name, parameters }: ShowParameters) => {
dataIndex: 'name',
key: 'name',
width: 200,
- render: (text, row) => [
+ render: (text, row) => (
{row.name}
{!row.required ? undefined : request}
- ,
- ],
+
+ ),
},
{
title: 'Short',
@@ -46,11 +46,11 @@ export default ({ name, parameters }: ShowParameters) => {
key: 'short',
width: 100,
responsive: ['md'],
- render: (text, row) => [
+ render: (text, row) => (
{!row.short ? undefined : {text}}
- ,
- ],
+
+ ),
},
{
title: 'Usage',
@@ -71,11 +71,11 @@ export default ({ name, parameters }: ShowParameters) => {
key: 'default',
width: 200,
responsive: ['md'],
- render: (text, row) => [
+ render: (text, row) => (
- {!row.default ? undefined : {text}}
- ,
- ],
+ {!row.default ? undefined : {text.toString()}}
+
+ ),
},
]}
dataSource={parameters}
diff --git a/dashboard/src/pages/Capability/Traits/index.tsx b/dashboard/src/pages/Capability/Traits/index.tsx
index 014634552..eafcbdf0e 100644
--- a/dashboard/src/pages/Capability/Traits/index.tsx
+++ b/dashboard/src/pages/Capability/Traits/index.tsx
@@ -27,13 +27,13 @@ export default (): React.ReactNode => {
- rowKey={(record) => record.name}
+ rowKey="name"
headerTitle="Type"
pagination={{
defaultPageSize: 5,
showSizeChanger: false,
}}
- loading={loading ? { delay: 300 } : undefined}
+ loading={loading ? { delay: 60 } : undefined}
dataSource={traitsList ?? []}
split
metas={{
@@ -49,22 +49,15 @@ export default (): React.ReactNode => {
);
},
},
- subTitle: {
- render: (text, row) => {
- return (
-
- {row.crdName}
-
- );
- },
- },
content: {
render: (text, row) => {
return (
applies to:
{row.appliesTo.map((item: string) => (
- {item}
+
+ {item}
+
))}
);
diff --git a/dashboard/src/pages/Capability/Workloads/index.tsx b/dashboard/src/pages/Capability/Workloads/index.tsx
index 13d5dc0df..5b1962570 100644
--- a/dashboard/src/pages/Capability/Workloads/index.tsx
+++ b/dashboard/src/pages/Capability/Workloads/index.tsx
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
-import { Button, Card, Space, Tag, Typography } from 'antd';
+import { Button, Card, Typography } from 'antd';
import { useModel } from 'umi';
import { PageContainer } from '@ant-design/pro-layout';
import { FileWordTwoTone, SnippetsTwoTone } from '@ant-design/icons';
@@ -50,15 +50,6 @@ export default (): React.ReactNode => {
);
},
},
- subTitle: {
- render: (text, row) => {
- return (
-
- {!row.required ? undefined : Required}
-
- );
- },
- },
actions: {
render: (text, row) => [