Skip to content

Commit

Permalink
Merge branch 'main' into apache
Browse files Browse the repository at this point in the history
# Conflicts:
#	script/plugin_list
  • Loading branch information
LinkinStars committed Jan 21, 2025
2 parents 76db516 + 5886c1e commit 4a8ab2e
Show file tree
Hide file tree
Showing 492 changed files with 28,123 additions and 9,403 deletions.
2 changes: 1 addition & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ github:
- q-and-a
- hacktoberfest
features:
wiki: false
wiki: true
issues: true
projects: true
discussions: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-binary-for-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.22
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/build-image-for-latest-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Build Latest Docker Image For Release

on:
push:
tags:
- v2.*
- v1.*
- v0.*
- "!v*-RC*"
# pull_request:
# branches: [ "main" ]

jobs:
build:
if: ${{ github.repository_owner == 'apache' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: apache/answer
tags: |
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
file: ./Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}


2 changes: 0 additions & 2 deletions .github/workflows/build-image-for-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ name: Build Docker Image For Release

on:
push:
branches: [ "main"]
tags:
- v2.*
- v1.*
Expand All @@ -41,7 +40,6 @@ jobs:
with:
images: apache/answer
tags: |
type=raw,value=latest
type=ref,enable=true,priority=600,prefix=,suffix=,event=branch
type=semver,pattern={{version}}
Expand Down
16 changes: 8 additions & 8 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# specific language governing permissions and limitations
# under the License.

version: 2

env:
- GO11MODULE=on
- GO111MODULE=on
Expand All @@ -32,7 +34,7 @@ builds:
- id: build
main: ./cmd/answer/.
binary: answer
ldflags: -s -w -X github.com/apache/incubator-answer/cmd.Version={{.RawVersion}} -X github.com/apache/incubator-answer/cmd.Revision={{.ShortCommit}} -X github.com/apache/incubator-answer/cmd.Time={{.Date}} -X github.com/apache/incubator-answer/cmd.BuildUser=goreleaser
ldflags: -s -w -X github.com/apache/answer/cmd.Version={{.RawVersion}} -X github.com/apache/answer/cmd.Revision={{.ShortCommit}} -X github.com/apache/answer/cmd.Time={{.Date}} -X github.com/apache/answer/cmd.BuildUser=goreleaser
flags: -v
goos:
- linux
Expand All @@ -43,7 +45,7 @@ builds:
- id: build-windows
main: ./cmd/answer/.
binary: answer
ldflags: -s -w -X github.com/apache/incubator-answer/cmd.Version={{.RawVersion}} -X github.com/apache/incubator-answer/cmd.Revision={{.ShortCommit}} -X github.com/apache/incubator-answer/cmd.Time={{.Date}} -X github.com/apache/incubator-answer/cmd.BuildUser=goreleaser
ldflags: -s -w -X github.com/apache/answer/cmd.Version={{.RawVersion}} -X github.com/apache/answer/cmd.Revision={{.ShortCommit}} -X github.com/apache/answer/cmd.Time={{.Date}} -X github.com/apache/answer/cmd.BuildUser=goreleaser
flags: -v
goos:
- windows
Expand All @@ -55,21 +57,19 @@ builds:

archives:
- name_template: >-
apache-answer-{{ .RawVersion }}-incubating-bin-{{ .Os }}-{{ .Arch }}
apache-answer-{{ .RawVersion }}-bin-{{ .Os }}-{{ .Arch }}
files:
- src: "docs/release/LICENSE"
dst: LICENSE
- src: "docs/release/NOTICE"
dst: NOTICE
- src: "docs/release/licenses/*"
dst: licenses/
- src: "DISCLAIMER"
dst: DISCLAIMER
wrap_in_directory: true
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}"
version_template: "{{ incpatch .Version }}"
changelog:
sort: asc
filters:
Expand All @@ -79,8 +79,8 @@ changelog:

source:
enabled: true
name_template: apache-answer-{{ .RawVersion }}-incubating-src
prefix_template: "apache-answer-{{ .RawVersion }}-incubating-src/"
name_template: apache-answer-{{ .RawVersion }}-src
prefix_template: "apache-answer-{{ .RawVersion }}-src/"

# goreleaser release --skip-validate --skip-publish --clean

4 changes: 2 additions & 2 deletions .vaunt/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ version: 0.0.1
achievements:
- achievement:
name: Visionary Architect
icon: https://raw.githubusercontent.com/apache/incubator-answer/main/.vaunt/enhancement.png
icon: https://raw.githubusercontent.com/apache/answer/main/.vaunt/enhancement.png
description: Awarded for bringing up enhancement, dream big!
triggers:
- trigger:
Expand All @@ -28,7 +28,7 @@ achievements:
condition: labels in ['enhancement'] & labels in ['LGTM']
- achievement:
name: Bug Hunter
icon: https://raw.githubusercontent.com/apache/incubator-answer/main/.vaunt/bug.png
icon: https://raw.githubusercontent.com/apache/answer/main/.vaunt/bug.png
description: Awarded for identifying real bugs, well spotted!
triggers:
- trigger:
Expand Down
10 changes: 0 additions & 10 deletions DISCLAIMER

This file was deleted.

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
# specific language governing permissions and limitations
# under the License.

FROM golang:1.19-alpine AS golang-builder
LABEL maintainer="[email protected]"
FROM golang:1.22-alpine AS golang-builder
LABEL maintainer="[email protected]"

ARG GOPROXY
# ENV GOPROXY ${GOPROXY:-direct}
# ENV GOPROXY=https://proxy.golang.com.cn,direct

ENV GOPATH /go
ENV GOROOT /usr/local/go
ENV PACKAGE github.com/apache/incubator-answer
ENV PACKAGE github.com/apache/answer
ENV BUILD_DIR ${GOPATH}/src/${PACKAGE}
ENV ANSWER_MODULE ${BUILD_DIR}

Expand Down
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.PHONY: build clean ui

VERSION=1.3.6
VERSION=1.4.2
BIN=answer
DIR_SRC=./cmd/answer
DOCKER_CMD=docker

GO_ENV=CGO_ENABLED=0 GO111MODULE=on
Revision=$(shell git rev-parse --short HEAD 2>/dev/null || echo "")
GO_FLAGS=-ldflags="-X github.com/apache/incubator-answer/cmd.Version=$(VERSION) -X 'github.com/apache/incubator-answer/cmd.Revision=$(Revision)' -X 'github.com/apache/incubator-answer/cmd.Time=`date +%s`' -extldflags -static"
GO=$(GO_ENV) $(shell which go)
GO_FLAGS=-ldflags="-X github.com/apache/answer/cmd.Version=$(VERSION) -X 'github.com/apache/answer/cmd.Revision=$(Revision)' -X 'github.com/apache/answer/cmd.Time=`date +%s`' -extldflags -static"
GO=$(GO_ENV) "$(shell which go)"

build: generate
@$(GO) build $(GO_FLAGS) -o $(BIN) $(DIR_SRC)
Expand All @@ -21,13 +21,20 @@ universal: generate
@rm -f ${BIN}_amd64 ${BIN}_arm64

generate:
@$(GO) get github.com/swaggo/swag/cmd/[email protected]
@$(GO) get github.com/google/wire/cmd/[email protected]
@$(GO) get github.com/golang/mock/[email protected]
@$(GO) get go.uber.org/mock/mockgen@latest
@$(GO) install github.com/swaggo/swag/cmd/[email protected]
@$(GO) install github.com/google/wire/cmd/[email protected]
@$(GO) install github.com/golang/mock/mockgen@v1.6.0
@$(GO) install go.uber.org/mock/mockgen@latest
@$(GO) generate ./...
@$(GO) mod tidy

check:
@mockgen -version
@swag -v
@wire flags

test:
@$(GO) test ./internal/repo/repo_test

Expand Down
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Apache Answer (incubating)
Copyright 2023-2024 The Apache Software Foundation
Apache Answer
Copyright 2023-2025 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (https://www.apache.org/).
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ A Q&A platform software for teams at any scales. Whether it’s a community foru

To learn more about the project, visit [answer.apache.org](https://answer.apache.org).

[![LICENSE](https://img.shields.io/github/license/apache/incubator-answer)](https://github.com/apache/incubator-answer/blob/main/LICENSE)
[![LICENSE](https://img.shields.io/github/license/apache/answer)](https://github.com/apache/answer/blob/main/LICENSE)
[![Language](https://img.shields.io/badge/language-go-blue.svg)](https://golang.org/)
[![Language](https://img.shields.io/badge/language-react-blue.svg)](https://reactjs.org/)
[![Go Report Card](https://goreportcard.com/badge/github.com/apache/incubator-answer)](https://goreportcard.com/report/github.com/apache/incubator-answer)
[![Go Report Card](https://goreportcard.com/badge/github.com/apache/answer)](https://goreportcard.com/report/github.com/apache/answer)
[![Discord](https://img.shields.io/badge/discord-chat-5865f2?logo=discord&logoColor=f5f5f5)](https://discord.gg/Jm7Y4cbUej)

## Screenshots
Expand All @@ -23,7 +23,7 @@ To learn more about the project, visit [answer.apache.org](https://answer.apache
### Running with docker

```bash
docker run -d -p 9080:80 -v answer-data:/data --name answer apache/answer:1.3.6
docker run -d -p 9080:80 -v answer-data:/data --name answer apache/answer:1.4.2
```

For more information, see [Installation](https://answer.apache.org/docs/installation).
Expand All @@ -40,20 +40,20 @@ You can also check out the [plugins here](https://answer.apache.org/plugins).

### Prerequisites

- Golang >= 1.18
- Golang >= 1.22
- Node.js >= 16.17
- pnpm >= 8
- mockgen >= 1.6.0
- wire >= 0.5.0
- [mockgen](https://github.com/uber-go/mock?tab=readme-ov-file#installation) >= 1.6.0
- [wire](https://github.com/google/wire/) >= 0.5.0

### Build

```bash
# install wire and mockgen for building
# Install wire and mockgen for building. You can run `make check` to check if they are installed.
$ make generate
# install frontend dependencies and build
# Install frontend dependencies and build
$ make ui
# install backend dependencies and build
# Install backend dependencies and build
$ make build
```

Expand All @@ -65,4 +65,4 @@ See [CONTRIBUTING](https://answer.apache.org/community/contributing) for ways to

## License

[Apache License 2.0](https://github.com/apache/incubator-answer/blob/main/LICENSE)
[Apache License 2.0](https://github.com/apache/answer/blob/main/LICENSE)
8 changes: 7 additions & 1 deletion charts/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "answer.fullname" . }}-claim
{{- with .Values.persistence.annotations }}
{{- with .Values.persistence.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
Expand All @@ -39,4 +39,10 @@ spec:
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- with .Values.persistence.dataSource }}
dataSource:
name: {{ .name }}
kind: {{ .kind | default "VolumeSnapshot" }}
apiGroup: {{ .apiGroup | default "snapshot.storage.k8s.io" }}
{{- end }}
{{- end }}
8 changes: 7 additions & 1 deletion charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ env:

# Configure extra containers
extraContainers: []
# - name: cloudsql-proxy
# - name: cloudsql-proxy
# image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.1.2
# command:
# - /cloud-sql-proxy
Expand All @@ -91,6 +91,12 @@ persistence:
accessMode: ReadWriteOnce
size: 5Gi
annotations: {}
# To restore a PVC from a VolumeSnapshot, set the dataSource;
# the kind and apiGroup are optional and default to the shown values
dataSource: {}
# name: my-volume-snapshot
# kind: VolumeSnapshot
# apiGroup: snapshot.storage.k8s.io

imagePullSecrets: []
nameOverride: ""
Expand Down
8 changes: 7 additions & 1 deletion cmd/answer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@
* under the License.
*/

//go:generate go run github.com/swaggo/swag/cmd/swag init -g ./cmd/answer/main.go -d ../../ -o ../../docs

package main

import (
answercmd "github.com/apache/incubator-answer/cmd"
answercmd "github.com/apache/answer/cmd"
)

// main godoc
// @title Apache Answer
// @description Apache Answer API
// @BasePath /
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization
Expand Down
Loading

0 comments on commit 4a8ab2e

Please sign in to comment.