mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	Compare commits
	
		
			7 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					30dbddcc4d | ||
| 
						 | 
					c491c22279 | ||
| 
						 | 
					5649f0d2b3 | ||
| 
						 | 
					7dd726faeb | ||
| 
						 | 
					14c979c1b2 | ||
| 
						 | 
					6b84a1d72b | ||
| 
						 | 
					68424eddf0 | 
							
								
								
									
										99
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										99
									
								
								.drone.yml
									
									
									
									
									
								
							@@ -558,7 +558,7 @@ steps:
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
kind: pipeline
 | 
			
		||||
name: docker
 | 
			
		||||
name: docker-linux-amd64
 | 
			
		||||
 | 
			
		||||
platform:
 | 
			
		||||
  os: linux
 | 
			
		||||
@@ -594,6 +594,7 @@ steps:
 | 
			
		||||
    settings:
 | 
			
		||||
      dry_run: true
 | 
			
		||||
      repo: gitea/gitea
 | 
			
		||||
      tags: linux-amd64
 | 
			
		||||
    when:
 | 
			
		||||
      event:
 | 
			
		||||
        - pull_request
 | 
			
		||||
@@ -603,6 +604,7 @@ steps:
 | 
			
		||||
    image: plugins/docker:linux-amd64
 | 
			
		||||
    settings:
 | 
			
		||||
      auto_tag: true
 | 
			
		||||
      auto_tag_suffix: linux-amd64
 | 
			
		||||
      repo: gitea/gitea
 | 
			
		||||
      password:
 | 
			
		||||
        from_secret: docker_password
 | 
			
		||||
@@ -613,6 +615,97 @@ steps:
 | 
			
		||||
        exclude:
 | 
			
		||||
        - pull_request
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
kind: pipeline
 | 
			
		||||
name: docker-linux-arm64
 | 
			
		||||
 | 
			
		||||
platform:
 | 
			
		||||
  os: linux
 | 
			
		||||
  arch: arm64
 | 
			
		||||
 | 
			
		||||
workspace:
 | 
			
		||||
  base: /go
 | 
			
		||||
  path: src/code.gitea.io/gitea
 | 
			
		||||
 | 
			
		||||
depends_on:
 | 
			
		||||
  - testing
 | 
			
		||||
 | 
			
		||||
trigger:
 | 
			
		||||
  ref:
 | 
			
		||||
  - refs/heads/master
 | 
			
		||||
  - "refs/tags/**"
 | 
			
		||||
  - "refs/pull/**"
 | 
			
		||||
 | 
			
		||||
steps:
 | 
			
		||||
  - name: fetch-tags
 | 
			
		||||
    pull: default
 | 
			
		||||
    image: docker:git
 | 
			
		||||
    commands:
 | 
			
		||||
      - git fetch --tags --force
 | 
			
		||||
    when:
 | 
			
		||||
      event:
 | 
			
		||||
        exclude:
 | 
			
		||||
          - pull_request
 | 
			
		||||
 | 
			
		||||
  - name: dryrun
 | 
			
		||||
    pull: always
 | 
			
		||||
    image: plugins/docker:linux-arm64
 | 
			
		||||
    settings:
 | 
			
		||||
      dry_run: true
 | 
			
		||||
      repo: gitea/gitea
 | 
			
		||||
      tags: linux-arm64
 | 
			
		||||
    when:
 | 
			
		||||
      event:
 | 
			
		||||
        - pull_request
 | 
			
		||||
 | 
			
		||||
  - name: publish
 | 
			
		||||
    pull: always
 | 
			
		||||
    image: plugins/docker:linux-arm64
 | 
			
		||||
    settings:
 | 
			
		||||
      auto_tag: true
 | 
			
		||||
      auto_tag_suffix: linux-arm64
 | 
			
		||||
      repo: gitea/gitea
 | 
			
		||||
      password:
 | 
			
		||||
        from_secret: docker_password
 | 
			
		||||
      username:
 | 
			
		||||
        from_secret: docker_username
 | 
			
		||||
    when:
 | 
			
		||||
      event:
 | 
			
		||||
        exclude:
 | 
			
		||||
        - pull_request
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
kind: pipeline
 | 
			
		||||
name: docker-manifest
 | 
			
		||||
 | 
			
		||||
platform:
 | 
			
		||||
  os: linux
 | 
			
		||||
  arch: amd64
 | 
			
		||||
 | 
			
		||||
steps:
 | 
			
		||||
  - name: manifest
 | 
			
		||||
    pull: always
 | 
			
		||||
    image: plugins/manifest
 | 
			
		||||
    settings:
 | 
			
		||||
      auto_tag: true
 | 
			
		||||
      ignore_missing: true
 | 
			
		||||
      spec: docker/manifest.tmpl
 | 
			
		||||
      password:
 | 
			
		||||
        from_secret: docker_password
 | 
			
		||||
      username:
 | 
			
		||||
        from_secret: docker_username
 | 
			
		||||
 | 
			
		||||
trigger:
 | 
			
		||||
  ref:
 | 
			
		||||
  - refs/heads/master
 | 
			
		||||
  - "refs/tags/**"
 | 
			
		||||
 | 
			
		||||
depends_on:
 | 
			
		||||
  - docker-linux-amd64
 | 
			
		||||
  - docker-linux-arm64
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
kind: pipeline
 | 
			
		||||
name: notify
 | 
			
		||||
@@ -635,7 +728,9 @@ depends_on:
 | 
			
		||||
  - translations
 | 
			
		||||
  - release-version
 | 
			
		||||
  - release-master
 | 
			
		||||
  - docker
 | 
			
		||||
  - docker-linux-amd64
 | 
			
		||||
  - docker-linux-arm64
 | 
			
		||||
  - docker-manifest
 | 
			
		||||
  - docs
 | 
			
		||||
 | 
			
		||||
steps:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								CHANGELOG.md
									
									
									
									
									
								
							@@ -4,6 +4,20 @@ This changelog goes through all the changes that have been made in each release
 | 
			
		||||
without substantial changes to our git log; to see the highlights of what has
 | 
			
		||||
been added to each release, please refer to the [blog](https://blog.gitea.io).
 | 
			
		||||
 | 
			
		||||
## [1.9.2](https://github.com/go-gitea/gitea/releases/tag/v1.9.2) - 2019-08-22
 | 
			
		||||
* BUGFIXES
 | 
			
		||||
  * Fix wrong sender when send slack webhook (#7918) (#7924)
 | 
			
		||||
  * Upload support text/plain; charset=utf8 (#7899)
 | 
			
		||||
  * Lfs/lock: round locked_at timestamp to second (#7872) (#7875)
 | 
			
		||||
  * Fix non existent milestone with 500 error (#7867) (#7873)
 | 
			
		||||
* SECURITY
 | 
			
		||||
  * Fix No PGP signature on 1.9.1 tag (#7874)
 | 
			
		||||
  * Release built with go 1.12.9 to fix security fixes in golang std lib, ref: https://groups.google.com/forum/#!msg/golang-announce/oeMaeUnkvVE/a49yvTLqAAAJ
 | 
			
		||||
* ENHANCEMENT
 | 
			
		||||
  * Fix pull creation with empty changes (#7920) (#7926)
 | 
			
		||||
* BUILD
 | 
			
		||||
  * Drone/docker: prepare multi-arch release + provide arm64 image (#7571) (#7884)
 | 
			
		||||
 | 
			
		||||
## [1.9.1](https://github.com/go-gitea/gitea/releases/tag/v1.9.1) - 2019-08-14
 | 
			
		||||
* BREAKING
 | 
			
		||||
  * Add pagination for admin api get orgs and fix only list public orgs bug (#7742) (#7752)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										19
									
								
								docker/manifest.tmpl
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								docker/manifest.tmpl
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
 | 
			
		||||
{{#if build.tags}}
 | 
			
		||||
tags:
 | 
			
		||||
{{#each build.tags}}
 | 
			
		||||
  - {{this}}
 | 
			
		||||
{{/each}}
 | 
			
		||||
{{/if}}
 | 
			
		||||
manifests:
 | 
			
		||||
  -
 | 
			
		||||
    image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
 | 
			
		||||
    platform:
 | 
			
		||||
      architecture: amd64
 | 
			
		||||
      os: linux
 | 
			
		||||
  -
 | 
			
		||||
    image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
 | 
			
		||||
    platform:
 | 
			
		||||
      architecture: arm64
 | 
			
		||||
      os: linux
 | 
			
		||||
      variant: v8
 | 
			
		||||
@@ -104,8 +104,11 @@ func TestAPILFSLocksLogged(t *testing.T) {
 | 
			
		||||
		req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/%s.git/info/lfs/locks", test.repo.FullName()), map[string]string{"path": test.path})
 | 
			
		||||
		req.Header.Set("Accept", "application/vnd.git-lfs+json")
 | 
			
		||||
		req.Header.Set("Content-Type", "application/vnd.git-lfs+json")
 | 
			
		||||
		session.MakeRequest(t, req, test.httpResult)
 | 
			
		||||
		resp := session.MakeRequest(t, req, test.httpResult)
 | 
			
		||||
		if len(test.addTime) > 0 {
 | 
			
		||||
			var lfsLock api.LFSLockResponse
 | 
			
		||||
			DecodeJSON(t, resp, &lfsLock)
 | 
			
		||||
			assert.EqualValues(t, lfsLock.Lock.LockedAt.Format(time.RFC3339), lfsLock.Lock.LockedAt.Format(time.RFC3339Nano)) //locked at should be rounded to second
 | 
			
		||||
			for _, id := range test.addTime {
 | 
			
		||||
				resultsTests[id].locksTimes = append(resultsTests[id].locksTimes, time.Now())
 | 
			
		||||
			}
 | 
			
		||||
@@ -124,6 +127,7 @@ func TestAPILFSLocksLogged(t *testing.T) {
 | 
			
		||||
		for i, lock := range lfsLocks.Locks {
 | 
			
		||||
			assert.EqualValues(t, test.locksOwners[i].DisplayName(), lock.Owner.Name)
 | 
			
		||||
			assert.WithinDuration(t, test.locksTimes[i], lock.LockedAt, 3*time.Second)
 | 
			
		||||
			assert.EqualValues(t, lock.LockedAt.Format(time.RFC3339), lock.LockedAt.Format(time.RFC3339Nano)) //locked at should be rounded to second
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		req = NewRequestWithJSON(t, "POST", fmt.Sprintf("/%s.git/info/lfs/locks/verify", test.repo.FullName()), map[string]string{})
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,7 @@ import (
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/url"
 | 
			
		||||
	"path"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"testing"
 | 
			
		||||
 | 
			
		||||
	"code.gitea.io/gitea/models"
 | 
			
		||||
@@ -93,3 +94,28 @@ func TestPullCreate_CommitStatus(t *testing.T) {
 | 
			
		||||
		}
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestPullCreate_EmptyChangesWithCommits(t *testing.T) {
 | 
			
		||||
	onGiteaRun(t, func(t *testing.T, u *url.URL) {
 | 
			
		||||
		session := loginUser(t, "user1")
 | 
			
		||||
		testRepoFork(t, session, "user2", "repo1", "user1", "repo1")
 | 
			
		||||
		testEditFileToNewBranch(t, session, "user1", "repo1", "master", "status1", "README.md", "status1")
 | 
			
		||||
		testEditFileToNewBranch(t, session, "user1", "repo1", "status1", "status1", "README.md", "# repo1\n\nDescription for repo1")
 | 
			
		||||
 | 
			
		||||
		url := path.Join("user1", "repo1", "compare", "master...status1")
 | 
			
		||||
		req := NewRequestWithValues(t, "POST", url,
 | 
			
		||||
			map[string]string{
 | 
			
		||||
				"_csrf": GetCSRF(t, session, url),
 | 
			
		||||
				"title": "pull request from status1",
 | 
			
		||||
			},
 | 
			
		||||
		)
 | 
			
		||||
		session.MakeRequest(t, req, http.StatusFound)
 | 
			
		||||
 | 
			
		||||
		req = NewRequest(t, "GET", "/user1/repo1/pulls/1")
 | 
			
		||||
		resp := session.MakeRequest(t, req, http.StatusOK)
 | 
			
		||||
		doc := NewHTMLParser(t, resp.Body)
 | 
			
		||||
 | 
			
		||||
		text := strings.TrimSpace(doc.doc.Find(".item.text.green").Text())
 | 
			
		||||
		assert.EqualValues(t, "This pull request can be merged automatically.", text)
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ func (l *LFSLock) APIFormat() *api.LFSLock {
 | 
			
		||||
	return &api.LFSLock{
 | 
			
		||||
		ID:       strconv.FormatInt(l.ID, 10),
 | 
			
		||||
		Path:     l.Path,
 | 
			
		||||
		LockedAt: l.Created,
 | 
			
		||||
		LockedAt: l.Created.Round(time.Second),
 | 
			
		||||
		Owner: &api.LFSLockOwner{
 | 
			
		||||
			Name: l.Owner.DisplayName(),
 | 
			
		||||
		},
 | 
			
		||||
 
 | 
			
		||||
@@ -598,7 +598,7 @@ func (pr *PullRequest) testPatch(e Engine) (err error) {
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		for i := range patchConflicts {
 | 
			
		||||
			if strings.Contains(stderr, patchConflicts[i]) {
 | 
			
		||||
				log.Trace("PullRequest[%d].testPatch (apply): has conflict", pr.ID)
 | 
			
		||||
				log.Trace("PullRequest[%d].testPatch (apply): has conflict: %s", pr.ID, stderr)
 | 
			
		||||
				const prefix = "error: patch failed:"
 | 
			
		||||
				pr.Status = PullRequestStatusConflict
 | 
			
		||||
				pr.ConflictedFiles = make([]string, 0, 5)
 | 
			
		||||
@@ -661,13 +661,16 @@ func NewPullRequest(repo *Repository, pull *Issue, labelIDs []int64, uuids []str
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	pr.Index = pull.Index
 | 
			
		||||
	if err = repo.savePatch(sess, pr.Index, patch); err != nil {
 | 
			
		||||
		return fmt.Errorf("SavePatch: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	pr.BaseRepo = repo
 | 
			
		||||
	if err = pr.testPatch(sess); err != nil {
 | 
			
		||||
		return fmt.Errorf("testPatch: %v", err)
 | 
			
		||||
	pr.Status = PullRequestStatusChecking
 | 
			
		||||
	if len(patch) > 0 {
 | 
			
		||||
		if err = repo.savePatch(sess, pr.Index, patch); err != nil {
 | 
			
		||||
			return fmt.Errorf("SavePatch: %v", err)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if err = pr.testPatch(sess); err != nil {
 | 
			
		||||
			return fmt.Errorf("testPatch: %v", err)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	// No conflict appears after test means mergeable.
 | 
			
		||||
	if pr.Status == PullRequestStatusChecking {
 | 
			
		||||
 
 | 
			
		||||
@@ -409,7 +409,7 @@ func UpdateRelease(doer *User, gitRepo *git.Repository, rel *Release, attachment
 | 
			
		||||
		Action:     api.HookReleaseUpdated,
 | 
			
		||||
		Release:    rel.APIFormat(),
 | 
			
		||||
		Repository: rel.Repo.APIFormat(mode),
 | 
			
		||||
		Sender:     rel.Publisher.APIFormat(),
 | 
			
		||||
		Sender:     doer.APIFormat(),
 | 
			
		||||
	}); err1 != nil {
 | 
			
		||||
		log.Error("PrepareWebhooks: %v", err)
 | 
			
		||||
	} else {
 | 
			
		||||
@@ -420,7 +420,7 @@ func UpdateRelease(doer *User, gitRepo *git.Repository, rel *Release, attachment
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DeleteReleaseByID deletes a release and corresponding Git tag by given ID.
 | 
			
		||||
func DeleteReleaseByID(id int64, u *User, delTag bool) error {
 | 
			
		||||
func DeleteReleaseByID(id int64, doer *User, delTag bool) error {
 | 
			
		||||
	rel, err := GetReleaseByID(id)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return fmt.Errorf("GetReleaseByID: %v", err)
 | 
			
		||||
@@ -459,12 +459,12 @@ func DeleteReleaseByID(id int64, u *User, delTag bool) error {
 | 
			
		||||
		return fmt.Errorf("LoadAttributes: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	mode, _ := AccessLevel(u, rel.Repo)
 | 
			
		||||
	mode, _ := AccessLevel(doer, rel.Repo)
 | 
			
		||||
	if err := PrepareWebhooks(rel.Repo, HookEventRelease, &api.ReleasePayload{
 | 
			
		||||
		Action:     api.HookReleaseDeleted,
 | 
			
		||||
		Release:    rel.APIFormat(),
 | 
			
		||||
		Repository: rel.Repo.APIFormat(mode),
 | 
			
		||||
		Sender:     rel.Publisher.APIFormat(),
 | 
			
		||||
		Sender:     doer.APIFormat(),
 | 
			
		||||
	}); err != nil {
 | 
			
		||||
		log.Error("PrepareWebhooks: %v", err)
 | 
			
		||||
	} else {
 | 
			
		||||
 
 | 
			
		||||
@@ -183,7 +183,8 @@ func CreateReleaseAttachment(ctx *context.APIContext) {
 | 
			
		||||
	allowed := false
 | 
			
		||||
	for _, t := range allowedTypes {
 | 
			
		||||
		t := strings.Trim(t, " ")
 | 
			
		||||
		if t == "*/*" || t == fileType {
 | 
			
		||||
		if t == "*/*" || t == fileType ||
 | 
			
		||||
			strings.HasPrefix(fileType, t+";") {
 | 
			
		||||
			allowed = true
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -48,7 +48,8 @@ func UploadAttachment(ctx *context.Context) {
 | 
			
		||||
	allowed := false
 | 
			
		||||
	for _, t := range allowedTypes {
 | 
			
		||||
		t := strings.Trim(t, " ")
 | 
			
		||||
		if t == "*/*" || t == fileType {
 | 
			
		||||
		if t == "*/*" || t == fileType ||
 | 
			
		||||
			strings.HasPrefix(fileType, t+";") {
 | 
			
		||||
			allowed = true
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -628,7 +628,8 @@ func UploadFileToServer(ctx *context.Context) {
 | 
			
		||||
		allowed := false
 | 
			
		||||
		for _, t := range setting.Repository.Upload.AllowedTypes {
 | 
			
		||||
			t := strings.Trim(t, " ")
 | 
			
		||||
			if t == "*/*" || t == fileType {
 | 
			
		||||
			if t == "*/*" || t == fileType ||
 | 
			
		||||
				strings.HasPrefix(fileType, t+";") {
 | 
			
		||||
				allowed = true
 | 
			
		||||
				break
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -253,6 +253,11 @@ func MilestoneIssuesAndPulls(ctx *context.Context) {
 | 
			
		||||
	milestoneID := ctx.ParamsInt64(":id")
 | 
			
		||||
	milestone, err := models.GetMilestoneByID(milestoneID)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		if models.IsErrMilestoneNotExist(err) {
 | 
			
		||||
			ctx.NotFound("GetMilestoneByID", err)
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		ctx.ServerError("GetMilestoneByID", err)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user