Page MenuHomePhabricator

Add a basic view for repository pull logs
ClosedPublic

Authored by epriestley on Jan 23 2018, 3:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 2:54 PM
Unknown Object (File)
Sat, Nov 9, 2:54 PM
Unknown Object (File)
Sat, Nov 9, 2:53 PM
Unknown Object (File)
Wed, Nov 6, 12:09 AM
Unknown Object (File)
Sun, Oct 27, 9:47 PM
Unknown Object (File)
Sun, Oct 27, 3:46 AM
Unknown Object (File)
Sep 24 2024, 2:56 PM
Unknown Object (File)
Sep 18 2024, 8:35 AM
Subscribers
None

Details

Summary

Depends on D18912. Ref T13046. Add a UI to browse the existing pull log table.

The actual log still has some significant flaws, but get the basics working.

Test Plan

Screen Shot 2018-01-23 at 7.14.37 AM.png (1×2 px, 315 KB)

Diff Detail

Repository
rP Phabricator
Branch
pull2
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 19132
Build 25833: Run Core Tests
Build 25832: arc lint + arc unit

Event Timeline

epriestley created this revision.
amckinley added inline comments.
src/applications/diffusion/controller/DiffusionPushLogListController.php
5–7

Are there any access control implications to getting this data? Could a user see the existence of a rSECRET_PLANS repo that they normally couldn't see? From the screenshot, it's not clear what the behavior is if the user doesn't select a repo.

src/applications/diffusion/view/DiffusionPullLogListView.php
25–26

That's an interesting proxy for "should be able to see remote IPs".

33

See above comment: we should add a CAN_VIEW check on the repos themselves (unless that's somehow handled by this code as-is).

src/applications/repository/query/PhabricatorRepositoryPullEventQuery.php
47–50

Oh, this should result in $repositories = array() for repos that the viewer can't see. Nevermind!

This revision is now accepted and ready to land.Jan 23 2018, 9:02 PM

Disregard stream of consciousness code review.

src/applications/repository/query/PhabricatorRepositoryPullEventQuery.php
47–50

Yeah, this is the substantive policy check: if you can't see a repository, you can't see the logs for it.

Then we end up in a sort of grey area on logs which didn't make it as far as identifying a repository (for example, trying to pull a repository which does not exist). I just required ADMIN for those, later in this diff. None of this feels exactly like the most pristine or obvious approach to policies for these logs, although I think we end up somewhere mostly reasonable.

src/applications/repository/storage/PhabricatorRepositoryPullEvent.php
110

This is the change which says "if the log has no repository, require admin".

Another rule might be "if the log has no repository, don't show it at all". I'm not sure these logs are terribly useful from the web UI anyway, since you can't use them for any kind of auditing or reporting goal, I think, except "is someone trying to guess HTTP passwords through brute force", and access logs are probably better for that anyway.

Oh, and the remote address rule is just the rule currently used by push logs. I'm not sure it's a great rule in either case. For most installs I don't think remote addresses are very important -- no one cares if they're all corpnet addresses -- but they've been a bit contentious with WMF (since they have strict policies around retaining/disclosing remote addresses). Another possibility is something like "get rid of them completely, go dig through the database if you need the information", although that doesn't address the retention concern on the WMF side.

This revision was automatically updated to reflect the committed changes.