In order to prevent bad titles from entering the database,
PageIdentityValue should not allow instances that have obviously broken
dbeys, just like it does not allow construction for a special page.
Note however that for now, we allow PageReferenceValue to represent
thigns that are not actual pages, such as titles like "User:#1234" which
are used in the block log to represent autoblock targets. Similarly,
a PageReferenceValue can represent a special page.
This patch introduces a convenience method for constructing
PageIdentityValues in a context where it is uncertain whetehr the title
is valid, providing an opportunity to the caller to report in which
context the bad values were found.
In addition, this patch adds some documentation and testing, to clarify
the semantics of methods in PageStore with respect to invalid and non-
proper titles.
Bug: T282070
Change-Id: I8a44d9e73dda8fe38d009847332946809767d0fa
Catching common issues here instead of where the caller expects breaks
log formatting, including complete breakage of Special:RecentChanges.
The doc comment says that validation is the caller's responsibility,
which seems like a good idea to me.
Bug: T282070
Change-Id: Ic7e5c5576564e61906a812d50ea4e48adf5ac998
This explores the idea of a PageReference type which represents a
namespace/dbkey pair.
Every ProperPageIdentity is a PageReference. Some LinkTargets can be
mapped to a PageReference.
Bug: T279522
Change-Id: Id8b0c781fce329adcc4770f4840b2ba0108f6898
As we convert the RevisionRecord to using Authority,
we no longer need Title instances, so we can convert
that to PageIdentity.
Ideally, we'd part away from using Title at all, but:
1. For foreign wikis PageIdentity has stronger validation,
so calling PageIdentity getId() on Title will break things.
There's still a lot of code depending on lax Title guarantees,
so we keep it.
2. A lot of code still depends on Title, so we try to pass it
through even if we don't nesessarily need to, to save cost
on recreating it later on.
Bug: T271458
Depends-On: I287400b967b467ea18bebbb579e881a785a19158
Change-Id: I63d9807264d7e2295afef51fc9d982447f92fcbd
This reverts commit 36f1adf670.
This has seemingly broken FlaggedRevs and thus a bunch of repos.
Bug: T272170
Change-Id: I26c6fd656c75a6b209fb17965dc9109edf68642b
This allows Title and WikiPage objects to be compared with PageIdentity
and LinkTarget instances consistently.
Change-Id: I1bbd15d17d046359393ecfc1acd2778273260a95
PageIdentity is intended as a lightweight alternative to Title,
similar to LinkTarget, but providing a page ID. It follows the precedent
of UserIdentity.
Bug: T208776
Change-Id: Iaed4871e0d32c67d4fb13e487625527f6a21e9c5