Branch protection not working on Gitea 1.2.1 #1172

Closed
opened 2025-11-02 03:51:18 -06:00 by GiteaMirror · 23 comments
Owner

Originally created by @lklock on GitHub (Oct 20, 2017).

Hello,

We face an issue with the branch protection which doesn't allow to protect any branch

  • Gitea version (or commit ref): 1.2.1
  • Git version: 2.14.2
  • Operating system: Ubuntu 16.04.3 LTS
  • Database (use [x]):
    • PostgreSQL
    • [x ] MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • [x ] No
    • Not relevant
  • Log gist:

Description

Most of the branches of I select are not being protected after selecting them
It works for some of them but I could not figure out any pattern (based on branch name per instance)

Example on one of our projects:

default branch set to dev-master
I can protect branch "master" but not branch"XTI-730" or "R_9_3_patches"

Are there any conditions for a branch to be able to be protected ?

Originally created by @lklock on GitHub (Oct 20, 2017). Hello, We face an issue with the branch protection which doesn't allow to protect any branch - Gitea version (or commit ref): 1.2.1 - Git version: 2.14.2 - Operating system: Ubuntu 16.04.3 LTS - Database (use `[x]`): - [ ] PostgreSQL - [x ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x ] No - [ ] Not relevant - Log gist: ## Description Most of the branches of I select are not being protected after selecting them It works for some of them but I could not figure out any pattern (based on branch name per instance) Example on one of our projects: default branch set to dev-master I can protect branch "master" but not branch"XTI-730" or "R_9_3_patches" Are there any conditions for a branch to be able to be protected ?
GiteaMirror added the type/question label 2025-11-02 03:51:18 -06:00
Author
Owner

@lunny commented on GitHub (Oct 20, 2017):

cannot reproduce this.

@lunny commented on GitHub (Oct 20, 2017): cannot reproduce this.
Author
Owner

@lunny commented on GitHub (Oct 20, 2017):

could you show your repo settings branches UI?

@lunny commented on GitHub (Oct 20, 2017): could you show your repo settings `branches` UI?
Author
Owner

@lklock commented on GitHub (Oct 24, 2017):

image

@lklock commented on GitHub (Oct 24, 2017): ![image](https://user-images.githubusercontent.com/22026690/31932929-06d4072e-b8a8-11e7-9a73-281a029c232f.png)
Author
Owner

@lklock commented on GitHub (Oct 24, 2017):

image

@lklock commented on GitHub (Oct 24, 2017): ![image](https://user-images.githubusercontent.com/22026690/31933057-50f5bd8e-b8a8-11e7-91f3-1a56c40e05de.png)
Author
Owner

@lunny commented on GitHub (Oct 24, 2017):

This is not v1.2.1 I think.

@lunny commented on GitHub (Oct 24, 2017): This is not v1.2.1 I think.
Author
Owner

@lklock commented on GitHub (Oct 24, 2017):

Hi,
I've double checked it and It is version 1.2.1

image

image

@lklock commented on GitHub (Oct 24, 2017): Hi, I've double checked it and It is version 1.2.1 ![image](https://user-images.githubusercontent.com/22026690/31945247-e133a624-b8ce-11e7-9587-c9ba9cd9a820.png) ![image](https://user-images.githubusercontent.com/22026690/31945269-f0b64516-b8ce-11e7-8ac8-a153b06c582f.png)
Author
Owner

@lklock commented on GitHub (Oct 24, 2017):

83b894e321343e253006e689fb5a4d6fee048cf0fa3a169cb54c4060788133df gitea-1.2.1-linux-amd64

@lklock commented on GitHub (Oct 24, 2017): 83b894e321343e253006e689fb5a4d6fee048cf0fa3a169cb54c4060788133df gitea-1.2.1-linux-amd64
Author
Owner

@lafriks commented on GitHub (Oct 24, 2017):

Are there any error either in javascript or gitea.log?

@lafriks commented on GitHub (Oct 24, 2017): Are there any error either in javascript or gitea.log?
Author
Owner

@lklock commented on GitHub (Oct 24, 2017):

No, there are no error messages neither in gitea.log or in Javascript

@lklock commented on GitHub (Oct 24, 2017): No, there are no error messages neither in gitea.log or in Javascript
Author
Owner

@lklock commented on GitHub (Oct 31, 2017):

Same behavior in 1.2.2

@lklock commented on GitHub (Oct 31, 2017): Same behavior in 1.2.2
Author
Owner

@lafriks commented on GitHub (Nov 1, 2017):

@lklock can you try to reproduce that on try.gitea.io?

@lafriks commented on GitHub (Nov 1, 2017): @lklock can you try to reproduce that on try.gitea.io?
Author
Owner

@lklock commented on GitHub (Nov 2, 2017):

Tried to reproduce it on try.gitea.io but it is working there with the new branch protection feature
(in my repository: BatchSystem)

@lklock commented on GitHub (Nov 2, 2017): Tried to reproduce it on try.gitea.io but it is working there with the new branch protection feature (in my repository: BatchSystem)
Author
Owner

@lklock commented on GitHub (Nov 2, 2017):

Not so sure anymore...get lots of error 500 when I play with settings there (trying to add user to whitelist, etc...)...Don't know if it is related

@lklock commented on GitHub (Nov 2, 2017): Not so sure anymore...get lots of error 500 when I play with settings there (trying to add user to whitelist, etc...)...Don't know if it is related
Author
Owner

@lafriks commented on GitHub (Nov 2, 2017):

Can you give what errors do you get in gitea.log file

@lafriks commented on GitHub (Nov 2, 2017): Can you give what errors do you get in gitea.log file
Author
Owner

@lklock commented on GitHub (Nov 2, 2017):

No, there are no error messages neither in gitea.log or in Javascript

@lklock commented on GitHub (Nov 2, 2017): > No, there are no error messages neither in gitea.log or in Javascript
Author
Owner

@lafriks commented on GitHub (Nov 2, 2017):

Is there anything in logs from gitea output? (Systemd/docker)?

@lafriks commented on GitHub (Nov 2, 2017): Is there anything in logs from gitea output? (Systemd/docker)?
Author
Owner

@lklock commented on GitHub (Nov 3, 2017):

Nothing useful
When I look in syslog, everything seems fine:

Nov 3 14:42:49 xtnet-01 gitea[1286]: [Macaron] 2017-11-03 14:42:49: Started POST /XTNET/cxtserver/settings/branches?action=protected_branch for 10.20.0.134
Nov 3 14:42:49 xtnet-01 gitea[1286]: [Macaron] 2017-11-03 14:42:49: Completed /XTNET/cxtserver/settings/branches?action=protected_branch 200 OK in 345.985958ms
Nov 3 14:42:49 xtnet-01 gitea[1286]: [Macaron] 2017-11-03 14:42:49: Started GET /XTNET/cxtserver/settings/branches for 10.20.0.134
Nov 3 14:42:50 xtnet-01 gitea[1286]: [Macaron] 2017-11-03 14:42:50: Completed /XTNET/cxtserver/settings/branches 200 OK in 321.402728ms

@lklock commented on GitHub (Nov 3, 2017): Nothing useful When I look in syslog, everything seems fine: Nov 3 14:42:49 xtnet-01 gitea[1286]: [Macaron] 2017-11-03 14:42:49: Started POST /XTNET/cxtserver/settings/branches?action=protected_branch for 10.20.0.134 Nov 3 14:42:49 xtnet-01 gitea[1286]: [Macaron] 2017-11-03 14:42:49: Completed /XTNET/cxtserver/settings/branches?action=protected_branch 200 OK in 345.985958ms Nov 3 14:42:49 xtnet-01 gitea[1286]: [Macaron] 2017-11-03 14:42:49: Started GET /XTNET/cxtserver/settings/branches for 10.20.0.134 Nov 3 14:42:50 xtnet-01 gitea[1286]: [Macaron] 2017-11-03 14:42:50: Completed /XTNET/cxtserver/settings/branches 200 OK in 321.402728ms
Author
Owner

@lklock commented on GitHub (Nov 3, 2017):

What I noticed, is that it works for repositories created from scratch but doesn't seem to work for repositories which have been created by a migration from SVN

@lklock commented on GitHub (Nov 3, 2017): What I noticed, is that it works for repositories created from scratch but doesn't seem to work for repositories which have been created by a migration from SVN
Author
Owner

@lafriks commented on GitHub (Nov 3, 2017):

That's something I can try to reproduce

@lafriks commented on GitHub (Nov 3, 2017): That's something I can try to reproduce
Author
Owner

@lklock commented on GitHub (Nov 13, 2017):

Hi,
It seems my latest comment is not valid, I have the issue also on newly created repositories

@lklock commented on GitHub (Nov 13, 2017): Hi, It seems my latest comment is not valid, I have the issue also on newly created repositories
Author
Owner

@lunny commented on GitHub (Nov 29, 2017):

@lklock did you run gitea on docker?

@lunny commented on GitHub (Nov 29, 2017): @lklock did you run gitea on docker?
Author
Owner

@lklock commented on GitHub (Nov 29, 2017):

No, it is not running under docker

@lklock commented on GitHub (Nov 29, 2017): No, it is not running under docker
Author
Owner

@lklock commented on GitHub (Dec 8, 2017):

Upgraded to 1.3.0
Branch protection is working fine

@lklock commented on GitHub (Dec 8, 2017): Upgraded to 1.3.0 Branch protection is working fine
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1172