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

Monitor all git commands; move blame to git package and replace git as a variable #6864

Open
wants to merge 12 commits into
base: master
from

Conversation

6 participants
@lunny
Copy link
Member

commented May 6, 2019

This PR did some changes:

  • add to process manager when revoke command.Run in git package so that all git processes will be monitored from admin panel. All these git processes haven't been monitored before.
  • replaced all "git" as git.GitExecutable variable. will replace #6772.
  • create a method IsEmpty for git.Repository with tests.
  • move blame codes to package git.

@lunny lunny added the kind/refactor label May 6, 2019

@lunny lunny added this to the 1.9.0 milestone May 6, 2019

@GiteaBot GiteaBot added the lgtm/need 2 label May 6, 2019

@lunny lunny force-pushed the lunny:lunny/uniform_git branch from cc44cc6 to 1f2e62b May 6, 2019

@lunny lunny changed the title Monitor all git commands; move blame to git package and replace git as a variable WIP: Monitor all git commands; move blame to git package and replace git as a variable May 6, 2019

@lunny lunny force-pushed the lunny:lunny/uniform_git branch from 7dd6efe to 0c424c1 May 7, 2019

@codecov-io

This comment has been minimized.

Copy link

commented May 7, 2019

Codecov Report

❗️ No coverage uploaded for pull request base (master@9139f35). Click here to learn what that means.
The diff coverage is 38.55%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #6864   +/-   ##
=========================================
  Coverage          ?   41.12%           
=========================================
  Files             ?      432           
  Lines             ?    59507           
  Branches          ?        0           
=========================================
  Hits              ?    24474           
  Misses            ?    31822           
  Partials          ?     3211
Impacted Files Coverage Δ
modules/git/blame.go 78.26% <0%> (ø)
routers/repo/blame.go 0% <0%> (ø)
modules/git/command.go 95.71% <100%> (ø)
models/release.go 52.8% <100%> (ø)
models/git_diff.go 68.99% <12.5%> (ø)
routers/repo/http.go 36.45% <16.66%> (ø)
models/pull.go 50.41% <29.16%> (ø)
models/repo.go 47.82% <50%> (ø)
models/repo_mirror.go 23.65% <50%> (ø)
models/update.go 48.98% <50%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9139f35...d5a85ec. Read the comment docs.

@lunny lunny changed the title WIP: Monitor all git commands; move blame to git package and replace git as a variable Monitor all git commands; move blame to git package and replace git as a variable May 7, 2019

@lafriks

This comment has been minimized.

Copy link
Member

commented May 7, 2019

Unit test for TestRepoIsEmpty fails in drone

if err != nil {
if strings.Contains(stderr, "fatal: bad default revision 'HEAD'") {

This comment has been minimized.

Copy link
@sapk

sapk May 7, 2019

Member

This change seems to change how this function works. This will always error without setting the repo.IsEmpty previously to return. Is it intended because it fix an issue ? In place, of starting another cli command inside gitRepo.IsEmpty() couldn't we use a method IsEmptyRepoErr(err) parsing the error of OpenRepository ?

This comment has been minimized.

Copy link
@lunny

lunny May 7, 2019

Author Member

I run make unit-test locally successfully but don't know why it failed on drone. I move these codes to git package so that external shouldn't know how it works.

@lunny lunny force-pushed the lunny:lunny/uniform_git branch 3 times, most recently from 89a2547 to f02983c May 11, 2019

lunny added some commits May 6, 2019

@lunny lunny force-pushed the lunny:lunny/uniform_git branch from db5a963 to e73f303 May 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.