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

Trim the branch prefix from action.GetBranch #13981

Merged

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Dec 14, 2020

#13882 has revealed that the refname of an action is actually only a
refname pattern and necessarily a branch. For examplem pushing to
refs/heads/master will result in action with refname refs/heads/master
but pushing to master will result in a refname master.

The simplest solution to providing a fix here is to trim the prefix
therefore this PR proposes this.

Fix #13979

Signed-off-by: Andrew Thornton [email protected]

 go-gitea#13882 has revealed that the refname of an action is actually only a
refname pattern and necessarily a branch. For examplem pushing to
refs/heads/master will result in action with refname refs/heads/master
but pushing to master will result in a refname master.

The simplest solution to providing a fix here is to trim the prefix
therefore this PR proposes this.

Signed-off-by: Andrew Thornton <[email protected]>
@a1012112796
Copy link
Member

@zeripath Please fix lint :)

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 14, 2020
models/action.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Dec 14, 2020

Codecov Report

Merging #13981 (4f42464) into master (729f0f5) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13981      +/-   ##
==========================================
- Coverage   42.23%   42.22%   -0.02%     
==========================================
  Files         710      710              
  Lines       77233    77233              
==========================================
- Hits        32623    32614       -9     
- Misses      39245    39259      +14     
+ Partials     5365     5360       -5     
Impacted Files Coverage Δ
models/action.go 50.71% <0.00%> (ø)
modules/util/timer.go 42.85% <0.00%> (-42.86%) ⬇️
services/pull/check.go 35.76% <0.00%> (-16.06%) ⬇️
modules/log/event.go 60.84% <0.00%> (-0.95%) ⬇️
models/pull.go 54.54% <0.00%> (-0.63%) ⬇️
routers/api/v1/repo/pull.go 25.45% <0.00%> (+0.60%) ⬆️
services/mailer/mail.go 61.29% <0.00%> (+1.07%) ⬆️
modules/queue/workerpool.go 60.00% <0.00%> (+1.22%) ⬆️
modules/process/manager.go 75.00% <0.00%> (+2.50%) ⬆️
modules/queue/manager.go 65.08% <0.00%> (+2.95%) ⬆️
... and 2 more

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 729f0f5...339c6d4. Read the comment docs.

@GiteaBot GiteaBot 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 Dec 14, 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 Dec 14, 2020
@lafriks lafriks merged commit c3fc190 into go-gitea:master Dec 14, 2020
@lafriks
Copy link
Member

lafriks commented Dec 14, 2020

Please send backport

@zeripath zeripath deleted the fix-13979-action-branch-trim-BranchPrefix branch December 14, 2020 17:21
zeripath added a commit to zeripath/gitea that referenced this pull request Dec 14, 2020
Backport go-gitea#13981

 go-gitea#13882 has revealed that the refname of an action is actually only a
refname pattern and necessarily a branch. For examplem pushing to
refs/heads/master will result in action with refname refs/heads/master
but pushing to master will result in a refname master.

The simplest solution to providing a fix here is to trim the prefix
therefore this PR proposes this.

Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: a1012112796 <[email protected]>
@zeripath zeripath added the backport/done All backports for this PR have been created label Dec 14, 2020
techknowlogick pushed a commit that referenced this pull request Dec 14, 2020
Backport #13981

 #13882 has revealed that the refname of an action is actually only a
refname pattern and necessarily a branch. For examplem pushing to
refs/heads/master will result in action with refname refs/heads/master
but pushing to master will result in a refname master.

The simplest solution to providing a fix here is to trim the prefix
therefore this PR proposes this.

Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: a1012112796 <[email protected]>

Co-authored-by: a1012112796 <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
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.

404 error when opening a branch on the dashboard
6 participants