Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream update p2 (git: migrate to github.com/gogs/[email protected]) #89

Merged
merged 20 commits into from
Aug 31, 2020

Conversation

achilleas-k
Copy link
Member

@achilleas-k achilleas-k commented Aug 28, 2020

The only commit that required any kind of serious adjustments was the second-to-last one with message git: migrate to github.com/gogs/[email protected] (#5958)
73d790a

Review should only be necessary for the _gin.go files. All other changes in that commit come from upstream.

The upstream git-module went through a major update. We have our own fork for some tiny changes. The necessary ones are git-annex related and I've already moved to libgin a while ago. Another change was required for webdav which we have disabled for now (and will probably be removed completely).

  • Removing support for .gin.zip repository download. I don't think it's at all useful.
  • Removing captcha in arguments relating to file download.
    • CAPTCHA for unauthenticated downloads was removed a while ago.

It's running now on https://gin.dev.g-node.org for testing.

unknwon and others added 20 commits August 26, 2020 20:18
After first time running the application and went through the installation, the flag was always true until restarted.
- Allow remove primary logger at better location
- Use more appropriate log.Error to replace log.Fatal
* support API `GET /repos/:owner/:repo/contents/:path`

This PR adds support to #5949:
`GET /repos/:owner/:repo/contents/:path`

Curl:

```bash
curl -H "Authorization: token REDACTED"
http://localhost:3000/api/v1/repos/root/testrepo/contents//master/README.md
-X GET  | jq .
```

Curl  Response:

```bash
{
  "type": "blob",
  "size": 12,
  "name": "README.md",
  "path": "README.md",
  "sha": "70fcb456d436f08462602f26df6fb7e167e7a916",
  "url": "http://localhost:3000/api/v1/repos/root/testrepo/contents/README.md",
  "git_url": "http://localhost:3000/api/v1/repos/root/testrepo/trees/70fcb456d436f08462602f26df6fb7e167e7a916",
  "html_url": "http://localhost:3000/api/v1/repos/root/testrepo/tree/70fcb456d436f08462602f26df6fb7e167e7a916",
  "download_url": "http://localhost:3000/api/v1/root/testrepo/raw/README.md",
  "_links": {
    "git": "http://localhost:3000/api/v1/repos/root/testrepo/trees/70fcb456d436f08462602f26df6fb7e167e7a916",
    "self": "http://localhost:3000/api/v1/repos/root/testrepo/contents/README.md",
    "html": "http://localhost:3000/api/v1/repos/root/testrepo/tree/70fcb456d436f08462602f26df6fb7e167e7a916"
  },
  "content": "IyB0ZXN0cmVwbwoK"
}

```

* rename - path.go to contents.go

* reorder imports

Co-Authored-By: ᴜɴᴋɴᴡᴏɴ <[email protected]>

* rename struct to repoContents and fix field order

Co-Authored-By: ᴜɴᴋɴᴡᴏɴ <[email protected]>

* rename variable

Co-Authored-By: ᴜɴᴋɴᴡᴏɴ <[email protected]>

* rename GetPathContents to GetContents

Co-Authored-By: ᴜɴᴋɴᴡᴏɴ <[email protected]>

* return on server error

Co-Authored-By: ᴜɴᴋɴᴡᴏɴ <[email protected]>

* resolve conflicts introduced via git web ui

* make constants as method variables

* handle dir type case last

* fix func and var names

* implement suggested changes in review

* refactor smaller funcs to be part of GetContent

* fix content type check for blob after refactoring

* changes based on suggestions

* read full file, return empty json array

* don't set submoduleURL

* set server err msg to method name

* set target to be blob data for symlinks

* Update contents.go

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <[email protected]>
* WIP

* Finish `internal/db/git_diff.go`

* FInish internal/db/mirror.go

* Finish internal/db/pull.go

* Finish internal/db/release.go

* Finish internal/db/repo.go

* Finish internal/db/repo_branch.go

* Finish internal/db/repo_editor.go

* Finish internal/db/update.go

* Save my work

* Add license header

* Compile!

* Merge master

* Finish internal/cmd/hook.go

* Finish internal/conf/static.go

* Finish internal/context/repo.go

* Finish internal/db/action.go

* Finish internal/db/git_diff.go

* Fix submodule URL inferring

* Finish internal/db/mirror.go

* Updat to beta.4

* css: update fonts

* Finish internal/db/pull.go

* Finish internal/db/release.go

* Finish internal/db/repo_branch.go

* Finish internal/db/wiki.go

* gitutil: enhance infer submodule UR

* Finish internal/route/api/v1/repo/commits.go

* mirror: only collect branch commits after sync

* mirror: fix tag support

* Finish internal/db/repo.go

* Finish internal/db/repo_editor.go

* Finish internal/db/update.go

* Finish internal/gitutil/pull_request.go

* Make it compile

* Finish internal/route/repo/setting.go

* Finish internal/route/repo/branch.go

* Finish internal/route/api/v1/repo/file.go

* Finish internal/route/repo/download.go

* Finish internal/route/repo/editor.go

* Use helper

* Finish internal/route/repo/issue.go

* Finish internal/route/repo/pull.go

* Finish internal/route/repo/release.go

* Finish internal/route/repo/repo.go

* Finish internal/route/repo/wiki.go

* Finish internal/route/repo/commit.go

* Finish internal/route/repo/view.go

* Finish internal/gitutil/tag.go

* go.sum
1. Remove description for .gin.zip download but keep warning for pointer
   files.
2. Remove link for .gin.zip
@codecov-commenter
Copy link

Codecov Report

Merging #89 into master will increase coverage by 0.67%.
The diff coverage is 21.64%.

@@            Coverage Diff            @@
##           master     #89      +/-   ##
=========================================
+ Coverage    5.09%   5.77%   +0.67%     
=========================================
  Files          53      58       +5     
  Lines       10204   10285      +81     
=========================================
+ Hits          520     594      +74     
+ Misses       9598    9596       -2     
- Partials       86      95       +9     
Impacted Files Coverage Δ
internal/conf/static.go 100.00% <ø> (ø)
internal/db/action.go 0.49% <0.00%> (ø)
internal/db/issue.go 0.00% <0.00%> (ø)
internal/db/login_source.go 0.00% <0.00%> (ø)
internal/db/models_gin.go 0.00% <0.00%> (ø)
internal/db/org_team.go 0.00% <0.00%> (ø)
internal/db/pull.go 0.00% <0.00%> (ø)
internal/db/release.go 0.00% <0.00%> (ø)
internal/db/repo.go 1.59% <0.00%> (-0.01%) ⬇️
internal/db/repo_branch.go 0.00% <0.00%> (ø)
... and 27 more

Copy link
Contributor

@mpsonntag mpsonntag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _gin.go files LGTM.

@mpsonntag mpsonntag merged commit 85a0212 into G-Node:master Aug 31, 2020
@achilleas-k achilleas-k deleted the upstream-update-p2 branch August 31, 2020 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants