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

Reading pull attachments should depend on read UnitTypePullRequests #10346

Conversation

zeripath
Copy link
Contributor

Previously these would depend on read UnitTypeIssues.

Fixes #10336

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Feb 18, 2020
@GiteaBot GiteaBot 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 Feb 18, 2020
@@ -79,7 +79,11 @@ func (a *Attachment) LinkedRepository() (*Repository, UnitType, error) {
return nil, UnitTypeIssues, err

Choose a reason for hiding this comment

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

Maybe the correct unitType (UnitTypePullRequests instead of UnitTypeIssues) is of interest here, too?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't have an issue to be able to check if it is a pull

Copy link
Contributor Author

@zeripath zeripath Feb 18, 2020

Choose a reason for hiding this comment

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

and in any case if err is not nil then the unitType is not used:

repository, unitType, err := attach.LinkedRepository()
	if err != nil {
		ctx.ServerError("LinkedRepository", err)
		return
	}

Choose a reason for hiding this comment

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

Oh, of course, you're right.

@codecov-io
Copy link

codecov-io commented Feb 18, 2020

Codecov Report

Merging #10346 into master will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10346      +/-   ##
==========================================
+ Coverage   43.69%   43.72%   +0.02%     
==========================================
  Files         585      585              
  Lines       81023    81023              
==========================================
+ Hits        35407    35424      +17     
+ Misses      41227    41212      -15     
+ Partials     4389     4387       -2
Impacted Files Coverage Δ
modules/process/manager.go 74.69% <0%> (-3.62%) ⬇️
services/pull/pull.go 32.43% <0%> (-1.51%) ⬇️
modules/log/event.go 64.61% <0%> (-1.03%) ⬇️
modules/queue/unique_queue_disk_channel.go 55.76% <0%> (+1.92%) ⬆️
services/pull/temp_repo.go 31.62% <0%> (+2.56%) ⬆️
modules/git/command.go 89.56% <0%> (+2.6%) ⬆️
services/pull/check.go 38.41% <0%> (+5.48%) ⬆️
services/pull/patch.go 66.03% <0%> (+5.66%) ⬆️

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 d053754...8e11efc. Read the comment docs.

@guillep2k guillep2k merged commit 41294b5 into go-gitea:master Feb 19, 2020
guillep2k pushed a commit to guillep2k/gitea that referenced this pull request Feb 19, 2020
…o-gitea#10346)

* Make pull attachments depend on read UnitTypePullRequests

Fixes go-gitea#10336

* Fix test
@jolheiser jolheiser added the backport/done All backports for this PR have been created label Feb 19, 2020
@zeripath zeripath deleted the fix-10336-attachments-on-pulls-depend-on-read-pull branch February 20, 2020 19:32
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created 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.

download of attachments is broken if internal issue management is disabled
7 participants