mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-24 07:42:40 +01:00
a0d4b6da4b
Summary: Depends on D19816. Ref T13216. See PHI908. See PHI750. In a few cases, users have pushed multi-gigabyte files full of various things that probably shouldn't be version controlled. This tends to create various headaches. Add support for limiting the maximum size of any object. Specifically, we: - list all the objects each commit touches; - check their size after the commit applies; - if it's over the limit, reject the commit. This change doesn't actually hook the limit up (the limit is always "0", i.e. unlimited), and doesn't have Mercurial or SVN support. The actual parser bit would probably be better in some other `Query/Parser` class eventually, too. But it at least roughly works. Test Plan: Changed the hard-coded limit to other values, tried to push stuff, got sensible results: ``` $ echo pew >> magic_missile.txt && git commit -am pew && git push [master 98d07af] pew 1 file changed, 1 insertion(+) # Push received by "local.phacility.net", forwarding to cluster host. # Acquiring write lock for repository "spellbook"... # Acquired write lock immediately. # Acquiring read lock for repository "spellbook" on device "local.phacility.net"... # Acquired read lock immediately. # Device "local.phacility.net" is already a cluster leader and does not need to be synchronized. # Ready to receive on cluster host "local.phacility.net". Counting objects: 49, done. Delta compression using up to 8 threads. Compressing objects: 100% (48/48), done. Writing objects: 100% (49/49), 3.44 KiB | 1.72 MiB/s, done. Total 49 (delta 30), reused 0 (delta 0) remote: +---------------------------------------------------------------+ remote: | * * * PUSH REJECTED BY EVIL DRAGON BUREAUCRATS * * * | remote: +---------------------------------------------------------------+ remote: \ remote: \ ^ /^ remote: \ / \ // \ remote: \ |\___/| / \// .\ remote: \ /V V \__ / // | \ \ *----* remote: / / \/_/ // | \ \ \ | remote: @___@` \/_ // | \ \ \/\ \ remote: 0/0/| \/_ // | \ \ \ \ remote: 0/0/0/0/| \/// | \ \ | | remote: 0/0/0/0/0/_|_ / ( // | \ _\ | / remote: 0/0/0/0/0/0/`/,_ _ _/ ) ; -. | _ _\.-~ / / remote: ,-} _ *-.|.-~-. .~ ~ remote: * \__/ `/\ / ~-. _ .-~ / remote: \____(Oo) *. } { / remote: ( (..) .----~-.\ \-` .~ remote: //___\\ \ DENIED! ///.----..< \ _ -~ remote: // \\ ///-._ _ _ _ _ _ _{^ - - - - ~ remote: remote: remote: OVERSIZED FILE remote: This repository ("spellbook") is configured with a maximum individual file size limit, but you are pushing a change ("98d07af863e799509e7c3a639404d216f9fc79c7") which causes the size of a file ("magic_missile.txt") to exceed the limit. The commit makes the file 317 bytes long, but the limit for this repository is 1 bytes. remote: # Released cluster write lock. To ssh://local.phacility.com/source/spellbook.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'ssh://epriestley@local.phacility.com/source/spellbook.git' ``` Reviewers: amckinley Reviewed By: amckinley Subscribers: joshuaspence Maniphest Tasks: T13216 Differential Revision: https://secure.phabricator.com/D19817 |
||
---|---|---|
.. | ||
codex | ||
conduit | ||
config | ||
constants | ||
customfield | ||
daemon | ||
data | ||
editor | ||
engine | ||
graphcache | ||
management | ||
phid | ||
query | ||
response | ||
search | ||
storage | ||
worker | ||
xaction |