Commit Graph

7715 Commits

Author SHA1 Message Date
Brian Simpson
db3bb27a84 Use stale subreddit lookup for saved subreddits 2016-12-08 11:18:58 -08:00
Andy Sacher
0d0e41473a Add missing import to printablebuttons 2016-12-02 11:20:49 -08:00
Andy Sacher
dd46d3677f Add utm query parameters onto links for comments/messages
Link.tracking_link adds utm query parameters onto links inside reddit
to track which button was clicked, what component type contains the button
(e.g. post listing, inbox, post listing embedded on a comments page),
what page type the user is visiting, and the page's subreddit.

This feature is enabled via feature flag and disabled by admin mode.

This commit affects programmatically-generated links to comments and messages.
2016-12-01 17:39:27 -08:00
Avinash Dwarapu
b900d9b342 Fix documentation for GET_rules in subreddit 2016-12-01 13:02:38 -08:00
Pokechu22
e5eb480ed3 Search: Fix restrict_sr for domains listings and AllMinus
For domains listings, it was possible to have results from the wrong domain be included.  Switching to a phrase search fixes that.  See https://redd.it/5ew4ve for more info about, and caveats of, this method.

For AllMinus, see https://redd.it/5eqiyy for the general context.  This does not need to be explicitly handled for ModMinus, as ModMinus excludes the filtered subreddits from its sr_ids property.  Additionally, ModMinus doesn't need special handling since it inherits the already-handled MultiReddit.
2016-12-01 13:02:32 -08:00
Eric
bb1abcccc1 Mention karma in CANT_CREATE_SR
The most common, and I really mean it, the most common post in /r/help and related subreddits is when users question why they can't make a subreddit even though they have an old account. The error that users get only mentions account age and does not mention any kind of karma requirement. It's in the /r/help FAQ, but we all know no one reads that.

Just lightly mentioning karma could reduce the traffic on /r/help as well as be more clear.
2016-11-29 12:05:21 -08:00
David Wick
80c97df6f4 Ads: Remove roadblocks functionality
These were original to prevent users from buying ads when
managed campaign page takeovers were in effect.  With auction this
no longer matters since impressions are no longer guaranteed.

More recently it seems roadblocks were used to prevent people from
buying ads in places that were inappropriate.  We now have other
ways of dealing with that (`subreddit.hide_sponsored_headlines and
`subreddit.allow_ads`) so these pages are completely obsolete.
2016-11-29 11:25:06 -08:00
William Ting
ea8f0b72c5 Remove unused imports. 2016-11-28 14:33:15 -08:00
William Ting
de071d9b17 Remove unused Cassandra Counter. 2016-11-28 14:31:03 -08:00
Brian Simpson
1a4dcb4fc4 StripeController: Add noop 'review.opened' event 2016-11-22 11:15:02 -08:00
Brian Simpson
77eaf71b1b consume_comment_vote_queue: Don't update commenttree if not needed 2016-11-14 14:48:30 -08:00
Brian Simpson
49e86551a1 Move get_active_sort_orders_for_link to separate method 2016-11-14 14:48:30 -08:00
Brian Simpson
6b15b30954 Process updates in non-fastlane queue when a link is fastlaned
Previously the messages in the non-fastlane queue were dropped so some
older comments would not be added to the CommentTree. There may be some
lock contention with multiple queue consumers processing updates for the
fastlaned links, but it shouldn't last very long.
2016-11-14 14:48:30 -08:00
Brian Simpson
39630c6432 Remove live config "precomputed_comment_sort_read_chance"
This was used to gradually ramp up reads of the precomputed comment
orders. We've been running for a while with this set to always read,
so the setting can be removed.
2016-11-14 14:48:30 -08:00
Brian Simpson
e4ebb6df4a comment_tree: Eliminate some duplication in calculating scores 2016-11-14 14:48:29 -08:00
Brian Simpson
1f5be6b3a6 _get_qa_comment_scores: Take cid_tree as input
Previously it wasn't clear that the CommentTree would be looked up and
that there might be some consistency concerns.
2016-11-14 14:48:29 -08:00
Brian Simpson
12d5f73a51 comment_tree: Move write_comment_scores to its own function 2016-11-14 14:48:22 -08:00
Brian Simpson
f90ab4aa71 write_comment_orders: Add counters to track writes vs. noops
This will let us get a sense of how much work is actually done. I'm looking
at splitting the CommentOrderer update out into a separate queue and need
to understand how many writes actually happen.
2016-11-14 14:48:16 -08:00
Brian Simpson
b22711866c add_comments: Remove warning about writing scores first
This warning was no longer true--any missing scores are automatically
calculated and updated.

We actually have the opposite issue--the CommentTree must be updated
before writing scores because the QA score reads it.
2016-11-14 14:48:11 -08:00
Brian Simpson
c7d0f5b607 voting: Don't update comment scores on automatic initial vote
Score updates are processed through commentstree_q. When a new comment
is created an automatic initial vote (by the comment's author) is created.
This results in two messages in commentstree_q: one from the vote and one
from queries.new_comments. Don't create the message from the vote because it
is redundant. This will let us reduce the volume of messages in commentstree_q
which is currently very high.
2016-11-14 14:48:04 -08:00
Brian Simpson
9544da4905 feature: Fix race condition when live_config is updated
Instead of checking _featurestate_cache for a key's existence and then
retrieving it, just get it and then check for a miss. Doing the two step
process can result in a KeyError if _featurestate_cache is cleared between
the existence check and the retrieval.
2016-11-14 14:47:53 -08:00
Brian Simpson
4d7a7f5568 db_manager: Don't setup a connection for some dbs on startup
"email", "authorize", "hc", and "traffic" databases aren't used that
often and maybe we can reduce the number of connections to pg-05 by
waiting to establish a connection until it's actually needed.
2016-11-14 14:47:24 -08:00
Brian Simpson
da00f3eefb voting: Don't use fastlane vote processor
The fastlane processor was meant to handle votes on both Links and Comments,
but it can't do that easily anymore now that the vote processing has been
split. It's not a big deal now because Link vote processing is much faster
now that the query updating has been separated and sharded. The Comment vote
consumer/queue was getting some benefit from the fastlane and it can be
resurrected if we run into problems.
2016-11-03 16:04:07 -07:00
Chris Slowe
d48c387b7c Don't error on unicode in the votestream.
Change the error from a 500 to a line in the error log with more info about what/why it failed.
This seems to be the result of someone's crappy votebot.
2016-11-03 16:04:04 -07:00
Katie Atkinson
44521216b2 Add ability for all oauth tokens to be invalidated on password change
Add 'revoke_sessions' method to 'POST_update_password'
2016-11-01 12:02:51 -07:00
Brian Simpson
58da74cb9a Remove warning about disabled imgur domain listings 2016-10-26 12:03:45 -07:00
Brian Simpson
09bb39cfc1 Process domain listing for imgur.com 2016-10-26 12:00:05 -07:00
Brian Simpson
7f3113f476 link votes: Use a queue to update links by domain queries
The queue can be sharded by domain to minimize lock contention
and the consumer will batch updates to the same links (e.g. several
votes for the same link) and to the same domain (e.g. votes for different
links to a single domain).
2016-10-26 11:59:54 -07:00
Brian Simpson
5ebee0959f link votes: Use a queue to update links by subreddit queries
The queue can be sharded by subreddit id to minimize lock contention
and the consumer will batch updates to the same links (e.g. several
votes for the same link) and to the same subreddit (e.g. votes for different
links submitted to a single subreddit).
2016-10-26 11:59:49 -07:00
Brian Simpson
1e5fa7670f link votes: Use a queue to update links by author queries
The queue can be sharded by author id to minimize lock contention
and the consumer will batch updates to the same links (e.g. several
votes for the same link) and to the same author (e.g. votes for different
links submitted by a single author).
2016-10-26 11:57:17 -07:00
Brian Simpson
67d71d6329 Unshard vote_link_q 2016-10-26 11:55:00 -07:00
Brian Simpson
aef5f483ae voting: Use separate methods for updating cached queries
This makes the individual tasks of the consumer more readable.
2016-10-26 11:54:55 -07:00
Brian Simpson
d0d6d24e1a voting: Only need to lock when updating user's liked links 2016-10-26 11:54:49 -07:00
Brian Simpson
c226567d0d Inline vote processor work 2016-10-26 11:54:42 -07:00
Brian Simpson
371398ed51 Use different consumers for Link and Comment votes 2016-10-26 11:54:32 -07:00
Brian Simpson
c4f3db6ef0 Add timings in Link vote processor
This will help us understand which parts are most time consuming
and whether we can benefit by breaking up the updates into multiple
queues.
2016-10-26 11:54:12 -07:00
Brian Simpson
fd9e8b4e41 Split processing for Link votes and Comment votes 2016-10-26 11:54:01 -07:00
Brian Simpson
22de659e23 link.py: Move cast_vote import to within method
This gets around some circular import issues and is simpler than changing
the imports in voting.py.
2016-10-26 11:29:36 -07:00
Brian Simpson
329b3c1c8e LocalCache.simple_get_multi: Use exception handling to get keys
Doing the 2 step process of:
1. check for existence of key
2. get key

introduces a race condition if the key is deleted between the two steps.
2016-10-25 11:25:36 -07:00
Brian Simpson
2fdddb69e4 raven: Specify all application code path prefixes
The raven client inspects the traceback and attempts to figure out which
parts belong to the app and which belong to external libraries. It uses
a whitelist of paths to identify application code. Previously we had been
using the list of repository names, but that was incorrect because the
plugin "liveupdate" is actually called "reddit_liveupdate" in the traceback.
The whitelist was also incomplete because it didn't account for scripts run with
paster run which can have a path like /opt/something/script.py.
2016-10-19 16:34:43 -07:00
Brian Simpson
3328493ef5 RunCommand: Report exceptions with RavenErrorReporter 2016-10-19 16:33:24 -07:00
Brian Simpson
48930b80c5 RavenErrorReporter: Don't install_sys_hook
This creates a sys.excepthook handler that reports any exceptions
to Sentry. This results in double reporting errors when in script
mode because the exception is re-raised and caught by that handler.
2016-10-19 16:33:24 -07:00
Brian Simpson
6c7c5df58e RavenErrorReporter: handle exceptions in script mode 2016-10-19 16:33:19 -07:00
Prashant Singh
40625dcc07 Add page-based experiment support
We can conduct experiments that impact how pages are rendered across
users, bucketing pages according to the fullname, so that search engines
will crawl and index the same experimental content that users see. We
support subreddit listings pages, comments pages, and comment permalink
pages. We use the link fullname for both comments pages and comment
permalink pages, so that they are bucketed together.
2016-10-19 15:52:38 -07:00
Prashant Singh
098d047e8a Tell crawlers not to index comment permalink pages
We don't want to spend crawl budget or rank on what are essentially
duplicate pages. In case we have inbound links to these pages, we don't
want the robots.txt to prevent crawlers from accessing them.
2016-10-19 15:20:22 -07:00
William Ting
94a70830be Add automatic search engine integration.
This adds the required metadata and files to support automatic search engine
additions to Chrome / Chromium.
2016-10-18 10:15:20 -07:00
Daniel Ellis
d5992d6a30 Remove memcached deletion from hardcache cleanup. 2016-10-12 11:06:29 -07:00
Dan
8b31ebc99b Remove hardcache cache. 2016-10-12 10:00:01 -07:00
Matt Lee
da54902795 reddit.js: Don't submit disabled forms in post_form 2016-10-07 17:48:13 -04:00
Matt Lee
8fb3e9106d errors.js: Add r.errors.create method
Makes creating errors consistent with the formatting of API errors on
the client side easier.
2016-10-07 17:48:13 -04:00