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

Display commit status on landing page of repo #1784

Merged
merged 3 commits into from
Sep 14, 2017

Conversation

DblK
Copy link
Member

@DblK DblK commented May 23, 2017

This will implement a part of #996 and so #1029.

The modification of the ui will be like this:
image

Status is now displayed.

@lunny lunny added the type/enhancement An improvement of existing functionality label May 24, 2017
@lunny lunny added this to the 1.2.0 milestone May 24, 2017
@DblK
Copy link
Member Author

DblK commented May 24, 2017

To follow the merged #1688, this could be done before adding the information for PR.

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 24, 2017
@lunny
Copy link
Member

lunny commented May 25, 2017

CI failed.

@DblK
Copy link
Member Author

DblK commented May 26, 2017

I saw, I need to rebase on master so the build will not failed since RepoCreationNum as been renamed in MaxCreationLimit.

@DblK DblK force-pushed the feature_DisplayCommitStatusOnRepo branch from fc466a5 to 15024de Compare May 26, 2017 08:47
@@ -119,6 +120,21 @@ func renderDirectory(ctx *context.Context, treeLink string) {
ctx.Data["LatestCommit"] = latestCommit
ctx.Data["LatestCommitVerification"] = models.ParseCommitWithSignature(latestCommit)
ctx.Data["LatestCommitUser"] = models.ValidateCommitWithEmail(latestCommit)
commit := models.SignCommitWithStatuses{
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason you don't just use two local variables? The SignCommit field of commit never comes into play, so I think that just using variables would be simpler.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I took some portion of code from the display. I will use local variable instead.

Copy link
Member

Choose a reason for hiding this comment

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

done.

@@ -26,6 +26,23 @@
{{end}}
</a>
<span class="grey has-emoji">{{RenderCommitMessage false .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas}}</span>
{{if .LatestCommitStatus}}
Copy link
Member

Choose a reason for hiding this comment

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

Can this code be moved to separate template and reused in both places?

Copy link
Member

Choose a reason for hiding this comment

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

done.

State: "",
Statuses: make([]*models.CommitStatus, 0),
}
commit.Statuses, err = models.GetLatestCommitStatus(ctx.Repo.Repository, ctx.Repo.Commit.ID.String(), 0)
Copy link
Member

@bkcsoft bkcsoft Jun 11, 2017

Choose a reason for hiding this comment

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

Why not get the CommitStatus for the latest SHA? (As-is now you're introducting race-conditions)

Copy link
Member

Choose a reason for hiding this comment

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

Disregard this, I missed the Commit.ID.String()-part 🙄

Copy link
Member

Choose a reason for hiding this comment

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

This is duplicated code from ParseCommitsWithStatus function.

Copy link
Member

Choose a reason for hiding this comment

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

Since ctx.Repo.Commit has parsed and not used ParseCommitsWithStatus, I will simple handle here and maybe another PR to do further improvement.

@bkcsoft
Copy link
Member

bkcsoft commented Jun 15, 2017

@DblK Any update? 🙂

@bkcsoft bkcsoft modified the milestones: 1.3.0, 1.2.0 Jun 15, 2017
@DblK
Copy link
Member Author

DblK commented Jul 4, 2017

Kind of busy right now, I'll work on it later.

@appleboy
Copy link
Member

appleboy commented Aug 5, 2017

@DblK Any updates on this?

@lunny
Copy link
Member

lunny commented Aug 28, 2017

@DblK if you are some busy, could some maintainers help you to finish this PR?

@DblK
Copy link
Member Author

DblK commented Sep 9, 2017

If some maintainers want to finish then go for it.

@lunny lunny assigned lunny and DblK Sep 14, 2017
@lunny lunny force-pushed the feature_DisplayCommitStatusOnRepo branch from 15024de to 3a59b61 Compare September 14, 2017 06:06
@lunny
Copy link
Member

lunny commented Sep 14, 2017

See below three places status and all have links to CI now.

-1
-2
-3

@appleboy
Copy link
Member

LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 14, 2017
@lafriks
Copy link
Member

lafriks commented Sep 14, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 14, 2017
@lafriks
Copy link
Member

lafriks commented Sep 14, 2017

@lunny please rebase

@codecov-io
Copy link

codecov-io commented Sep 14, 2017

Codecov Report

Merging #1784 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1784      +/-   ##
==========================================
- Coverage   27.85%   27.83%   -0.02%     
==========================================
  Files          83       83              
  Lines       16825    16835      +10     
==========================================
  Hits         4686     4686              
- Misses      11464    11474      +10     
  Partials      675      675
Impacted Files Coverage Δ
models/status.go 5.02% <0%> (-0.3%) ⬇️

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 a89692d...2c706c4. Read the comment docs.

@lunny lunny force-pushed the feature_DisplayCommitStatusOnRepo branch from f87655e to 2c706c4 Compare September 14, 2017 06:26
@lunny
Copy link
Member

lunny commented Sep 14, 2017

@lafriks done.

@lunny lunny merged commit be3319b into go-gitea:master Sep 14, 2017
@lunny
Copy link
Member

lunny commented Sep 14, 2017

@ethantkoenig oh sorry, just found need your approval after I merged.

@ethantkoenig
Copy link
Member

@lunny No worries, it looks my suggestion was addressed nonetheless

@lunny
Copy link
Member

lunny commented Sep 15, 2017

@ethantkoenig OK.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants