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 draft releases #1854

Merged
merged 3 commits into from
Jun 3, 2017
Merged

Conversation

ethantkoenig
Copy link
Member

Fixes #1387. Previously, we only displayed releases whose tag name actually existed in the repository, which is why drafts did not show up.

@lunny lunny added this to the 1.2.0 milestone Jun 2, 2017
@lunny lunny added the type/bug label Jun 2, 2017
@lunny
Copy link
Member

lunny commented Jun 2, 2017

Integration tests are welcome.

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 2, 2017
}
r.Note = markdown.RenderString(r.Note, ctx.Repo.RepoLink, ctx.Repo.Repository.ComposeMetas())
releasesToDisplay = append(releasesToDisplay, r)
Copy link
Member

Choose a reason for hiding this comment

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

This wouldn't be "faster" using the index of the for loop and directly assigning releasesToDisplay[index] ?

Copy link
Member Author

Choose a reason for hiding this comment

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

We sometimes continue (line 88)

Copy link
Member

@sapk sapk Jun 3, 2017

Choose a reason for hiding this comment

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

ok but we don't exceed len(releases) + if we skip we should not use pager := paginater.New(len(releases), limit, page, 5) but len(releasesToDisplay)

@@ -79,7 +79,7 @@ func Releases(ctx *context.Context) {

// Temporary cache commits count of used branches to speed up.
countCache := make(map[string]int64)
var cacheUsers = make(map[int64]*models.User)
cacheUsers := map[int64]*models.User{ctx.User.ID: ctx.User}
Copy link
Member

Choose a reason for hiding this comment

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

Good idea

@sapk
Copy link
Member

sapk commented Jun 2, 2017

Except my little proposition for optimization and that we need more testing generally. This PR 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 Jun 2, 2017
@ethantkoenig
Copy link
Member Author

@lunny Added an integration test

@lunny
Copy link
Member

lunny commented Jun 3, 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 Jun 3, 2017
@lunny lunny mentioned this pull request Jun 3, 2017
7 tasks
@lunny lunny merged commit b900c04 into go-gitea:master Jun 3, 2017
@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/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot see release drafts
5 participants