Page MenuHomePhabricator

Add a "touched paths" limit to repositories, limiting the maximum number of paths any commit may touch

Authored by epriestley on Nov 26 2018, 1:43 PM.



Depends on D19831. Ref T13216. See PHI908. Allegedly, a user copied a large repository into itself and then pushed it. Great backup strategy, but it can create headaches for administrators.

Allow a "maximum paths you can touch with one commit" limit to be configured, to make it harder for users to make this push this kind of commit by accident.

If you actually intended to do this, you can work around this by breaking your commit into pieces (or temporarily removing the limit). This isn't a security/policy sort of option, it's just a guard against silly mistakes.

Test Plan

Set limit to 2, tried to push 3 files, got rejected. Raised limit, pushed changes successfully.

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Nov 26 2018, 1:43 PM
epriestley requested review of this revision.Nov 26 2018, 1:44 PM
epriestley updated this revision to Diff 47368.Nov 26 2018, 1:50 PM
  • Separate the "touch" and "filesize" code a bit better and give "Touches Too Many Paths" its own reject code.
amckinley accepted this revision.Nov 28 2018, 6:40 PM
amckinley added inline comments.

Oh this is neat. Never would have imagined this code would get reused! I guess it's not worth fiddling with this to skip the work of computing the file sizes since the vast majority of commits are reasonably-sized anyway.


Consistency between "affects" and "touches".


Oh, and we're caching the result so we only do this work once anyway.



This revision is now accepted and ready to land.Nov 28 2018, 6:40 PM
This revision was automatically updated to reflect the committed changes.