Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1295b09
fix: fix the issue where the comment_id parameter is forcibly convert…
shuashuai Nov 18, 2025
59b2198
fix: Optimization of request parameters
shuashuai Nov 18, 2025
666ab70
feat(ui): add min values for inputs and context-based keyboards for i…
Dinesht04 Nov 12, 2025
157dbfd
feat(ui): add types, logic and defaults for min, max value of input c…
Dinesht04 Nov 13, 2025
54e602c
fix(ui): refactor number input props (min,max)
Dinesht04 Nov 19, 2025
9a7eb0f
fix(service): set default language to "en_US" if invalid language is …
LinkinStars Nov 20, 2025
09b6b34
fix(comment): decode CommentID using DeShortID for consistency
LinkinStars Nov 20, 2025
a15dd41
refactor(internal): compile regex once while clearing text
ferhatelmas Nov 22, 2025
ce053cc
fix: multi byte run boundary for cut long title
ferhatelmas Nov 24, 2025
0777291
fix(ui): null pointer access if get branding fails
ferhatelmas Nov 26, 2025
da27577
fix(answer): update QuestionID handling in answer update process
LinkinStars Nov 28, 2025
bc629db
chore(deps): bump mockgen to 0.6.0 for go1.25 support
ferhatelmas Nov 27, 2025
fc2a1d8
fix(answer): update QuestionID handling in answer update process
LinkinStars Nov 28, 2025
5c2c63f
Merge branch 'dev' into test
shuashuai Dec 1, 2025
f723d12
feat: add golangci-lint into lint target
ferhatelmas Nov 28, 2025
9540ef6
refactor(goimports): add goimports to golangci-lint configuration #1432
LinkinStars Dec 1, 2025
b54e734
fix: footer layout adjustment
shuashuai Dec 1, 2025
5e705a1
refactor(lint): improve error handling and code consistency across mu…
LinkinStars Dec 1, 2025
d67c7e2
fix: footer layout adjustment
shuashuai Dec 1, 2025
670aa32
refactor(lint): add new linters and fix their issues
ferhatelmas Dec 1, 2025
26ded22
Merge remote-tracking branch 'origin/dev' into test
LinkinStars Dec 5, 2025
ab75975
fix: When the input box's type is set to number, the result is forcib…
shuashuai Dec 5, 2025
c514731
Merge branch 'test' of github.com:apache/answer into test
shuashuai Dec 5, 2025
6660cdf
fix: add missing revision data for default content (fixes #1436)
oxkrypton Dec 2, 2025
740ac61
fix: get right lang
liruohrh Dec 1, 2025
8e395d4
Polish translation
kinjelom Nov 22, 2025
48b1de8
Update pt_BR.yaml
joaoback Sep 13, 2025
5358650
fix: The page tag selector exceeds the page height, causing the page …
shuashuai Dec 10, 2025
57ba299
chore: turkish translation improved (#1454)
aburakt Dec 11, 2025
d468e2b
feat: add env for glob load template files by gin debug render
liruohrh Dec 6, 2025
48fc64d
Merge remote-tracking branch 'origin/dev' into test
LinkinStars Dec 11, 2025
570ee76
Merge branch 'feat/1.7.1/answer' into test
LinkinStars Dec 11, 2025
f4b6cae
docs(Makefile): upgrade version to 1.7.1
LinkinStars Dec 11, 2025
81d9eb1
style(sideNav): update ASF header
LinkinStars Dec 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ vendor/
/answer-data/
/answer
/new_answer

build/tools/
dist/

# Lint setup generated file
Expand Down
49 changes: 49 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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.

version: "2"
linters:
exclusions:
paths:
- answer-data
- ui
- i18n
enable:
- asasalint # checks for pass []any as any in variadic func(...any)
- asciicheck # checks that your code does not contain non-ASCII identifiers
- bidichk # checks for dangerous unicode character sequences
- bodyclose # checks whether HTTP response body is closed successfully
- canonicalheader # checks whether net/http.Header uses canonical header
- copyloopvar # detects places where loop variables are copied (Go 1.22+)
- gocritic # provides diagnostics that check for bugs, performance and style issues
- misspell # finds commonly misspelled English words in comments and strings
- modernize # detects code that can be modernized to use newer Go features
- testifylint # checks usage of github.com/stretchr/testify
- unconvert # removes unnecessary type conversions
- unparam # reports unused function parameters
- whitespace # detects leading and trailing whitespace

formatters:
enable:
- gofmt
- goimports
settings:
gofmt:
simplify: true
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build clean ui

VERSION=1.7.0
VERSION=1.7.1
BIN=answer
DIR_SRC=./cmd/answer
DOCKER_CMD=docker
Expand All @@ -10,6 +10,15 @@ Revision=$(shell git rev-parse --short HEAD 2>/dev/null || echo "")
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)"

GOLANGCI_VERSION ?= v2.6.2
TOOLS_BIN := $(shell mkdir -p build/tools && realpath build/tools)

GOLANGCI = $(TOOLS_BIN)/golangci-lint-$(GOLANGCI_VERSION)
$(GOLANGCI):
rm -f $(TOOLS_BIN)/golangci-lint*
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/$(GOLANGCI_VERSION)/install.sh | sh -s -- -b $(TOOLS_BIN) $(GOLANGCI_VERSION)
mv $(TOOLS_BIN)/golangci-lint $(TOOLS_BIN)/golangci-lint-$(GOLANGCI_VERSION)

build: generate
@$(GO) build $(GO_FLAGS) -o $(BIN) $(DIR_SRC)

Expand All @@ -23,10 +32,10 @@ universal: generate
generate:
@$(GO) get github.com/swaggo/swag/cmd/[email protected]
@$(GO) get github.com/google/wire/cmd/[email protected]
@$(GO) get go.uber.org/mock/mockgen@v0.5.0
@$(GO) get go.uber.org/mock/mockgen@v0.6.0
@$(GO) install github.com/swaggo/swag/cmd/[email protected]
@$(GO) install github.com/google/wire/cmd/[email protected]
@$(GO) install go.uber.org/mock/mockgen@v0.5.0
@$(GO) install go.uber.org/mock/mockgen@v0.6.0
@$(GO) generate ./...
@$(GO) mod tidy

Expand All @@ -50,8 +59,12 @@ install-ui-packages:
ui:
@cd ui && pnpm pre-install && pnpm build && cd -

lint: generate
lint: generate $(GOLANGCI)
@bash ./script/check-asf-header.sh
$(GOLANGCI) run

lint-fix: generate $(GOLANGCI)
@bash ./script/check-asf-header.sh
@gofmt -w -l .
$(GOLANGCI) run --fix

all: clean build
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.0
docker run -d -p 9080:80 -v answer-data:/data --name answer apache/answer:1.7.1
```

For more information, see [Installation](https://answer.apache.org/docs/installation).
Expand All @@ -43,7 +43,7 @@ You can also check out the [plugins here](https://answer.apache.org/plugins).
- Golang >= 1.23
- Node.js >= 20
- pnpm >= 9
- [mockgen](https://github.com/uber-go/mock?tab=readme-ov-file#installation) >= 1.6.0
- [mockgen](https://github.com/uber-go/mock?tab=readme-ov-file#installation) >= 0.6.0
- [wire](https://github.com/google/wire/) >= 0.5.0

### Build
Expand Down
3 changes: 1 addition & 2 deletions cmd/wire.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build wireinject
// +build wireinject

/*
* Licensed to the Apache Software Foundation (ASF) under one
Expand Down Expand Up @@ -32,7 +31,7 @@ import (
"github.com/apache/answer/internal/base/server"
"github.com/apache/answer/internal/base/translator"
"github.com/apache/answer/internal/controller"
"github.com/apache/answer/internal/controller/template_render"
templaterender "github.com/apache/answer/internal/controller/template_render"
"github.com/apache/answer/internal/controller_admin"
"github.com/apache/answer/internal/repo"
"github.com/apache/answer/internal/router"
Expand Down
8 changes: 4 additions & 4 deletions cmd/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 25 additions & 14 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8080,9 +8080,6 @@ const docTemplate = `{
"id": {
"type": "string"
},
"question_id": {
"type": "string"
},
"title": {
"type": "string"
}
Expand Down Expand Up @@ -9780,8 +9777,6 @@ const docTemplate = `{
"schema.QuestionAdd": {
"type": "object",
"required": [
"content",
"tags",
"title"
],
"properties": {
Expand All @@ -9796,7 +9791,7 @@ const docTemplate = `{
"description": "content",
"type": "string",
"maxLength": 65535,
"minLength": 6
"minLength": 0
},
"tags": {
"description": "tags",
Expand All @@ -9817,8 +9812,6 @@ const docTemplate = `{
"type": "object",
"required": [
"answer_content",
"content",
"tags",
"title"
],
"properties": {
Expand All @@ -9838,7 +9831,7 @@ const docTemplate = `{
"description": "content",
"type": "string",
"maxLength": 65535,
"minLength": 6
"minLength": 0
},
"mention_username_list": {
"type": "array",
Expand Down Expand Up @@ -10119,9 +10112,7 @@ const docTemplate = `{
"schema.QuestionUpdate": {
"type": "object",
"required": [
"content",
"id",
"tags",
"title"
],
"properties": {
Expand All @@ -10136,7 +10127,7 @@ const docTemplate = `{
"description": "content",
"type": "string",
"maxLength": 65535,
"minLength": 6
"minLength": 0
},
"edit_summary": {
"description": "edit summary",
Expand Down Expand Up @@ -10926,7 +10917,7 @@ const docTemplate = `{
},
"theme_config": {
"type": "object",
"additionalProperties": true
"additionalProperties": {}
}
}
},
Expand All @@ -10941,7 +10932,7 @@ const docTemplate = `{
},
"theme_config": {
"type": "object",
"additionalProperties": true
"additionalProperties": {}
},
"theme_options": {
"type": "array",
Expand Down Expand Up @@ -11047,6 +11038,16 @@ const docTemplate = `{
"max_image_size": {
"type": "integer"
},
"min_content": {
"type": "integer",
"maximum": 65535,
"minimum": 0
},
"min_tags": {
"type": "integer",
"maximum": 5,
"minimum": 0
},
"recommend_tags": {
"type": "array",
"items": {
Expand Down Expand Up @@ -11091,6 +11092,16 @@ const docTemplate = `{
"max_image_size": {
"type": "integer"
},
"min_content": {
"type": "integer",
"maximum": 65535,
"minimum": 0
},
"min_tags": {
"type": "integer",
"maximum": 5,
"minimum": 0
},
"recommend_tags": {
"type": "array",
"items": {
Expand Down
Loading