Skip to content

Conversation

lafriks
Copy link
Member

@lafriks lafriks commented Oct 15, 2017

Fix PR, milestone and label functionality if issue unit is disabled or not available for user

Fixes #2447

@lafriks lafriks added backport/v1.2 type/bug issue/regression Indicates a previously functioning feature or behavior that has broken or regressed after a change labels Oct 15, 2017
@lafriks lafriks added this to the 1.3.0 milestone Oct 15, 2017
@codecov-io
Copy link

codecov-io commented Oct 15, 2017

Codecov Report

Merging #2710 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@ Coverage Diff @@ ## master #2710 +/- ## ======================================= Coverage 26.95% 26.95% ======================================= Files 87 87 Lines 17301 17301 ======================================= Hits 4664 4664 Misses 11957 11957 Partials 680 680

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 a75d5c7...f1db8e5. Read the comment docs.

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 15, 2017
@lafriks lafriks force-pushed the fix/pr_with_ext_issues branch from 9a03cc8 to d2237b9 Compare October 15, 2017 21:22
@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 Oct 16, 2017
prUnitEnabled := ctx.Repo.Repository.UnitEnabled(models.UnitTypePullRequests)
for _, issue := range issues {
if issue.IsPull && !prUnitEnabled || !issue.IsPull && !issueUnitEnabled {
ctx.Handle(404, "UnitEnabled", nil)
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

}
if issue.IsPull && !ctx.Repo.Repository.UnitEnabled(models.UnitTypePullRequests) ||
!issue.IsPull && !ctx.Repo.Repository.UnitEnabled(models.UnitTypeIssues) {
ctx.Handle(404, "UnitEnabled", nil)
Copy link
Member

Choose a reason for hiding this comment

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

Error message should be UnitDisabled

Copy link
Member Author

Choose a reason for hiding this comment

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

@daviian no, there should be function name that returned error so that from log entries it would be possible to understand what happened

Copy link
Member

Choose a reason for hiding this comment

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

From that point of view yes, but it is confusing at the first moment.

Copy link
Member Author

Choose a reason for hiding this comment

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

That is how it is used in rest of the code :)

Copy link
Member

Choose a reason for hiding this comment

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

@lafriks However in this case the UnitEnabled doesn't even return an error and 404 happens if the required unit is not enabled.

@lafriks
Copy link
Member Author

lafriks commented Oct 16, 2017

@daviian updated ;)

@daviian
Copy link
Member

daviian commented Oct 16, 2017

@lafriks Update and delete on comments in PR without issue tracker don't work either.

@lafriks
Copy link
Member Author

lafriks commented Oct 16, 2017

@daviian fixed

@daviian
Copy link
Member

daviian commented Oct 16, 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 Oct 16, 2017
@lafriks
Copy link
Member Author

lafriks commented Oct 16, 2017

Make LG-TM work again

@lafriks lafriks merged commit c1b0c9e into go-gitea:master Oct 16, 2017
@lafriks lafriks deleted the fix/pr_with_ext_issues branch October 16, 2017 07:55
lafriks added a commit to lafriks-fork/gitea that referenced this pull request Oct 16, 2017
…o-gitea#2710) * Fix PR, milestone and label functionality if issue unit is disabled or not assigned to user * Fix multi-actions in PR page * Change error message * Fix comment update and delete functionality in PR
@lafriks lafriks added the backport/done All backports for this PR have been created label Oct 16, 2017
lafriks added a commit that referenced this pull request Oct 16, 2017
…2710) (#2714) * Fix PR, milestone and label functionality if issue unit is disabled or not assigned to user * Fix multi-actions in PR page * Change error message * Fix comment update and delete functionality in PR
@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

backport/done All backports for this PR have been created issue/regression Indicates a previously functioning feature or behavior that has broken or regressed after a change lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug

5 participants