Browse Source

docs: design openkf docs (#68)

tags/v0.1.0
Xinwei Xiong GitHub 3 years ago
parent
commit
04f03056c0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 102 additions and 55 deletions
  1. +11
    -7
      .github/workflows/kubekf.yml
  2. +1
    -1
      Dockerfile
  3. +11
    -6
      Makefile
  4. +0
    -40
      docs/contribution/issue specification.md
  5. +37
    -0
      docs/contribution/issue_specification.md
  6. BIN
      docs/images/openkf-log.png
  7. +2
    -0
      docs/test/e2e.md
  8. +2
    -0
      docs/test/integration.md
  9. +0
    -0
      docs/website/.gitignore
  10. +37
    -0
      docs/website/Makefile
  11. +1
    -1
      server/internal/router/router.go

+ 11
- 7
.github/workflows/kubekf.yml View File

@@ -44,6 +44,10 @@ jobs:
run: |
make tidy

- name: Run go format
run: |
make format

- name: Generate all necessary files, such as error code files
run: |
make generate
@@ -59,7 +63,7 @@ jobs:

- name: Build source code for host platform
run: |
# make build # skip build for now
make build # skip build for now

- name: Collect Test Coverage File
uses: actions/upload-artifact@v1.0.0
@@ -70,12 +74,12 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

# skip for now
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ env.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# skip for now
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ env.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

# skip for now
# - name: Build docker images for host arch and push images to registry


+ 1
- 1
Dockerfile View File

@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.18 AS build
FROM golang:alpine as builder

+ 11
- 6
Makefile View File

@@ -58,7 +58,8 @@ ifeq (, $(shell git status --porcelain 2>/dev/null))
endif
GIT_COMMIT:=$(shell git rev-parse HEAD)

IMG ?= ghcr.io/OpenIMSDK/OpenKF:latest
# Image URL to use all building/pushing image targets
IMG ?= openim/openkf:test

BUILDFILE = "./main.go"
BUILDAPP = "$(OUTPUT_DIR)/"
@@ -72,9 +73,7 @@ MAKEFLAGS += --no-print-directory
endif

# The OS must be linux when building docker images
PLATFORMS ?= linux_amd64 linux_arm64
# The OS can be linux/windows/darwin when building binaries
# PLATFORMS ?= darwin_amd64 windows_amd64 linux_amd64 linux_arm64
PLATFORMS ?= linux_s390x linux_mips64 linux_mips64le darwin_amd64 windows_amd64 linux_amd64 linux_arm64 linux_ppc64le

# Set a specific PLATFORM
ifeq ($(origin PLATFORM), undefined)
@@ -211,6 +210,12 @@ test.junit-report: tools.verify.go-junit-report

SERVER_DIR := server

## run: Run the server.
.PHONY: run
run:
@echo "===========> Run the server"
@cd $(SERVER_DIR) && $(GO) run main.go

## tidy: tidy go.mod
.PHONY: tidy
tidy:
@@ -269,7 +274,7 @@ cover: test.junit-report
## docker-build: Build docker image with the manager.
.PHONY: docker-build
docker-build: test
docker build -t ${IMG} .
docker build --pull --no-cache . -t ${IMG}

## docker-push: Push docker image with the manager.
.PHONY: docker-push
@@ -279,7 +284,7 @@ docker-push:
## docker-buildx-push: Push docker image with the manager using buildx.
.PHONY: docker-buildx-push
docker-buildx-push:
docker buildx build --platform linux/arm64,linux/amd64 -t ${IMG} . --push
docker buildx build -f --pull --no-cache --platform=$(PLATFORMS) --push . -t $(IMG)

## copyright-verify: Validate boilerplate headers for assign files.
.PHONY: copyright-verify


+ 0
- 40
docs/contribution/issue specification.md View File

@@ -1,40 +0,0 @@
# issue specification
we use [lot issues](https://github.com/openIMSDK/openKF/issues) before reporting bugs, Please make sure that has been
searching similar [question](https://github.com/OpenIMSDK/OpenKF/issues), because they may have already answered or
is being repaired. New questions should be directed
to [question assistant](https://github.com/OpenIMSDK/OpenKF/issues/new/choose) submitted. For bug reports, include
code that can
be used to reproduce the problem and how to reproduce
it. For new feature suggestions, indicate the changes you want and the expected behavior.
## **for committer**
##### **working for pr**
- commiters should finish code unit test again and record test dirary and if nessary do somke test
- commiters should check for code
convenant [code convenant](https://github.com/OpenIMSDK/OpenKF/blob/main/CONTRIBUTING.md)
##### **working for issue management**
- add labels to each issue and check it out.
- format issue style when needed.
- keep in touch with each contributor.
- Keep up with the status of the issue.
- assign one or more who to solve it.
## **for contributor**
##### **raise issue**
- developers should add full labels for issue you raised.(including **kind**(问题类型 such as,feat,bug),**Degree of
importance**(重要程度 emergency,important,normal),**strategy**(处置策略 such as self ,paticipant,coperation),*
*progress**(进度 such as running,later),**size**(问题规模 such as L,M,XXL))
##### **claim issue and make pr**
- developers can claim it by comment (want to claim + issueId)
- when doing pr process, developer should make Incremental testing at first and then doing **/contributor.md 's**
process.

+ 37
- 0
docs/contribution/issue_specification.md View File

@@ -0,0 +1,37 @@
# Issue Specification
Before reporting bugs, we highly recommend utilizing the [GitHub Issues](https://github.com/openIMSDK/openKF/issues) page. Please ensure to search for similar questions on the [issue board](https://github.com/OpenIMSDK/OpenKF/issues) as your query might have already been addressed or is currently being resolved. For new questions, kindly submit them through the [question assistant](https://github.com/OpenIMSDK/OpenKF/issues/new/choose).
When reporting bugs, include the necessary code to reproduce the problem and provide step-by-step instructions. For new feature suggestions, clearly describe the desired changes and expected behavior.
## For Committers
### Working on Pull Requests
- Committers should re-run unit tests on their code and document the test results. If necessary, conduct smoke tests.
- It is essential for committers to adhere to the [code covenant](https://github.com/OpenIMSDK/OpenKF/blob/main/CONTRIBUTING.md) regarding code formatting.
### Working on Issue Management
- Assign appropriate labels to each issue and regularly review them.
- Format issue descriptions when required.
- Maintain effective communication with contributors.
- Stay updated on the status of each issue.
- Assign one or more individuals to work on resolving the issues.
## For Contributors
### Raising an Issue
developers should add full labels for issue you raised.(including **kind**(问题类型 such as,feat,bug),**Degree of importance**(重要程度 emergency,important,normal),**strategy**(处置策略 such as self ,paticipant,coperation), **progress**(进度 such as running,later),**size**(问题规模 such as L,M,XXL))
### Claiming an Issue and Making Pull Requests
- Developers can claim an issue by commenting "want to claim + issue ID."
- When creating a pull request, developers should conduct incremental testing before proceeding with the process outlined in `/contributor.md`.
**Additional Details:**
The labels used within the project are synced from the [openim-yaml.yaml](https://github.com/kubecub/github-label-syncer/blob/main/labels-templates/openim-yaml.yaml) file. The [github-label-syncer](https://github.com/kubecub/github-label-syncer) project automatically validates and syncs these labels with the OpenIM-Server repository. A script is employed to periodically retrieve or sync the labels from OpenIM-Server using the actions mechanism. This synchronization process is incremental and also takes into consideration modifications. When adding labels to OpenKF, existing labels are not removed.
The labeling process is primarily automated through robots, with minimal manual intervention for label selection. In the future, the powerful Prow system will be leveraged to further enhance community management tasks and enable a high degree of automation.

BIN
docs/images/openkf-log.png View File

Before After
Width: 726  |  Height: 675  |  Size: 65 kB

+ 2
- 0
docs/test/e2e.md View File

@@ -0,0 +1,2 @@
# Running End-to-end Tests on Remote Clusters


+ 2
- 0
docs/test/integration.md View File

@@ -0,0 +1,2 @@
# Writing and Running Integration Tests


+ 0
- 0
docs/website/.gitignore View File


+ 37
- 0
docs/website/Makefile View File

@@ -0,0 +1,37 @@
REPO_ROOT:=${CURDIR}/..
# setup go for managing hugo
PATH:=$(shell cd $(REPO_ROOT) && . hack/build/setup-go.sh && echo "$${PATH}")
# go1.9+ can autodetect GOROOT, but if some other tool sets it ...
GOROOT:=
# enable modules
GO111MODULE=on
# disable CGO by default for static binaries
CGO_ENABLED=0
export PATH GOROOT GO111MODULE CGO_ENABLED
# work around broken PATH export
SPACE:=$(subst ,, )
SHELL:=env PATH=$(subst $(SPACE),\$(SPACE),$(PATH)) $(SHELL)

# from https://github.com/kubernetes/website/blob/master/Makefile
DOCKER = docker
HUGO_VERSION = 0.60.0
DOCKER_IMAGE = jojomi/hugo:$(HUGO_VERSION)
DOCKER_RUN = $(DOCKER) run --rm --interactive --tty --volume $(realpath $(CURDIR)/..):/src -p 1313:1313 --workdir /src/site --entrypoint=hugo --platform linux/amd64 $(DOCKER_IMAGE)

HUGO_BIN:=$(REPO_ROOT)/bin/hugo

$(HUGO_BIN):
go build -o $(HUGO_BIN) github.com/gohugoio/hugo

hugo: $(HUGO_BIN)

serve: hugo
$(HUGO_BIN) server --bind="0.0.0.0" \
--ignoreCache \
--buildFuture \
--disableFastRender

build: hugo
$(HUGO_BIN)

.PHONY: build serve hugo

+ 1
- 1
server/internal/router/router.go View File

@@ -18,7 +18,7 @@ import (
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"

_ "github.com/OpenIMSDK/OpenKF/server/docs"
// "github.com/OpenIMSDK/OpenKF/server/docs"

"github.com/gin-gonic/gin"



Loading…
Cancel
Save