Skip to content

Commit

Permalink
docs(contributing): update contributing guidelines and labeler
Browse files Browse the repository at this point in the history
  • Loading branch information
donch1989 committed Sep 25, 2023
1 parent 1ede4d8 commit e5cbf78
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 80 deletions.
87 changes: 85 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,79 @@ Please refer to the [community contributing section](https://github.com/instill-

Before delving into the details to come up with your first PR, please familiarise yourself with the project structure of [Instill Core](https://github.com/instill-ai/community#instill-core).

### Prerequisites & Development
### Prerequisites

Please refer to [here](../README.md).
- [Instill Base](https://github.com/instill-ai/base)

### Pre-commit hooks

check out `.pre-commit-config.yaml` for the set of hooks that we used

## Local development

On the local machine, clone `base` repository in your workspace, move to the repository folder, and launch all dependent microservices:
```
$ cd <your-workspace>
$ git clone https://github.com/instill-ai/base.git
$ cd base
$ make latest PROFILE=mgmt
```

Clone `mgmt-backend` repository in your workspace and move to the repository folder:
```
$ cd <your-workspace>
$ git clone https://github.com/instill-ai/mgmt-backend.git
$ cd mgmt-backend
```

### Build the dev image

```bash
$ make build
```

### Run the dev container

```bash
$ make dev
```

Now, you have the Go project set up in the container, in which you can compile and run the binaries together with the integration test in each container shell.

### Run the server in the container

Enter the container
```bash
$ docker exec -it mgmt-backend /bin/bash
```

Create the database
```bash
$ go run ./cmd/migration
```

Initialise the database
```bash
$ go run ./cmd/init
```

Run the server
```bash
$ go run ./cmd/main
```

### Run the integration test

``` bash
$ docker exec -it mgmt-backend /bin/bash
$ make integration-test
```

### Stop the dev container

```bash
$ make stop
```

### Sending PRs

Expand All @@ -32,6 +102,19 @@ Please take these general guidelines into consideration when you are sending a P

When you are ready to send a PR, we recommend you to first open a `draft` one. This will trigger a bunch of `tests` [workflows](https://github.com/instill-ai/mgmt-backend/tree/main/.github/workflows) running a thorough test suite on multiple platforms. After the tests are done and passed, you can now mark the PR `open` to notify the codebase owners to review. We appreciate your endeavour to pass the integration test for your PR to make sure the sanity with respect to the entire scope of **Instill Core**.


### CI/CD

- **pull_request** to the `main` branch will trigger the **`Integration Test`** workflow running the integration test using the image built on the PR head branch.
- **push** to the `main` branch will trigger
- the **`Integration Test`** workflow building and pushing the `:latest` image on the `main` branch, following by running the integration test, and
- the **`Release Please`** workflow, which will create and update a PR with respect to the up-to-date `main` branch using [release-please-action](https://github.com/google-github-actions/release-please-action).

Once the release PR is merged to the `main` branch, the [release-please-action](https://github.com/google-github-actions/release-please-action) will tag and release a version correspondingly.

The images are pushed to Docker Hub [repository](https://hub.docker.com/r/instill/mgmt-backend).


## Last words

Your contributions make a difference. Let's build something amazing together!
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
🗿 instill-base:
instill base:
- "**"
77 changes: 0 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,83 +4,6 @@

mgmt-backend manages user-related resources.

## Local dev

On the local machine, clone `base` repository in your workspace, move to the repository folder, and launch all dependent microservices:
```
$ cd <your-workspace>
$ git clone https://github.com/instill-ai/base.git
$ cd base
$ make latest PROFILE=mgmt
```

Clone `mgmt-backend` repository in your workspace and move to the repository folder:
```
$ cd <your-workspace>
$ git clone https://github.com/instill-ai/mgmt-backend.git
$ cd mgmt-backend
```

### Build the dev image

```bash
$ make build
```

### Run the dev container

```bash
$ make dev
```

Now, you have the Go project set up in the container, in which you can compile and run the binaries together with the integration test in each container shell.

### Run the server in the container

Enter the container
```bash
$ docker exec -it mgmt-backend /bin/bash
```

Create the database
```bash
$ go run ./cmd/migration
```

Initialise the database
```bash
$ go run ./cmd/init
```

Run the server
```bash
$ go run ./cmd/main
```

### Run the integration test

``` bash
$ docker exec -it mgmt-backend /bin/bash
$ make integration-test
```

### Stop the dev container

```bash
$ make stop
```

### CI/CD

- **pull_request** to the `main` branch will trigger the **`Integration Test`** workflow running the integration test using the image built on the PR head branch.
- **push** to the `main` branch will trigger
- the **`Integration Test`** workflow building and pushing the `:latest` image on the `main` branch, following by running the integration test, and
- the **`Release Please`** workflow, which will create and update a PR with respect to the up-to-date `main` branch using [release-please-action](https://github.com/google-github-actions/release-please-action).

Once the release PR is merged to the `main` branch, the [release-please-action](https://github.com/google-github-actions/release-please-action) will tag and release a version correspondingly.

The images are pushed to Docker Hub [repository](https://hub.docker.com/r/instill/mgmt-backend).

## Contributing

Please refer to the [Contributing Guidelines](./.github/CONTRIBUTING.md) for more details.
Expand Down

0 comments on commit e5cbf78

Please sign in to comment.