Skip to content

Commit

Permalink
Merge branch 'main' into reword-pr-merge-options
Browse files Browse the repository at this point in the history
  • Loading branch information
lafriks committed Aug 2, 2021
2 parents 0daf6bd + 24366ed commit d9a8ee8
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 42 deletions.
14 changes: 7 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ trigger:
steps:
- name: deps-frontend
pull: always
image: node:16
image: node:14
commands:
- make node_modules

- name: lint-frontend
image: node:16
image: node:14
commands:
- make lint-frontend
depends_on: [deps-frontend]
Expand Down Expand Up @@ -58,7 +58,7 @@ steps:
TAGS: bindata gogit sqlite sqlite_unlock_notify

- name: checks-frontend
image: node:16
image: node:14
commands:
- make checks-frontend
depends_on: [deps-frontend]
Expand All @@ -71,13 +71,13 @@ steps:
depends_on: [lint-backend]

- name: test-frontend
image: node:16
image: node:14
commands:
- make test-frontend
depends_on: [lint-frontend]

- name: build-frontend
image: node:16
image: node:14
commands:
- make frontend
depends_on: [test-frontend]
Expand Down Expand Up @@ -514,7 +514,7 @@ steps:
pull: always
image: techknowlogick/xgo:go-1.16.x
commands:
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs
- export PATH=$PATH:$GOPATH/bin
- make release
environment:
Expand Down Expand Up @@ -610,7 +610,7 @@ steps:
pull: always
image: techknowlogick/xgo:go-1.16.x
commands:
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs
- export PATH=$PATH:$GOPATH/bin
- make release
environment:
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_ja-JP.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,7 @@ editor.require_signed_commit=ブランチでは署名されたコミットが必
commits.desc=ソースコードの変更履歴を参照します。
commits.commits=コミット
commits.no_commits=共通のコミットはありません。 '%s''%s' の履歴はすべて異なっています。
commits.nothing_to_compare=二つのブランチは同じ内容です。
commits.search=コミットの検索…
commits.search.tooltip=キーワード "author:""committer:""after:""before:" を付けて指定できます。 例 "revert author:Alice before:2019-04-01"
commits.find=検索
Expand Down
5 changes: 3 additions & 2 deletions options/locale/locale_pt-PT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,7 @@ editor.require_signed_commit=O ramo requer um cometimento assinado
commits.desc=Navegar pelo histórico de modificações no código fonte.
commits.commits=Cometimentos
commits.no_commits=Não há cometimentos em comum. '%s' e '%s' têm históricos completamente diferentes.
commits.nothing_to_compare=Estes ramos são iguais.
commits.search=Procurar cometimentos…
commits.search.tooltip=Pode prefixar palavras-chave com "author:", "committer:", "after:", ou "before:". Por exemplo: "revert author:Alice before:2019-04-01".
commits.find=Procurar
Expand Down Expand Up @@ -1828,8 +1829,8 @@ settings.event_pull_request_review=Pedido de integração revisto
settings.event_pull_request_review_desc=Pedido de integração aprovado, rejeitado ou comentado na revisão.
settings.event_pull_request_sync=Pedido de integração sincronizado
settings.event_pull_request_sync_desc=Pedido de integração sincronizado.
settings.branch_filter=Filtro por ramo
settings.branch_filter_desc=Lista de permissões do ramo para eventos de envio e de criação e eliminação de ramos, especificada como um padrão glob. Se estiver em branco ou for <code>*</code>, serão reportados eventos para todos os ramos. Veja a documentação <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> para ver os detalhes da sintaxe. Exemplos: <code>trunk</code>, <code>{trunk,release*}</code>.
settings.branch_filter=Filtro de ramos
settings.branch_filter_desc=Lista dos ramos a serem considerados nos eventos de envio e de criação e eliminação de ramos, especificada como um padrão glob. Se estiver em branco ou for <code>*</code>, serão reportados eventos para todos os ramos. Veja a documentação <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> para ver os detalhes da sintaxe. Exemplos: <code>trunk</code>, <code>{trunk,release*}</code>.
settings.active=Em funcionamento
settings.active_helper=Informação sobre eventos despoletados será enviada para o URL deste automatismo web.
settings.add_hook_success=O automatismo web foi adicionado.
Expand Down
2 changes: 1 addition & 1 deletion routers/api/v1/repo/topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func UpdateTopics(ctx *context.APIContext) {

// AddTopic adds a topic name to a repo
func AddTopic(ctx *context.APIContext) {
// swagger:operation PUT /repos/{owner}/{repo}/topics/{topic} repository repoAddTopíc
// swagger:operation PUT /repos/{owner}/{repo}/topics/{topic} repository repoAddTopic
// ---
// summary: Add a topic to a repository
// produces:
Expand Down
7 changes: 7 additions & 0 deletions routers/api/v1/swagger/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ type swaggerResponseOAuth2Application struct {
// in:body
Body api.OAuth2Application `json:"body"`
}

// AccessToken represents an API access token.
// swagger:response AccessToken
type swaggerResponseAccessToken struct {
// in:body
Body api.AccessToken `json:"body"`
}
3 changes: 3 additions & 0 deletions routers/api/v1/swagger/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ type swaggerParameterBodies struct {
// in:body
CreateTagOption api.CreateTagOption

// in:body
CreateAccessTokenOption api.CreateAccessTokenOption

// in:body
UserSettingsOptions api.UserSettingsOptions
}
9 changes: 2 additions & 7 deletions routers/api/v1/user/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,10 @@ func CreateAccessToken(ctx *context.APIContext) {
// description: username of user
// type: string
// required: true
// - name: accessToken
// - name: userCreateToken
// in: body
// schema:
// type: object
// required:
// - name
// properties:
// name:
// type: string
// "$ref": "#/definitions/CreateAccessTokenOption"
// responses:
// "201":
// "$ref": "#/responses/AccessToken"
Expand Down
3 changes: 3 additions & 0 deletions services/wiki/wiki.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ func prepareWikiFileName(gitRepo *git.Repository, wikiName string) (bool, string
// Look for both files
filesInIndex, err := gitRepo.LsTree("master", unescaped, escaped)
if err != nil {
if strings.Contains(err.Error(), "Not a valid object name master") {
return false, escaped, nil
}
log.Error("%v", err)
return false, escaped, err
}
Expand Down
29 changes: 29 additions & 0 deletions services/wiki/wiki_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
package wiki

import (
"io/ioutil"
"os"
"path/filepath"
"testing"

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/util"

"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -261,3 +265,28 @@ func TestPrepareWikiFileName(t *testing.T) {
})
}
}

func TestPrepareWikiFileName_FirstPage(t *testing.T) {
models.PrepareTestEnv(t)

// Now create a temporaryDirectory
tmpDir, err := ioutil.TempDir("", "empty-wiki")
assert.NoError(t, err)
defer func() {
if _, err := os.Stat(tmpDir); !os.IsNotExist(err) {
_ = util.RemoveAll(tmpDir)
}
}()

err = git.InitRepository(tmpDir, true)
assert.NoError(t, err)

gitRepo, err := git.OpenRepository(tmpDir)
defer gitRepo.Close()
assert.NoError(t, err)

existence, newWikiPath, err := prepareWikiFileName(gitRepo, "Home")
assert.False(t, existence)
assert.NoError(t, err)
assert.Equal(t, "Home.md", newWikiPath)
}
41 changes: 16 additions & 25 deletions templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9651,7 +9651,7 @@
"repository"
],
"summary": "Add a topic to a repository",
"operationId": "repoAddTopíc",
"operationId": "repoAddTopic",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -11917,18 +11917,10 @@
"required": true
},
{
"name": "accessToken",
"name": "userCreateToken",
"in": "body",
"schema": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
}
}
"$ref": "#/definitions/CreateAccessTokenOption"
}
}
],
Expand Down Expand Up @@ -12654,6 +12646,17 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"CreateAccessTokenOption": {
"description": "CreateAccessTokenOption options when create access token",
"type": "object",
"properties": {
"name": {
"type": "string",
"x-go-name": "Name"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"CreateBranchProtectionOption": {
"description": "CreateBranchProtectionOption options for creating a branch protection",
"type": "object",
Expand Down Expand Up @@ -17045,20 +17048,8 @@
"responses": {
"AccessToken": {
"description": "AccessToken represents an API access token.",
"headers": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"sha1": {
"type": "string"
},
"token_last_eight": {
"type": "string"
}
"schema": {
"$ref": "#/definitions/AccessToken"
}
},
"AccessTokenList": {
Expand Down

0 comments on commit d9a8ee8

Please sign in to comment.