Page MenuHomePhabricator

Add `bin/repository edit` for CLI repository editing
ClosedPublic

Authored by epriestley on Nov 13 2013, 5:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 22, 9:58 PM
Unknown Object (File)
Sun, Dec 22, 9:58 PM
Unknown Object (File)
Fri, Dec 13, 10:00 PM
Unknown Object (File)
Thu, Dec 12, 10:52 PM
Unknown Object (File)
Sun, Dec 8, 7:53 PM
Unknown Object (File)
Fri, Dec 6, 6:57 AM
Unknown Object (File)
Fri, Dec 6, 6:55 AM
Unknown Object (File)
Sat, Nov 30, 12:54 AM
Subscribers

Details

Summary

Ref T4039. This is mostly to deal with that, to prevent the security issues associated with mutable local paths. The next diff will lock them in the web UI.

I also added a confirmation prompt to bin/repository delete, which was a little scary without one.

See one comment inline about the --as flag. I don't love this, but when I started adding all the stuff we'd need to let this transaction show up as "Administrator" it quickly got pretty big.

Test Plan

Ran bin/repository edit ..., saw an edit with a transaction show up on the web UI.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

btrahan added inline comments.
src/applications/metamta/contentsource/PhabricatorContentSource.php
43

maybe put the $console in the declaration? not sure what we'd ever use it - maybe we're going to augment the $console with like $client_ip or something? - but seems like it could be handy like the other newXSource functions in time.

The things I thought about reading are php_uname('n') (machine hostname) and $_ENV['USER'] / posix_geteuid() (current shell user), but I think there's no object we can reasonably pass in which gives us more general way to access those (at least, today). Putting that stuff on $console might make sense eventually, although I can't immediately come up with other uses for it. I'm going to leave it alone for now, but I agree with the concept. Generally, this is the first real ApplicationTransaction firing from a CLI script, so it touches a lot of things which we could probably refine in the future.