1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-22 10:18:48 +02:00
Commit graph

1971 commits

Author SHA1 Message Date
epriestley
bd0be1c650 Add View, Edit and Join policies to PhabricatorProject
Summary:
  - In ProjectQuery, always load the viewer's membership in the project because we need it to perform a CAN_VIEW test.
  - Add storage for the view, edit and join policies.
  - A user can always view a project if they are a member.
  - A user can always join a project if they can edit it.
  - Editing a project requires both "view" and "edit" permissions, and edit does not imply view.
  - This has no effect on the application yet.

Test Plan: See next diff.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3219
2012-08-11 07:05:01 -07:00
epriestley
6cbc67ea75 Improve PolicyFilter and PolicyQuery
Summary:
  - Allow PolicyQuery to require specific sets of capabilities other than "CAN_VIEW", like edit, etc. The default set is "view".
  - Add some convenience methods to PolicyFilter to test for capabilities.

Test Plan: Viewed pastes, projects, etc. Used other stuff in future diff.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3212
2012-08-11 07:02:31 -07:00
Nick Harper
62b3e4aea3 Remove a check for closing revisions
Summary:
I ran into a case where a commit isn't "new" but hasn't been closed. I
think the check on the status of the differential revision should be
enough and this check isn't needed.

Test Plan:
used the reparse.php script to close a revision that previously wouldn't
close.

Reviewers: epriestley, vrana

Reviewed By: vrana

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3232
2012-08-10 16:15:37 -07:00
epriestley
81f8b507fe Use shinier menu icons
Summary:
  - Use @chad's nice gradient overlay icons.
  - Show selected states.
  - Use profile picture for profile item (not sure about this treatment?)
  - Workflow the logout link

Test Plan: Will add screenshots.

Reviewers: alanh, btrahan, chad

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3225
2012-08-10 12:11:24 -07:00
Pieter Hooimeijer
64472dd7b8 Adding Ponder-related files.
Summary:
Ponder is similar in spirit to the Wiki tool, but uses a Q&A
format and up/downvotes to signal user sentiment. Popular
questions are moved to the top of the feed on a 5-minute
cycle based on age (younger is better) and vote count (higher
is better).

Pre-apologies for noob diff.

Test Plan:
- `./bin/phd list` Should include `PonderHeatDaemon`; phd launch it
  if necessary.

- Navigate to /ponder/ ; observe sanity when adding questions,
  voting on them, and adding answers.

- Confirm that questions and answers are linkable using Q5 / Q5#A5 formatted object links.

- Confirm that searching for Ponder Questions works using built-in
  search.

Feedback on code / schema / whatever organization very welcome.

Reviewers: nh, vrana, epriestley

Reviewed By: epriestley

CC: gmarcotte, aran, Korvin, starruler

Differential Revision: https://secure.phabricator.com/D3136
2012-08-10 10:44:04 -07:00
vrana
9030fe8b09 Respect type in symbol query
Summary: Was completely ignored.

Test Plan: /diffusion/symbol/C/?type=function

Reviewers: alanh

Reviewed By: alanh

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D3234
2012-08-09 22:28:17 -07:00
vrana
81946fc08d Join author and committer in Diffusion browse
Summary: Consistent with history view, simpler.

Test Plan: /diffusion/X/

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3230
2012-08-09 18:15:58 -07:00
epriestley
d4cbb00d3b Fix offset-without-limit case in Policy query
Summary: Apparently I am not qualified to do basic math.

Test Plan: Unit test.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3218
2012-08-09 11:40:55 -07:00
vrana
bb61f03f1d Mark disabled users as "closed documents" in search
Test Plan:
  $ ./reindex_all_users.php

Search for me in open documents.
Search for @epriestley in open documents.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3216
2012-08-09 11:35:01 -07:00
Bob Trahan
b86d995b40 Detect if a commit *really* doesn't exist and 4oh4 from Diffusion commit view
Summary: rather than showing an erroneous "we still parsing" message.

Test Plan: for each version control system, typed in a garbage URL and got a 4oh4. (note this actually fails for SVN -- see comment about how my code fails atm -- and DiffusionGitRequest seems to pick off this error in advance and returns an AphrontUsageException.)

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1624

Differential Revision: https://secure.phabricator.com/D3201
2012-08-09 09:27:45 -07:00
epriestley
85672346bc Add "Edit" and "Join" capabilities
Summary: These are general-purpose capabilities required by Projects.

Test Plan: Trivial.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3204
2012-08-08 19:35:16 -07:00
epriestley
3460da5f34 Fix limits in queries
Summary: I think this is simpler? Includes test cases.

Test Plan: Ran tests. Loaded /paste/.

Reviewers: vrana, nh

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3209
2012-08-08 18:58:49 -07:00
Alan Huang
eeb359bae6 Make D3123 more consistent
Summary:
Put the function in the base class so all the Diffusion views
can use it. Also use shinier tooltips.

Test Plan: Browse Diffusion.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3206
2012-08-08 18:26:23 -07:00
epriestley
330b0a3d4b Make projects policy-aware
Summary: We managed to move enough Owners stuff aside to make this reasonable; make projects implement the policy interface and projectquery use cursor-based paging.

Test Plan:
  - Grepped for ProjectQuery callsites.
  - Created an audit comment.
  - Used `project.query` to query projects.
  - Loaded homepage.
  - Viewed Maniphest task list, grouped by project.
  - Viewed project list.
  - Created / edited project.
  - Browsed Owners.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3200
2012-08-08 17:10:10 -07:00
Alan Huang
8fbe6347d2 Load primary reviewer PHID
Summary: A cursory look at DifferentialReviewer suggests the primary reviewer doesn't actually have to be among the reviewers? Uploading this so bug reporter can patch and see if it helps.

Test Plan: Nope.

Reviewers: epriestley

Reviewed By: epriestley

CC: szymon, aran, Korvin

Maniphest Tasks: T1625

Differential Revision: https://secure.phabricator.com/D3198
2012-08-08 13:27:52 -07:00
epriestley
386735a39d Remove PhabricatorOwnersOwner::loadAffiliatedPackages()
Summary: See D3193 for discussion.

Test Plan: Ran `owners.query` via conduit, verified I got sensible output.

Reviewers: vrana, btrahan, meitros

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3194
2012-08-08 12:26:13 -07:00
epriestley
8cdd801515 Add PhabricatorOwnersPackageQuery
Summary:
This is a step toward unearthing Project queries enough that I can make them policy-aware. Right now, some ProjectQuery callsites do not have reasonable access to the viewer. In particular, Owners packages need to issue Project queries because we allow projects to own packages and resolve project members inside of some package queries.

Currently, we have a very unmodern approach to querying packages, with a large number of one-off static load methods:

  PhabricatorOwnersPackage::loadAffectedPackages()
  PhabricatorOwnersPackage::loadOwningPackages()
  PhabricatorOwnersPackage::loadPackagesForPaths()
  PhabricatorOwnersOwner::loadAllForPackages()
  PhabricatorOwnersOwner::loadAffiliatedUserPHIDs()
  PhabricatorOwnersOwner::loadAffiliatedPackages()
  ConduitAPI_owners_query_Method::queryAll()
  ConduitAPI_owners_query_Method::queryByOwner()
  ConduitAPI_owners_query_Method::queryByAffiliatedUser()
  ConduitAPI_owners_query_Method::queryByPath()

We should replace `PhabricatorOwnersOwner` with an Edge and move all of these calls to a Query class. I'm going to try to do as little of this work as I can  for now since I'm much more interested in getting a functional policy implementation into other applications, but ProjectQuery needs to be policy-aware before I can do that and I need to dig some at least some of the callsites out enough that I can get a viewer in there without making the code worse than it is.

This adds a PhabricatorOwnersPackageQuery class and removes one callsite of one of those static methods.

I also intend to dissolve the two separate concepts of an "owner" (direct owner) and an "affiliated user" (indirect owner via project membership) since I think we're always fine with "affiliated users" owners.

Test Plan: Loaded home page / audit tool, which use the modified path. Ran queries manually via script. Made sure results included directly owned packages and packages owned through project membership.

Reviewers: vrana, btrahan, meitros

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3193
2012-08-08 12:25:11 -07:00
epriestley
ab92242e00 Extend PhabricatorPolicyQuery from PhabricatorOffsetPagedQuery
Summary:
A few goals here:

  - Slightly simplify the Query classtree -- it's now linear: `Query` -> `OffsetPagedQuery` (adds offset/limit) -> `PolicyQuery` (adds policy filtering) -> `CursorPagedPolicyQuery` (adds cursors).
  - Allow us to move from non-policy queries to policy queries without any backward compatibility breaks, e.g. Conduit methods which accept 'offset'.
  - Separate the client limit ("limit") from the datafetch hint limit ("rawresultlimit") so we can make the heurstic smarter in the future if we want. Some discussion inline.

Test Plan: Expanded unit tests to cover offset behaviors.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3192
2012-08-08 12:15:58 -07:00
Bob Trahan
8a4c08b01d Allow commits to be associated with projects and associated goodies
Summary:
- Commit detail view
 - List of projects
 - "edit" action which takes the user to a simple form where they can only add / remove projects.
-  Integrated the project relationship into the commit search indexer
 - fixed a bug from D790; it seems you must select the column if you're going to join against it later. Without this change searching for author or projectfails 100% for me.

Test Plan: added and removed projects. verified appropriate projects showed up in detail and edit view. searched for commits by project and found the ones I was supposed to...!

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1614

Differential Revision: https://secure.phabricator.com/D3189
2012-08-08 10:03:41 -07:00
Alan Huang
5b8028e254 Fix sorting algorithm for group-by-project
Summary:
When viewing Maniphest tasks grouped by project, there's this
weird algorithm that involves generating strings to use as sort keys.
It's pretty clearly wrong in several cases; this aims to fix it.

Test Plan:
Open Maniphest and try to sort by things. Unfortunately, I
don't have access to a decent Maniphest database, so I'm not certain it
works as it should.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, mikaaay

Maniphest Tasks: T1595

Differential Revision: https://secure.phabricator.com/D3142
2012-08-07 19:40:38 -07:00
Alan Huang
ef3b097a41 Fix "show raw file" showing wrong file
Summary:
In a revision with multiple diffs like
https://secure.phabricator.com/D3168?vs=6094&id=6095
clicking "Show Raw File (Left)" while comparing diffs 1 and 2 brings up
the version from base, instead of from diff 1. This is because the hunks
are stored as diffs between base and diff X, and the raw file is
generated from the hunks. This introduces a hack which is probably not
actually correct but seems to work for the 90% case.

(The "Show Raw File (Right)" button was and remains correct.)

Test Plan: Click raw file buttons while comparing different diffs.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3169
2012-08-07 18:53:22 -07:00
Alan Huang
3fcb94a45c Fancier tooltips for revision lists
Summary:
Put flag note in a Javelin tooltip on the flag, and extra
reviewers in a Javelin tooltip on the (+N). This is a bit more expensive
because we have to fetch all of their usernames but I'm hoping that's
okay?

Test Plan:
Load a bunch of revision lists. Mouse on. Mouse off. Mouse
on. Mouse off.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3187
2012-08-07 18:37:49 -07:00
epriestley
f9fcaa1f84 Migrate project membership to edges
Summary:
  - Store project members in edges.
  - Migrate existing members to edge storage.
  - Delete PhabricatorProjectAffiliation.
  - I left the actual underlying data around just in case something goes wrong; we can delete it evenutally.

Test Plan:
  - Ran migration.
  - Created a new project.
  - Joined and left a project.
  - Added and removed project members.
  - Manually called PhabricatorOwnersOwner::loadAffiliatedUserPHIDs() to verify its behavior.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3186
2012-08-07 18:02:05 -07:00
epriestley
d5a0352fd7 Make project membership edits use transactions and PHIDs and not be awful
Summary:
  - Split project profile editing apart from project membership editing.
  - Make project membership editing simpler and easier to use.
  - Drop role / owner stuff from the UI.

Test Plan: Added and removed project members. Edited project profile information.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3184
2012-08-07 11:57:38 -07:00
epriestley
f01c89f8de Remove subprojects from the Projects UI and API
Summary:
These are currently useless and confusing (they have no application impact), and should be migrated to edges if we want to restore them in some form.

I left the actual storage so this doesn't destroy any data, it just removes all traces of this feature from the UI.

Test Plan: Looked at and edited projects.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3183
2012-08-07 11:57:27 -07:00
epriestley
fbf6d967ff Add getMemberPHIDs() and loadMemberPHIDs() to PhabricatorProject
Summary:
I want to:

  - move the membership storage to edges
  - remove the concepts of "roles" (which are decorative text only) and "owners" (which will be replaced with policy-based controls)

This moves us a step closer to that by reducing the use of ProjectAffiliation outside of the class.

Test Plan: Loaded project profile. Called `project.query`. Joined and left a project.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3182
2012-08-07 11:55:00 -07:00
epriestley
d74b84a729 Add a "Project" application
Summary: Move routes into a formal application class.

Test Plan: Checked /applications/, browsed various routes.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran, floatinglomas

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3181
2012-08-07 11:54:49 -07:00
epriestley
8668ecaf54 Make PhabricatorProjectQuery extend PhabricatorOffsetPagedQuery
Summary: This class predates PhabricatorQuery; reduce code duplication.

Test Plan: Loaded projects, ran conduit call with offset and limit.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3180
2012-08-07 11:54:39 -07:00
epriestley
b0fda3be25 Rename setMembers() to withMemberPHIDs() in PhabricatorProjectQuery
Summary: This is clearer and more consistent with other Query classes.

Test Plan: Used home page, conduit api, project list, other interfaces.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3179
2012-08-07 11:54:24 -07:00
epriestley
d25d9ddb01 Remove setOwners() from PhabricatorProjectQuery
Summary: I'm deprecating the concept of "owners" (which currently has no meaning in the actual application) in favor of policy-based controls. Remove the ability to query by it.

Test Plan: Grepped for setOwners(), no relevant hits. Browsed the project listing.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3178
2012-08-07 11:54:14 -07:00
epriestley
ed4a155c91 Rename "IDPaged" to "CursorPaged", "executeWithPager" to "executeWith[Cursor|Offset]Pager"
Summary:
I'm trying to make progress on the policy/visibility stuff since it's a blocker for Wikimedia.

First, I want to improve Projects so they can serve as policy groups (e.g., an object can have a visibility policy like "Visible to: members of project 'security'"). However, doing this without breaking anything or snowballing into a bigger change is a bit awkward because Projects are name-ordered and we have a Conduit API which does offset paging. Rather than breaking or rewriting this stuff, I want to just continue offset paging them for now.

So I'm going to make PhabricatorPolicyQuery extend PhabricatorOffsetPagedQuery, but can't currently since the `executeWithPager` methods would clash. These methods do different things anyway and are probably better with different names.

This also generally improves the names of these classes, since cursors are not necessarily IDs (in the feed case, they're "chronlogicalKeys", for example). I did leave some of the interals as "ID" since calling them "Cursor"s (e.g., `setAfterCursor()`) seemed a little wrong -- it should maybe be `setAfterCursorPosition()`. These APIs have very limited use and can easily be made more consistent later.

Test Plan: Browsed around various affected tools; any issues here should throw/fail in a loud/obvious way.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3177
2012-08-07 11:54:06 -07:00
vrana
8ab1789329 Improve displaying of very large commits
Summary:
Behave like Differential.

Also save one path ID query.

Test Plan: Displayed very large commit, clicked in ToC, clicked on Load.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3176
2012-08-07 10:51:38 -07:00
vrana
6361ffedaa Load changesets with inline comments drafts in large diff
Test Plan: Displayed a large diff with inline comment draft.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3175
2012-08-07 10:49:55 -07:00
Alan Huang
7f98e3a8bd Miscellaneous updates for scoped symbols
Summary: Update Conduit, jump nav, and docs to handle symbol contexts.

Test Plan: Call conduit, use jump nav.

Reviewers: epriestley

Reviewed By: epriestley

CC: nh, aran, Korvin

Maniphest Tasks: T1602

Differential Revision: https://secure.phabricator.com/D3172
2012-08-07 09:29:34 -07:00
Alan Huang
a8d6af0f42 Infrastructure changes to support scoped symbols
Summary:
 - import_project_symbols supports an optional extra field, which is the
   context of the symbol.
 - Symbol query can take a symbol argument, either as a parameter or a
   URL component (so you can now jump nav to `s Zerg/rush`, for
   example).
 - Conduit method not yet updated. Will do that later.

NOTE: Not providing a context is distinct from providing an empty
context, because an empty context stands for top-level context, i.e.
functions and classes for PHP. It will not find class methods, etc. It
is possible that we should use some weird token that could not normally
be a context name to stand in for empty context.

Test Plan: Do a bunch of symbol searches.

Reviewers: epriestley

Reviewed By: epriestley

CC: nh, aran, Korvin

Maniphest Tasks: T1602

Differential Revision: https://secure.phabricator.com/D3148
2012-08-07 09:28:49 -07:00
vrana
1c98ca7042 Fix doc links 2012-08-06 15:58:28 -07:00
epriestley
ebb7807bb4 Fix an issue with URIs missing trailing slashes, like "/maniphest"
Summary:
In D3144, I made us look in application maps to find routing rules. However, we don't process //all// the maps when we 404 and try to do a "/" redirect. Process all of the maps.

Additionally, in D3146 I made the menu items application-driven. However, some pages (like 404) don't have a controller. Drop the requirement that the controller be nonnull.

Test Plan:
  - Visited "/maniphest", got a redirect after this patch.
  - Visited "/asldknfalksfn", got a 404 after this patch.

Reviewers: davidreuss, vrana, btrahan

Reviewed By: davidreuss

CC: aran

Maniphest Tasks: T1607

Differential Revision: https://secure.phabricator.com/D3158
2012-08-06 12:46:51 -07:00
Alan Huang
bcb9de4ea1 Add a context field to symbol objects
Summary:
See T1602.

This is just the minimal functional patch; the scripts will continue
working because of the `DEFAULT ''`.

Test Plan:
Can't fully test this until I get more code working, but
nothing broke horribly yet.

Reviewers: epriestley

Reviewed By: epriestley

CC: nh, aran, Korvin

Maniphest Tasks: T1602

Differential Revision: https://secure.phabricator.com/D3147
2012-08-06 12:20:45 -07:00
vrana
251438b2c2 Translate change type header
Summary: This is a tax for internationalization.

Test Plan: Displayed a revision with added and moved files.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3166
2012-08-06 12:07:26 -07:00
epriestley
b4544ebe0f Make "Create New Similar Task" inherit priorities
Summary: Request in T1589, seems reasonable to me.

Test Plan: Created a "Wishlist" task, created a "Similar" task, got "Wishlist" default priority.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1589

Differential Revision: https://secure.phabricator.com/D3155
2012-08-05 19:10:20 -07:00
vrana
ceb522427e Highlight lines on drag and drop in Diffusion
Summary: Nobody knows that it's possible to highlight more lines because there's no interface for it.

Test Plan:
Highlighted:

- single line
- top to bottom
- bottom to top
- inside to outside

Reviewers: Korvin, epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D3150
2012-08-05 18:56:25 -07:00
Danny Su
92fd606df3 Allow custom LDAP port
Summary: Allow custom LDAP port to be defined in config file

Test Plan: Test login works by specifying a custom port

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3153
2012-08-05 15:37:40 -07:00
epriestley
314c25365d Drive menu icons from Applications
Summary:
This makes no changes, it just moves the menu icons to the applications instead of hard-coded on the page.

I'm going to try to address some of the angst in T1593 next...

Test Plan: Loaded logged-in / logged out pages. Clicked menu items. Looked at /applications/.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1593, T1569

Differential Revision: https://secure.phabricator.com/D3146
2012-08-05 14:12:43 -07:00
epriestley
643653dc61 Store the "current" application in the controller
Summary:
When we match an application route, select it as the current application and store it on the controller.

Move routes for the major applications into their PhabricatorApplication classes so this works properly.

Test Plan: Added a var_dump() and made sure we picked the right app for all these applications.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3144
2012-08-05 14:03:39 -07:00
Alan Huang
7ea925d33c Add a date column to Paste
Summary:
Show modified date on the right of the list view (which I guess
is also the created date, since pastes are immutable?)

Test Plan: Browse through the many volumes of untitled masterworks.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1600

Differential Revision: https://secure.phabricator.com/D3145
2012-08-03 15:39:56 -07:00
Alan Huang
e8c7e3883c Fix a comment (see D3140) 2012-08-03 11:47:53 -07:00
Alan Huang
358baf1b3a Improve the flag.* Conduit methods
Summary:
 - Put the code to generate informational dicts about flags into the
   base class.
 - Update flag.delete to accept an object PHID in order to delete the
   flag on that object, since currently the model is that each object
   may have at most one flag, and each flag has exactly one object,
   although the former is not enforced.
 - Add flag.edit, which creates or updates a flag, optionally with the
   given color and note.

Test Plan:
Spend endless hours repeatedly running arc call-conduit and
arc flag.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3141
2012-08-03 11:41:33 -07:00
Evan Priestley
c691d4bfa9 Merge pull request #172 from floatingLomas/arcpatch-D3109
Arcpatch d3109
2012-08-03 08:05:26 -07:00
mkedia
48806b5e3e [easy] Add support for fetching all packages to owners.query
Summary: as title

Test Plan: tested without params. Tested with single known path

Reviewers: epriestley, vrana, nh

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3139
2012-08-02 16:07:05 -07:00
Alan Huang
9b8a2cbf51 Add a 'title' sort option to Maniphest
Summary:
Allow sorting tasks by title in addition to priority, updated,
created.

Test Plan:
Load Maniphest, click between order buttons, note that tasks
are being ordered correctly, as if by magic.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1592

Differential Revision: https://secure.phabricator.com/D3137
2012-08-02 14:21:13 -07:00
epriestley
194dc40672 Add a meta-application
Summary:
  - Adds a new "Applications" application.
  - Builds an application list via application config instead of via hard-coding, so we can move toward better concepts of installing/uninstalling applications, etc.
  - Applications indicate that they need attention with notice counts and brief status messages rathern than 50 giant tables of all sorts of app data.

I want to try replacing the home screen with this screen, pretty much. Not sure if this is totally crazy or not. What does everyone else think?

Test Plan: Will add screenshots.

Reviewers: btrahan, chad, vrana, alanh

Reviewed By: vrana

CC: aran, davidreuss, champo

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3129
2012-08-02 14:07:21 -07:00
Alan Huang
04fafdb75c Make columns in flag view not squish each other
Summary:
Unlike (all? most?) other tables, the flag table has two wide
columns: the object name and the flag note. This fiddles with the
classes so neither gets squished too much by the other.

This is kind of a hack and I don't even know if it's cross-browser
compatible because I only have WebKit here. But maybe it's fine.

Test Plan:
View Differential home page while changing revision names and
flag notes to weird things.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1586

Differential Revision: https://secure.phabricator.com/D3128
2012-08-02 13:58:54 -07:00
Alan Huang
d31accf076 Add a flag.delete Conduit method
Summary: Fairly straightforward: allow deletion of flags from Conduit.

Test Plan: Try arc call-conduit with different ids.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1556

Differential Revision: https://secure.phabricator.com/D3132
2012-08-02 12:25:01 -07:00
Alan Huang
8e5189b439 Add a Delete link to Differential inline comment previews
Summary:
This lets you delete inlines from the preview at the bottom of
the page, instead of hunting for them through the diffs.

There is not yet a keyboard shortcut.

The mechanism for updating the inlines in the diffs is kind of a hack
and I'm sure I'm special-casing way too much, but at least it works.

Test Plan:
Load revision with many diffs. Create inlines all over the
place. Delete them all. Mwahaha.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1433, T1431

Differential Revision: https://secure.phabricator.com/D3131
2012-08-02 12:24:23 -07:00
Alan Huang
ce8bcf887d Render an edit link in Diffusion directory views
Summary:
If the user has an editor configured, an Edit link appears next
to the History link.

Somewhat suboptimally, the column is still there if there are no edit
links, it's just empty. I don't know if it matters...

Test Plan: Load Diffusion pages while changing editor setting in preferences.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, avivey

Maniphest Tasks: T1558

Differential Revision: https://secure.phabricator.com/D3124
2012-08-02 12:22:50 -07:00
vrana
9a19cfb9de Limit amount of chart data passed to browser
Summary:
Firefox has a limit of ~500,000 elements which can be passed in literal array.
This amount of data is meaningless anyway because even Retina displays don't have such resolution.

Limit the amount of data to mitigate browser limitations and also reduce the page size.
Ensure that first and last element is passed.

I considered also reducing the granularity to days but I want new repositories to have nice precise graph.

Test Plan: Displayed the chart in Firefox.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3134
2012-08-02 10:53:20 -07:00
Alan Huang
d391177984 Fix Differential flag view bug
Summary: See D3125#3

Test Plan:
Well, apparently the FB test Phabricator has no other flags
in it, so I modified the database by hand... the changed revision was
not marked as flagged in Differential.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1557

Differential Revision: https://secure.phabricator.com/D3130
2012-08-01 19:03:17 -07:00
Nick Harper
88caa45854 Save daemon state to database
Summary:
To make it easier to monitor daemons, let's store their current state
(running, died, exited, or unknown) to the db. The purpose of this is to
provide more information on the daemon console about the status of daemons,
especially when they are running on multiple machines. This is mostly backend
work, with only a few frontend changes. (It is also dependent on a change
to libphutil.)

These changes will make dead or stuck daemons more obvious, and will allow
more work on the frontend to hide daemons (and logs) that have exited cleanly,
i.e. ones we don't care about any more.

Test Plan:
- run db migration, check in db that all daemons were marked as exited
- start up a daemon, check in db that it is marked as running
- open web interface, check that daemon is listed as running
- after daemon has been running for a little bit, check in db that dateModified
  is being updated (indicating daemon is properly sending heartbeat)
- kill -9 daemon (but don't run bin/phd yet), and check that db still shows it
  as running
- edit daemon db entry to show it as being on a different host, and backdate
  dateModified field by 3 minutes, and check the web ui to show that the status
  is unknown.
- change db entry to have proper host, check in web ui that daemon status is
  displayed as dead. Check db to see that the status was saved.
- run bin/phd stop, and see that the formerly dead daemon is now exited.

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3126
2012-08-01 17:06:04 -07:00
Alan Huang
6e1f5e353a Abbreviate author/committer in Diffusion directory views
Summary:
The tables are currently kind of wide, and the emails for
non-recognized users seem like the least useful parts, so I put them in
tooltips so they're only visible if you want them. On the other hand, it
means you can only view one at a time, and if you're on mobile you can't
see them at all. Overall, not sure whether this is a good idea.

Test Plan:
Load Diffusion pages with some recognized and some
unrecognized users. Hover over the latter and see that emails appear.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3123
2012-08-01 14:59:32 -07:00
epriestley
9d19a0a8b1 Limit results returned by typeahead query in response to user searches
Summary:
Currently, on secure.phabricator.com, if you type "e" we generate about 600 users and ship them over the wire. This takes ~300ms.

Instead, limit the results to a superset of what the client will actually show.

Test Plan: Ran user typeahead queries, tweaked limit to 1.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3121
2012-08-01 14:57:07 -07:00
Alan Huang
ca91a022fe Add a flag column to Differential revision lists
Summary:
Put a flag icon to the left of each flagged revision in the
Differential summary tables. Flag is colored correctly and when hovered
reveals the note in a tooltip.

As epriestley specifically notes that the Flagged Revisions table should
only be shown when a user is looking at their own revisions, maybe this
ought to be limited by what controller is using this view, or something.

Test Plan:
View Differential main page. Check that flags appear
correctly if some revisions are flagged.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, avivey

Maniphest Tasks: T1557

Differential Revision: https://secure.phabricator.com/D3125
2012-08-01 14:33:30 -07:00
epriestley
b9aff187d9 Minor, fix typeahead string casting issue with symbols. Thought I tested this. :/
Auditors: vrana, btrahan
2012-08-01 12:40:23 -07:00
epriestley
a476e5c08d Include symbols in main typeahead
Summary:
  - Include symbols in main typeahead results.
  - Simplify the symbol query a bit and extend PhabricatorOffsetPagedQuery. There was some stuff around language ranking that I got rid of, I think the theory there was that mapping file extensions to languages might not work in general but I think it works fine in practice, and we have more config stuff now around guessing languages and getting the mappings right.
  - Make it easier to debug the typeahead by showing the results in page format for non-ajax requests.
  - When we have too many results, show only the top few of each type.

Depends on D3116, D3117

Test Plan: Used typeahead, got symbols in results. Hit endpoint with non-ajax, got useful debug view.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3118
2012-08-01 12:36:47 -07:00
epriestley
7be02e659a Make typeahead results more structured
Summary: Get rid of this positional array garbage.

Test Plan: Used typeaheads in menu, herald, maniphest, differential, repository/projects.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3116
2012-08-01 12:36:19 -07:00
epriestley
b8f4f7c438 Fix an issue with Diffusion's display of copied files in Git
Summary: If a change copies some file `A` to `B` and also edits `A`, we currently record this as an indirect change and don't show the edits to `A` in the diff. Instead, record these as direct changes.

Test Plan: Created two commits, one which copied `A` to `B` without modifying `A` and one which copied `A` to `B` and modified A. Viewed both commits in Diffusion. The unmodified commit did not show `A`, and the modified commit did (with the correct changes).

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: champo, aran

Differential Revision: https://secure.phabricator.com/D3120
2012-08-01 12:32:35 -07:00
Jonathan Lomas
10f159f876 Change From Priorty to To Priority and To Priority to Max Priority to be clearer as to their purposes. 2012-07-31 22:54:45 -07:00
Jonathan Lomas
54d1b95141 Add minimum and maximum priority select boxes to Maniphest Custom Query.
Summary:
Added the boxes.

NOTE: I am not sure how to deal with the user choosing a minimum higher than the maximum; it causes an empty result set, but if we can avoid allowing it, that'd be better, I think.

Test Plan: See the boxes there, not filtering.  Change them, see them filtering.

Reviewers: epriestley

CC: aran, Korvin

Maniphest Tasks: T1565

Differential Revision: https://secure.phabricator.com/D3109
2012-07-31 22:52:46 -07:00
epriestley
3cf0921682 Remove placeholder
Summary: See discussion in D3103. We don't need this for now; if we do in the future we should probably use an alternate implementation.

Test Plan: Grepped for 'placeholder', viewed UI examples.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3115
2012-07-31 18:28:08 -07:00
epriestley
4b0d0f6e8b Minor, remove debugging code. 2012-07-31 18:06:02 -07:00
epriestley
852ecc2102 Add a basic search typeahead
Summary:
This needs a bunch of refinement but pretty much works. Currently shows only users and applications. Plans:

  - Show actual search results too.
  - Clean up the datasource endpoint so it's less of a mess.
  - Make other typeaheads look more like this one.
  - Improve sorting.
  - Make object names hit the named objects as the first match.

Test Plan: Will attach screenshots.

Reviewers: btrahan, vrana, chad

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3110
2012-07-31 17:58:21 -07:00
vrana
606ef34d61 Load commit branches and tags by AJAX
Summary:
Each query takes over 2 seconds in FBCODE.
I didn't find a way how to speed them up.
There's also no easy way how to parallelize them at least.
So AJAX is the last instance.

Test Plan: Loaded commit with one branch and no tag.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3112
2012-07-31 17:01:41 -07:00
vrana
9092994e45 Make old and new files when checking for changes by commit
Summary:
We have some false positives on commit changes checker.
I'm not sure if the reason is a difference between `git diff` and `svn diff` or something else but making this more robust doesn't harm anything.

We couldn't make the files from the whole changeset because I want to ignore context bigger than `$num_lines` to reduce rebase noise.

Test Plan:
Ran the method on diff which had false positive previously.
Ran the method on a diff with real change.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3107
2012-07-30 17:57:30 -07:00
epriestley
3c7944d297 Switch to new menubar
Summary:
  - Looks better (can probably still use some tweaks), especially search.
  - Moves logout from weird footer location to main menu.
  - Reactive: on tablets and phones, the menu adjusts to remain useful.
  - Fixed position on desktops for future side nav changes.
  - Adds an icon header thing that's currently hard-coded but will be application-driven soon.

Test Plan: Used menu on desktop, tablet, phone, logged in / logged out, toggled darkconsole. Will add some screenshots.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3105
2012-07-30 16:09:14 -07:00
epriestley
998d43e828 Add a "toggle-class" behavior
Summary: The new menu stuff needs this but it was easy to pull out on its own.

Test Plan: Cliked UI example buttons.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3104
2012-07-30 16:08:42 -07:00
epriestley
c8afc741fa Add support for placeholders
Summary:
Support placeholder text for inputs. We currently don't use this because it requires JS and doesn't degrade (no JS means you have zero idea what the input is for if it isn't separately labeled) but there are some cases where intent is obvious from context (for example, the search input in the menu bar, which is fairly obvious on its own and will soon have a magnifying glass icon) and in such cases it's much prettier and saves a bunch of space over an explicit label. Add a behavior so we can add placeholders where they make sense.

This implementation is somewhat sanity-checked agianst the two jQuery placeholder implementations I was able to google:

https://github.com/danielstocks/jQuery-Placeholder/
https://github.com/mathiasbynens/jquery-placeholder

Since we don't currently have any uses cases, I haven't included support for making JS access to the `value` work, for password inputs, or for dynamically altering the placeholder.

Test Plan: Played around with the placeholder in the UI example in various browsers and couldn't break it.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3103
2012-07-30 16:08:10 -07:00
epriestley
b37ea91a69 Fix feedback from D3098.
Auditors: vrana
2012-07-30 13:42:48 -07:00
epriestley
9fd2b37593 Minor, feedback from D3098.
Auditors: btrahan
2012-07-30 10:44:48 -07:00
epriestley
fceabd42e8 Allow Fact app to draw charts
Summary: For any count fact, allow a chart to be drawn. INCREDIBLY POWERFUL DATA ANALYSIS PLATFORM.

Test Plan: Drew a chart of object counts. Drew the Maniphest burn chart.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1562

Differential Revision: https://secure.phabricator.com/D3099
2012-07-30 10:44:08 -07:00
epriestley
f0af273165 Add FactCursors and application fact datasources
Summary:
  - Add PhabricatorApplication. This is a general class that I have grand designs for, but used here to allow applications to provide objects for analysis by the facts appliction.
  - Add FactCursors, to keep track of where iterators are.
  - Make the daemon do something sort of useful.
  - Add `bin/fact cursors` for showing and managing objects and cursors.
  - Add some options to `bin/fact analyze`.

Test Plan:
  - `bin/fact cursors`, `bin/fact cursors --reset DifferentialRevision`, `bin/fact cursors --reset X`
  - `bin/fact analyze`, `bin/fact analyze --all`, `bin/fact analyze --iterator DifferentialRevision --skip-aggregates`
  - `bin/phd debug fact`

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1562

Differential Revision: https://secure.phabricator.com/D3098
2012-07-30 10:43:49 -07:00
Bob Trahan
c8578b9fa8 Add a link to repository tool if there are no configured repositories
Summary: helping noobs help themselves

Test Plan: set $rows = array() and verified the txt. also threw a false && for my isAdmin conditional to check the other txt

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1086, T1360

Differential Revision: https://secure.phabricator.com/D3100
2012-07-30 09:09:40 -07:00
pearj
f2dea87c11 Fix Exception Bad getter call: getURIObject
After this commit: d9296638cd

I started getting this error:

Unhandled Exception ("Exception")
Bad getter call: getURIObject

It turns out that getURIObject just needed to be getRemoteURIObject and then the problem goes away.
2012-07-28 18:27:52 +10:00
epriestley
f652123c5a Add PhabricatorFactSpec, for naming and formatting facts
Summary: Not totally sure about this but I think it's okay?

Test Plan: Loaded /fact/, got a more readable page.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1562

Differential Revision: https://secure.phabricator.com/D3090
2012-07-27 17:29:44 -07:00
epriestley
d9296638cd Fix a "user@domain:path" protocol handling bug
Summary:
In D3063, we stopped converting "user@domain:path" git-style URIs, but this broke the SSH-detection code and I missed that in my test plan because my test case uses natural SSH keys so the omission of SSH flags didn't cause failures.

This code is a bit of a mess anyway. Consolidate and refactor it to be a bit simpler, and add test coverage.

Test Plan: Ran unit tests. Ran "test_connection.php" in SSH and non-SSH modes, verified SSH modes generated appropriate ssh-agent commands around the git remote commands.

Reviewers: vrana, btrahan, tberman

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1529

Differential Revision: https://secure.phabricator.com/D3093
2012-07-27 17:21:33 -07:00
epriestley
f1eb92a126 Fix a bug where some Maniphest batch edits were incorrectly skipped
Summary: Currently, if you have a task with project "X" and you apply a batch edit to it to remove "X", the action has no effect because we incorrectly skip the edit as a no-op. Instead, don't perform this check for edge edits.

Test Plan: Batch removed a project from several tasks with only one project.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1566

Differential Revision: https://secure.phabricator.com/D3092
2012-07-27 15:25:32 -07:00
epriestley
486f7c1e8e Add aggregated facts to the Facts application
Summary:
Some facts are aggregations of other facts. For example, we may compute how many times each macro is used in each object as a "raw fact":

  Dnnn uses macro "psyduck" 6 times.

But we want to present this data in aggregate form, e.g. "order macros by popularity". We can do this at runtime and it probably won't be too awful a query, but we can also aggregate it cheaply:

  Macro "psyduck" is used 3920 times across all objects.

...and then do a query like "select macros ordered by usage".

"Aggregate" facts support facts like this. The aggregate facts I've implemented are:

  - Count of all objects.
  - Count of objects of type X.
  - Last time facts were updated.

These clearly fit the "aggregate" facts template well. I'm not 100% sure macros do. We can use this table to answer a question like "What are the most popular macros, ordered by use?" We can also use it to answer a question like "What are the most popular macros in the last 6 months?", if we build a specific fact for that. But we can't use it to answer a question like "What are the most popular macros between times X and Y?". Maybe that's important; maybe not.

This seems like a good fit for at least some types of facts.

I'll de-magic the keys a bit in the next diff.

Test Plan: Ran the engines and got some aggregated facts about other facts.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1562

Differential Revision: https://secure.phabricator.com/D3089
2012-07-27 13:46:01 -07:00
vrana
05bf6bef81 Jump to correct line in Blame previous revision
Test Plan: Jumped on correct line in SVN, Git and HG repos.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3084
2012-07-27 13:38:15 -07:00
epriestley
7c934e4176 Add a basic "fact" application
Summary:
Basic "Fact" application with some storage, part of a daemon, and a control binary.

= Goals =

The general idea is that we have various statistics we'd like to compute, like the frequency of image macros, reviewer responsiveness, task close rates, etc. Computing these on page load is expensive and messy. By building an ETL pipeline and running it in a daemon, we can precompute statistics and just pull them out of "stats" tables.

One way to do this is just to completely hard-code everything, e.g. have a daemon that runs every hour which issues a big-ass query and dumps results into a table per-fact or per fact-group. But this has a bunch of drawbacks: adding new stuff to the pipeline is a pain, various fact aggregators can't share much code, updates are slow and expensive, we can never build generic graphs on top of it, etc.

I'm hoping to build an ETL pipeline which is generic enough that we can use it for most things we're interested in without needing schema changes, and so that installs can use it also without needing schema changes, while still being specific enough that it's fast and we can build useful stuff on top of it. I'm not sure if this will actually work, but it would be cool if it does so I'm starting pretty generally and we'll see how far I get. I haven't built this exact sort of thing before so I might be way off.

I'm basing the whole thing on analyzing entire objects, not analyzing changes to objects. So each part of the pipeline is handed an object and told "analyze this", not handed a change. It pretty much deletes all the old data about that thing and then writes new data. I think this is simpler to implement and understand, and it protects us from all sorts of weird issues where we end up with some kind of garbage in the DB and have to wipe the whole thing.

= Facts =

The general idea is that we extract "facts" out of objects, and then the various view interfaces just report those facts. This change has on type of fact, a "raw fact", which is directly derived from an object. These facts are concerete and relate specifically to the object they are derived from. Some examples of such facts might be:

  D123 has 9 comments.
  D123 uses macro "psyduck" 15 times.
  D123 adds 35 lines.
  D123 has 5 files.
  D123 has 1 object.
  D123 has 1 object of type "DREV".
  D123 was created at epoch timestamp 89812351235.
  D123 was accepted by @alincoln at epoch timestamp 8397981839.

The fact storage looks like this:

  <factType, objectPHID, objectA, valueX, valueY, epoch>

Currently, we supprot one optional secondary key (like a user PHID or macro PHID), two optional integer values, and an optional timestamp. We might add more later. Each fact type can use these fields if it wants. Some facts use them, others don't. For instance, this diff adds a "N:*" fact, which is just the count of total objects in the system. These facts just look like:

  <"N:*", "PHID-xxxx-yyyy", ...>

...where all other fields are ignored. But some of the more complex facts might look like:

  <"DREV:accept", "PHID-DREV-xxxx", "PHID-USER-yyyy", ..., ..., nnnn> # User 'yyyy' accepted at epoch 'nnnn'.
  <"FILE:macro", "PHID-DREV-xxxx", "PHID-MACR-yyyy", 17, ..., ...> # Object 'xxxx' uses macro 'yyyy' 17 times.

Facts have no uniqueness constraints. For @vrana's reviewer responsiveness stuff, we can insert multiple rows for each reviewer, e.g.

  <"DREV:reviewed", "PHID-DREV-xxxx", "PHID-USER-yyyy", nnnn, ..., mmmm> # User 'yyyy' reviewed revision 'xxxx' after 'nnnn' seconds at 'mmmm'.

The second value (valueY) is mostly because we need it if we sample anything (valueX = observed value, valueY = sample rate) but there might be other uses. We might need to add "objectB" at some point too -- currently we can't represent a fact like "User X used macro Y on revision Z", so it would be impossible to compute macro use rates //for a specific user// based on this schema. I think we can start here though and see how far we get.

= Aggregated Facts =

These aren't implemented yet, but the idea is that we can then take the "raw facts" and compute derived/aggregated/rollup facts based on the raw fact table. For example, the "count" fact can be aggregated to arrive at a count of all objects in the system. This stuff will live in a separate table which does have uniqueness constraints, and come in the next diff.

We might need some kind of time series facts too, not sure about that. I think most of our use cases today are covered by raw facts + aggregated facts.

Test Plan: Ran `bin/fact` commands and verified they seemed to do reasonable things.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran, majak

Maniphest Tasks: T1562

Differential Revision: https://secure.phabricator.com/D3078
2012-07-27 13:34:21 -07:00
Nick Harper
14e3e5ccfd Provide user option for disabling diffusion symbol cross-references
Summary: Some people don't like these, so they should be able to turn them off.

Test Plan:
Toggled the setting on and off; loaded a page in diffusion and differential
that should have symbol cross-references, and saw that they weren't linked
when I had the setting disabled. I also checked that the symbols are still
linked when the setting hasn't been touched.

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3069
2012-07-26 20:25:27 -07:00
vrana
0cfdf2f74f Allow specifying against commit in DiffusionRawDiffQuery
Summary: I will need this for tracking line number in Blame previous revision.

Test Plan:
  $ hg diff --rev 0:1
  $ svn diff -r 64382:64383 README

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3083
2012-07-26 15:13:03 -07:00
Evan Priestley
94445d41e7 Merge pull request #168 from ossareh/support_ldap_search_for_users
Support ldap search for users
2012-07-26 14:54:10 -07:00
Evan Priestley
1cf880ffc6 Merge pull request #167 from CodeBlock/master
D3081
2012-07-26 14:49:44 -07:00
Ricky Elrod
729f246f92 Add a checkbox to allow administrators to re-send the welcome email to users.
Summary:
See title - This simply adds a checkbox to the "Edit User" page in the
admin view, to allow an administrator to re-send the "Welcome to Phabricator"
email.

Test Plan:
Sent myself another welcome email using the checkbox.
Created a new user using the admin panel, to make sure emails still get
sent for new users.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1524

Differential Revision: https://secure.phabricator.com/D3081
2012-07-26 17:41:14 -04:00
Michael Ossareh
a9af5d611d Prevent the ability to scrape for valid usernames
- return the same error message when either bind or the username search
   fails to find a user
 - config variables should use hypen and not underscore
2012-07-26 14:32:51 -07:00
vrana
636877807f Fix typo in comment 2012-07-26 13:45:48 -07:00
vrana
aefc5654c3 Load contents of shielded files with lots of changes
Summary:
We need `$this->old` and `$this->new` in `renderShield()`.

Broken since D2358.

Test Plan: Loaded contents of file with lots of changes.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3080
2012-07-26 13:28:10 -07:00
epriestley
c614af53bf Add PhutilFactsUpateIterator
Summary: This iterator processes objects that have been updated.

Test Plan:
Ran this test script:

  $cursor = null;
  $table  = new DifferentialRevision();
  while (true) {
    $iterator = new PhabricatorFactsUpdateIterator($table, $cursor);
    foreach ($iterator as $new_cursor => $update) {
      echo "{$new_cursor} => D".$update->getID()."\n";
      $cursor = $new_cursor;
    }
    echo "Zzz...\n";
    sleep(5);
  }

Verified it iterated over every object and then stopped. Made a comment on a differenial revision, verified it iterated over the object after 15 seconds.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1562

Differential Revision: https://secure.phabricator.com/D3077
2012-07-26 13:09:36 -07:00
Michael Ossareh
0a0607d2f7 Support searching for users to find their LDAP entry
Summary:
 - the current LDAP auth flow expects a DN to look like
   cn=ossareh,ou=Users,dc=example,dc=com
 - however many LDAP setups have their dn look something like
   cn=Mike Ossareh,ou=Users,dc=example,dc=com

Test Plan:
 Test if logins work with a LDAP setup which has cn=Full Name
 instead of cn=username.

 To test you should ensure you set the properties needed to
 trigger the search before login as detailed in conf/default.conf.php

Reviewers: epriestley

CC: mbeck, aran, Korvin

Differential Revision: https://secure.phabricator.com/D3072
2012-07-25 19:03:10 -07:00
epriestley
94bc4003f1 Show a "Logout?" dialog when the user goes to /logout/
Summary: Currently, the logout link is this awkward form in the footer since we have to CSRF it. Enable a GET + dialog + confirm workflow instead so the logout link can just be a link instead of this weird mess.

Test Plan: Went to /logout/, logged out.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3066
2012-07-25 13:58:49 -07:00
vrana
92a243492e Fix loading owning package
Summary: It is completely broken since D2943.

Test Plan:
  PhabricatorOwnersPackage::loadAffectedPackages($repository, $path);

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3067
2012-07-25 12:52:44 -07:00
vrana
1fc2dfd54b Load reviewer stats
Summary:
This allows getting stats for any arbitrary period, e.g.

- everything
- last week
- week before last week

Test Plan: Ran the script for last week.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3064
2012-07-25 11:40:16 -07:00