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

Fix release display and correct paging #2080

Merged
merged 1 commit into from
Jun 29, 2017

Conversation

lafriks
Copy link
Member

@lafriks lafriks commented Jun 28, 2017

  • Fixes displaying releases with paging when there are drafts and user has no rights to see drafts
  • Fix so that drafts can be seen not only by Owner but anyone with write rights to repository
  • Add integration tests to create new releases and paging

Fixes #1863

@lafriks lafriks mentioned this pull request Jun 28, 2017
7 tasks
@lafriks
Copy link
Member Author

lafriks commented Jun 28, 2017

Continuation to #2035

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 28, 2017
@lafriks lafriks added this to the 1.2.0 milestone Jun 28, 2017
}

// GetReleaseCountByRepoID returns the count of releases of repository
func GetReleaseCountByRepoID(repoID int64, includeDrafts bool) (int64, error) {
func (opts *FindReleasesOptions) toConds(repoID int64) builder.Cond {
Copy link
Member

Choose a reason for hiding this comment

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

Why not let repoID as a field of FindReleasesOptions?

Copy link
Member Author

Choose a reason for hiding this comment

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

At first I did that but than it looked strange as func name is GetReleasesByRepoID. And also repoID is mandatory condition

Copy link
Member

Choose a reason for hiding this comment

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

I think FindReleases and CountReleases maybe a new name?

Copy link
Member Author

Choose a reason for hiding this comment

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

But repoID is still allways required field and that will not easy be understandable by function signature

Copy link
Member

Choose a reason for hiding this comment

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

seems right.

// GetReleasesByRepoIDAndNames returns a list of releases of repository according repoID and tagNames.
func GetReleasesByRepoIDAndNames(repoID int64, tagNames []string) (rels []*Release, err error) {
// GetReleasesByRepoID returns a list of releases of repository.
func GetReleasesByRepoID(repoID int64, opts FindReleasesOptions, page, pageSize int) (rels []*Release, err error) {
Copy link
Member

Choose a reason for hiding this comment

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

As above and page and pageSize is also could be fields of FindReleasesOptions

Copy link
Member Author

Choose a reason for hiding this comment

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

Because it's not really related to conditions and toConds can't use them anyway

@ethantkoenig
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 Jun 29, 2017
@lunny
Copy link
Member

lunny commented Jun 29, 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 29, 2017
@lunny lunny merged commit 783b196 into go-gitea:master Jun 29, 2017
@lafriks lafriks deleted the fix/release_listing branch June 30, 2017 07:35
@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.

Release page don't paginate
4 participants