gitea icon indicating copy to clipboard operation
gitea copied to clipboard

Optimize branch protection rule loading

Open 6543 opened this issue 1 year ago • 2 comments

currently we only sort branch protection rules by creation time and type.

this change the order for non glob names as it make no difference to be alphabetical.


Sponsored by Kithara Software GmbH

6543 avatar Oct 16 '24 21:10 6543

the followup work will make glob rules order by user define priority ... so you dont have to delete and recreate rules just to have the correct order ...

6543 avatar Oct 16 '24 21:10 6543

I suggest to not handle the non-glob rules differently. I can imagine a order of rules where a non-glob rule might should kick in between two glob rules. Also from a user perspective it is probably confusing why the one rule is added "in the middle" while the other is added to the end.

If you handle both type the same the user interface becomes easier understandable.

confusedsushi avatar Oct 17 '24 07:10 confusedsushi

I would like to priority rather than this one.

lunny avatar Oct 20 '24 20:10 lunny

@lunny all changes related sorting are moved out and will be done in https://github.com/go-gitea/gitea/pull/32286

this is now just a pull to refactor and add more test coverage

6543 avatar Oct 21 '24 14:10 6543

before if it was nonglob each load would try to glob it and the check that is not glob ... now we only do that once and no future loading will trigger it

6543 avatar Oct 21 '24 14:10 6543

@lunny updated pull description ... I missed that one sorry

6543 avatar Oct 21 '24 14:10 6543