Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AO3-5235 Block requesting invitations when the queue is disabled #3136

Merged
merged 1 commit into from Nov 2, 2017

Conversation

redsummernight
Copy link
Member

Issue

https://otwarchive.atlassian.net/browse/AO3-5235

Purpose

When the queue is disabled, users can still request invitations, even if those don't get sent out. Users should not be able to.

Testing

See JIRA issue.

@sarken sarken merged commit a114b66 into otwcode:master Nov 2, 2017
@redsummernight redsummernight deleted the AO3-5235-no-new-invite branch November 2, 2017 05:40
elzj pushed a commit that referenced this pull request Dec 19, 2017
* Adds retry to failed document index in bulk indexing

* Adds explanatory comment to seemingly odd choice in indexer

* Removes unnecessary code

Realized that `where(id: ["128-work"])` will automatically call `to_i` on
"128-work" so no need to map it out. TIL.

* Adds IndexSweeper class to clean up indexes for ghost objects

* Adds tests and fixes bug

* WIP: Works on adding failsafe for index errors that cannot be fixed on retry

* Fixes failing specs & features

* Removes unused code

* Little refactor

* Adds second retry to ES indexing

* Refactors & adds tests to index sweeper

* Fixes typo

* AO3-5205: Prevent sign ups with duplicate emails in the invite queue (#3130)

* AO3-5205: Prevent sign ups with duplicate emails in the invite queue

* AO3-5205: Make plus removal from emails more thorough and satisfy hounding

* AO3-5205: Add condition to validation to avoid false positives on update

* AO3-5205: Fix validation problem and ensure unique emails in tests

* AO3-5236: Change timeframe in test to prevent month-length-related test failures (#3132)

* AO3-4331 Mark works as spam or ham (#3131)

original code by shalott

* allow admins to mark works as spam/not spam

option for admin to mark works as spam or not (and thereby send reports to Akismet which will improve its identification of spam works)

Signed-off-by: shalott <shalott@gmail.com>

* reformatted admin options bit

Reformatted to match sarken's changes in pullreq 2076

Signed-off-by: shalott <shalott@gmail.com>

* added automatic un/hiding to spam settings

Now automatically hides/unhides work when marked as spam or ham.

Signed-off-by: shalott <shalott@gmail.com>

* fixing valid hound issues

Signed-off-by: shalott <shalott@gmail.com>

* squashed update from master to resolve conflicts

Signed-off-by: astolat shalott <shalott@gmail.com>

* fix new ambiguous step match

Signed-off-by: astolat shalott <shalott@gmail.com>

* AO3-4331 Define akismet_attributes in work model

* AO3-4331 Actually finish resolving merge conflicts

* AO3-4331 Tweak whitespace

* AO3-4331 Remove 'hide' from generic error message

* AO3-5235 Block requesting invitations when the queue is disabled (#3136)

* AO3-4222 Improve homepage and invite requests page when queue is off (#3134)

* AO3-4222 Remove broken and unused new invite requests view

* AO3-4222 Give users more information when invite queue is disabled

* Move the form for checking invite request status to a separate page
* Create separate partials for invite request page depending on whether the queue is on or off
* Update homepage text

* AO3-4222 Update tests for invitation queue related features

* AO3-4222 Correct a test

* AO3-4222 Update the show page for invitation request statuses

* AO3-4222 Update tests

* AO3-4222 Restore views/invite_requests/new.html.erb so it can be removed in the proper issue

* AO3-4222 Use @admin_setting instead of AdminSetting in invite_request view

* AO3-4222 Correct name of instance variable in views

* AO3-5240 Revert timezone in gift exchange test to Papua New Guinea again (#3140)

* AO3-4200 Add rel=nofollow to links to reduce SEO usefulness for spammers (#3137)

* AO3-4200 Add rel=nofollow to links to reduce SEO usefulness for spammers

* AO3-4200 Add rel=nofollow to StoryParser test

* AO3-4200 Test sanitisation in all the text fields that allow CSS classes

* AO3-4222 Fix links to news post tag and capitalization of spam (#3149)

* AO3-4222 Fix links to 'invitations' news posts and capitalization of 'spam'

* AO3-4222 Update capitalization of spam in tests

* AO3-5243 Use AJAX to delete invitation requests (#3151)

* AO3-5243 Use AJAX to delete invitation requests

* AO3-5243 Remove unnecessary redirect

* AO3-5243 Look in the right place for eerrors

* AO3-4855 Add rspec tests for the gifts exchange controller (#3158)

* AO3-4971 Display notice when deleting non-existent invite requests (#3159)

* AO3-3848 Added Feature test for a locked user account (#3135)

* AO3-3848 Added feature test for brute force lock

* AO3-3848 Remove spaces from line

* AO3-3848 Change for to times

* AO3-3848 Fix multi line block

* AO3-3848 Replace user lock feature test with rspec test

* AO3-3848 hound fixes

* AO3-3848 code review changes

* AO3-3848 Removed superfluous plus one

* AO3-3848 Removed unused parenthesys

* AO3-5247 Use _url helper in spam alert email (#3160)

* AO3-5247 Use _url helper in spam alert email

* AO3-5247 Use _url helper in invitation request decline email too

* AO3-5234 Moderate Works (#3162)

* AO3-5234: Add admin pages for reviewing and updating moderated spam works

* AO3-5234 Frontend tweaks

* AO3-5234: Add admin setting for automatically hiding spam works

* AO3-5234: Testing spam features

* AO3-5234: Unhide ham

* AO3-5234: Add pagination for admin page

* AO3-5234: Send emails about hiding spam works and hide works on review when it isn't happening automatically

* AO3-5243 Use correct finder when destroying invite requests (#3163)

* AO3-5249 Add basic search of invitation queue (#3164)

* AO3-5249 Test for searching emails in the queue

* AO3-5249 Add basic search of invitation queue

* AO3-5249 Remember search query when deleting without JavaScript

* AO3-5249 Put scenario back on one line

* AO3-5249 The word you want for the test is SCENARIO, not Search, jfc

* AO3-5249 Update test to check query field

* AO3-5249 Update test to reflect Delete is a button

* AO3-4971 Add test for deleting the specified invite request (#3174)

* AO3-5251: Add spam-specific hidden work email (#3171)

* AO3-5251: Add spam-specific hidden work email

* AO3-5251: Update specs and rearrange settings

* AO3-5234: Add subnav to view reviewed works and update return statements to prevent false error messages (#3176)

* AO3-5234: Fix for unapproving approved works (#3177)

* AO3-5234: Add subnav to view reviewed works and update return statements to prevent false error messages

* AO3-5234: Make sure you can re-mark approved works as spam

* AO3-5234: More language tweaks

* AO3-4138 make reading history more linguistically accessible (#3081)

* AO3-4138 make reading history more linguistically accessible

* Update _reading_blurb.html.erb

* ✌️

* AO3-5086 Update Spotify subdomain for embeds (#3079)

* AO3-5086 Update Spotify subdomain for embeds

* AO3-5086 Update spec for embed whitelist

* AO3-4187 Fix empty tag dropdown when filtering news posts (#3092)

If a language is selected, the dropdown will have all tags across
all posts of that language.

* AO3-5203 giving CSS help documentation consistent spacing (#3147)

* AO3-5086: Fix last reference to old Spotify subdomain (#3182)

* Re-merge Elasticsearch branch (#3179)

* AO3-4815 Update Elasticsearch and filter interface (#3104)

* Upgrades faraday (ran bundle update elasticsearch)

* Adds elasticsearch-model to directly replace tire model

Uses rollout to indicate which module to include in the searchable modules

* Allows application to connect to two ES instances

* Switches version of ES in use by Indexer and Query depending on rollout feature

* Fixes feature failure in importing

The image is rendered with https://, not http://

* Adds awesome_print gem, to make inspecting json easier

* Adds class to recreate indices in upgraded ES instance & reindex from remote

* Removes elasticsearch-model

* Removes rollout code from models

* WIP - Making app compatible with ES 5.5

* WIP - Pulls in elasticsearch overhaul code

Starting to debug elasticsearch overhaul code, both in its incompatibilities
with current ES and its underlying bugs.

* Gets search/works_anonymous feature specs to pass with new ES code

* Gets search/works_tags features to pass with new es code

* Fixes search/works_info spec failures

* Fixes test failures in search/work_stats

* Updates ES version read by Travis

* Updates ES instance to point to the url Travis will recognize

* Fixes some failing feature specs for search

* Fixes admins/admin_works specs

* Fixes bookmark_create and collection_dashboard feature specs

* Fixes importing/archivist feature specs

* Fixes other_a/orphan_work feature specs

Still using Tire, and reindexing with both Tire and elasticsearch will not break
anything and will be useful when running the test suite twice against the two
different ES versions

* Fixes all other other_a feature failures

* Fixes works_anonymous feature failures

* Fixes tag_wrangling_relationships feature failures

* Fixes users feature failures

* Fixes works feature failures

* Adds the new ES indexing code wherever Tire is use in test setup

* Fixes works default rails actions spec failures

* Fixes elasticsearch_upgrade_spec failures and refactors ES refresh code

* Fixes work query spec

* Adds some minor refactoring to tests

* Adds bookmark indexing/query code & fixes associated tests

* Updates BookmarkSearch references to BookmarkSearchForm

* Fixes bookmark_create feature failures

* Fixes admin/admin_works feature failures

* Fixes bookmarks feature spec failures

* Fixes collections feature specs

* Fixes other_a and search failures

* Fixes users feature specs

* Removes refrences to tire from tests and specs for now

* Fixes search steps problem when reindexing models with any? false

* Fixes reindexing models without any records in specs

* Removes outdated use of WorkSearch model in works controller

* Fixes typo

* Fixes failing specs caused by fixes to failing features

* Fixes bugs in bookmark query

* Some feature failure cleanup

* Adds code for Tag search using updated ES

* Adds pseud search code

* Small test fixes

* Fixes some failing tests, and attempts to address Travis issues

* Adds fixes for Travis failures that are repeatable locally

* Fixes problem where bookmarks without works can't be searched for

* Reindexes indexes everywhere they are updated in the features directory

This should remove inconsistent, nearly-unrepeatable errors caused by the fact
that Elasticsearch is asynchronous. Yay!

* Fixes bookmark query spec failure

* Refactors some of the index updating logic in features

* Fixes default rails actions for works spec

* Isolates Tire reindexing to one file in features

* Fixes tags and wrangling test failures

* Distinguishes ES versions in specs

* Fixes some typos

* Updates to catch old ES version no matter the environment

* Attempting a run with old ES version

* Fixes Tire import

* Fixes spec helper method

* Separates ES wrappers based on ES version in controllers

* Fixes use of new ES code in helpers for use_old_search?

* Fixes old ES code usage in bookmarks controller

* Fixes search using old ES for bookmarks

* Removes tests that were catching a bug that is no longer a problem

* Fixes works failures for old es version

* Fixes features failing on Travis

* Fixes spec failures for old ES version

* Sets Travis to dl new version of ES to see how build does

* Attempt with ES 6.0 alpha

* Adds fix for bookmark deletion bug

* Adds missing details to work indexer

* Adds rollout to indexing

* Swaps out 'use_old_search?' with 'use_new_search?'

* Fixes param names in tests

* Adds rollout to application record use_new_search? method

* Fixes small details & removes unused code

* Fixes typo

* Fixes typo

* Fixes typo

* Fixes lack of question mark for rollout.active? method

* Runs Travis build on old ES and sets elasticsearch version with rollout

* Fixes inccorect method invocation

* Fixes incorrect method invocation in people controller

* Fixes works stats feature failures

* Adds fixes for failing specs

* Uses appropriate count method for old es version

* Removes debug line from feature

* Upgrades nokogiri due to security concern

* Makes it so app will respond appropriately to ES version

To run on Travis, all three ES urls need to be the same:
ENV['ELASTICSEARCH_URL'] &
ENV['ELASTICSEARCH_1_URL'] &
ENV['UPGRADED_ELASTICSEARCH_URL']

All need to point to the same thing. Whenever running an instance of the app
with two versions of ES, ENV['ELASTICSEARCH_URL'] and ENV['ELASTICSEARCH_1_URL']
need to point to the old version and ENV['UPGRADED_ELASTICSEARCH_URL'] needs to
point to the new version.

* Second attempt with 6.0.0-alpha1 ES

* For test with ES 6.0.0-alpha1

* Fixes Travis run in 6.0.0-alpha1 ES

* Untar

* Try starting both

* Simple test run

* Differentiate the builds

* Differentiate the builds

* Restore all the tests

* Fixes call to new elasticsearch api perform_request

* Updates to test suite to watch how upgraded es version works on its own

* refactors out index updating methods in feature specs

* Adds rollout specs

* Fixes bug in work search form object

* Matches config to travis

* Removes all but rspec tests from travis for now

* Sets up tests & rollout methods use expected behavior

* Fixes switch from string to text or keyword for index definitions

* Updates index definitions to be compatible with 6.0.0.beta2 ES version

* Changes localhost to home IP for old ES urls

* Does not require old es to work when old es is gone

* Switches ES bool queries to true/false

* Fixes spec failures for ES Group 1

* Adds specific test to ensure old elasticsearch does not index when it's not present

* Moves to new elasticsearch document indexing when old es is gone

* Fixes problem with helper method for specs

* Ensures app never attempts to reindex an old es index in the new es instance

* Makes it so that a user doesn't have to be present if use_new_search is 100% enabled

* Runs ES=1

* Runs ES=2

* Runs ES=3

* Runs ES=4

* Back to rspec

* Removes command to rebuild three times upon failure

* Updates set_rollout script to use global  variable

* Adds rollout definitions to test suite to see if that addresses Travis build problem

* Runs build with ES=1

* Runs all builds

* Adds same assurances to features as specs that ES will work w/ both versions

* Fixes imported image URL in feature spec

* Fixes reference to tire methods when tire is gone in feature support methods

* Runs only ES=4

* Moves es/rollout code for feature specs

* Fixes boolean representation in work search form

* Fixes boolean in ES search in bookmark search form

* Fixes bookmarks feature failures

* Fixes works_restricted feature failures

* Runs all four ES groups

* Runs ES=1 and ES=4

* Comments out test that's breaking due to third-party url bug

* Makes Travis only run 2 trials

1 - With the old Elasticsearch, in which we test that the old Elasticsearch
continues to work while start_new_indexing is true (individual tests also test
that the SearchForm classes continue to work as expected, meaning that the new
Elasticsearch also works in this case when use_new_search is true)

2 - With the new Elasticsearch

* Adds old exlclusion filter code

* Adds tests & code for work filtering with exclusion tags

* Addresses Travis test failures

* Adds bookmark exclusion filters

* Downgrades back to 5.6.1 (latest stable) ES version

* Adds single_mapping => true to ES indices

* Fixes failure to index bookmarks when they do not have a bookmarkable object

* Adds comments to help when removing old code

* Removes rollout manipulation from Travis

This was not actually setting features. All Travis needs to do is install one or
both versions of ES depending on the test group being run.

* Adds test cases for use_new_search? controller method

* Adds tests & fixes bugs for filtering

* Removes default 'true' from use_new_search method

Reverts old styles and scripts to master

* Fixes typos

* Fixes more typos

* Fixes rollout test for works controller

* Fixes works controller mistake

* Ports over ALL js and css changes that effect filters

* Removes useless method

* Removes file that has nothing to do with new search

* Fixes failing filter tests

* Pulls in fix for autocomplete bug from master

* AO3-4815: Fill out new batch indexing code

* Fixes merge clobbering of css & js files

* AO3-4815: Add new ES to codeship script and use local.yml instead of … (#3110)

* AO3-4815: Add new ES to codeship script and use local.yml instead of editing the regular config

* Fix ES download url and load local config when testing

* AO3-4815: Ensure correct results when browsing bookmarks by user (#3109)

* AO3-5213 Index authors on works correctly for sorting (#3114)

AO3-5213 Index authors on works correctly for sorting

* AO3-5207 Add StatCounterIndexer and fix order of reindexing. (#3111)

* AO3-5207 First go at StatCounter reindexing.

* AO3-5207 Add RSpec tests to make sure it works.

* AO3-5207 Small fixes to pass tests.

* AO3-5207 Make sure to call original when stubbing.

* AO3-5207 Finally fixed.

* AO3-5212 Index correct user ids for works. Also throw in a couple of updated work type tag ids (#3112)

* AO3-5209 Don't change the appearance of non-work & bookmark filters (#3117)

* AO3-5209 Use old JavaScript and views for old Elasticsearch filters (styling fixes to come)

* AO3-5209 Restyle old filters

* AO3-5209 Ensure new work and bookmark filter styling does not conflict with exisiting collection filter styles

* AO3-5216 Fix setting authenticity tokens when cached pages load (#3118)

This was the fix for AO3-5153, which got lost in a merge.

* AO3-5214 Only run the tests on Travis once for now (#3116)

* AO3-5208: Fix filtering behavior (#3113)

* AO3-5208: Fix filtering behavior by drilling down and setting facets appropriately.

* AO3-5208: Don't error when there are no filters

* AO3-5208: Ensure excluded tags are visible in filters

* AO3-5208: Make sure bookmark facet query knows about exclusions. Also don't index filters and other bookmarkable fields on the bookmark itself since that's what we're trying to avoid.

* AO3-5208: Dry up some tag-related query methods, reduce number of db requests, only exclude children of Character tags, and make exclusion work for bookmark tags again

* AO3-5208: Update some tests to match new behavior

* AO3-5208: Put excluded bookmark tags in the right filter bucket

* AO3-5208: Remove sub tag exclusion code, since the meta tag id is already indexed on works

* AO3-5208: Comment out tests for types of exclusion filtering we aren't currently doing for bookmarks

* AO3-5208: Enable querying on both parent and child bookmark fields and reflect queries in bookmark filters

* AO3-5208: Update tests for bookmark search syntax change and bookmarker indexing encompassing user name

* AO3-5208: Make 'other tags' filtering work for noncanonical tags as well

* AO3-5223: Fix id on bookmarks exclude field

* AO3-5208: Remove child exclusion from filters and enable inclusion for noncanonical tags

* AO3-5220 and AO3-5224: Fix searching bookmarks by notes and tag names and index bookmarkable date for sorting

* AO3-5220: Update old bookmark search code for notes fix, fix spacing in module

* AO3-5225 Fix sidebar counts and scope by user id if a user is present (#3119)

* AO3-5225: Fix sidebar counts and scope by user id if a user is present

* AO3-5225: Update user dashboard feature to check counts in multiple places

* AO3-5231: Fix formatting of search text and don't chop up tag searches

* AO3-5231: Remove duplication and add specs

* AO3-5254: Upgrade to Elasticsearch 6 (#3183)

* AO3-4815 Update Elasticsearch and filter interface (#3104)

* Upgrades faraday (ran bundle update elasticsearch)

* Adds elasticsearch-model to directly replace tire model

Uses rollout to indicate which module to include in the searchable modules

* Allows application to connect to two ES instances

* Switches version of ES in use by Indexer and Query depending on rollout feature

* Fixes feature failure in importing

The image is rendered with https://, not http://

* Adds awesome_print gem, to make inspecting json easier

* Adds class to recreate indices in upgraded ES instance & reindex from remote

* Removes elasticsearch-model

* Removes rollout code from models

* WIP - Making app compatible with ES 5.5

* WIP - Pulls in elasticsearch overhaul code

Starting to debug elasticsearch overhaul code, both in its incompatibilities
with current ES and its underlying bugs.

* Gets search/works_anonymous feature specs to pass with new ES code

* Gets search/works_tags features to pass with new es code

* Fixes search/works_info spec failures

* Fixes test failures in search/work_stats

* Updates ES version read by Travis

* Updates ES instance to point to the url Travis will recognize

* Fixes some failing feature specs for search

* Fixes admins/admin_works specs

* Fixes bookmark_create and collection_dashboard feature specs

* Fixes importing/archivist feature specs

* Fixes other_a/orphan_work feature specs

Still using Tire, and reindexing with both Tire and elasticsearch will not break
anything and will be useful when running the test suite twice against the two
different ES versions

* Fixes all other other_a feature failures

* Fixes works_anonymous feature failures

* Fixes tag_wrangling_relationships feature failures

* Fixes users feature failures

* Fixes works feature failures

* Adds the new ES indexing code wherever Tire is use in test setup

* Fixes works default rails actions spec failures

* Fixes elasticsearch_upgrade_spec failures and refactors ES refresh code

* Fixes work query spec

* Adds some minor refactoring to tests

* Adds bookmark indexing/query code & fixes associated tests

* Updates BookmarkSearch references to BookmarkSearchForm

* Fixes bookmark_create feature failures

* Fixes admin/admin_works feature failures

* Fixes bookmarks feature spec failures

* Fixes collections feature specs

* Fixes other_a and search failures

* Fixes users feature specs

* Removes refrences to tire from tests and specs for now

* Fixes search steps problem when reindexing models with any? false

* Fixes reindexing models without any records in specs

* Removes outdated use of WorkSearch model in works controller

* Fixes typo

* Fixes failing specs caused by fixes to failing features

* Fixes bugs in bookmark query

* Some feature failure cleanup

* Adds code for Tag search using updated ES

* Adds pseud search code

* Small test fixes

* Fixes some failing tests, and attempts to address Travis issues

* Adds fixes for Travis failures that are repeatable locally

* Fixes problem where bookmarks without works can't be searched for

* Reindexes indexes everywhere they are updated in the features directory

This should remove inconsistent, nearly-unrepeatable errors caused by the fact
that Elasticsearch is asynchronous. Yay!

* Fixes bookmark query spec failure

* Refactors some of the index updating logic in features

* Fixes default rails actions for works spec

* Isolates Tire reindexing to one file in features

* Fixes tags and wrangling test failures

* Distinguishes ES versions in specs

* Fixes some typos

* Updates to catch old ES version no matter the environment

* Attempting a run with old ES version

* Fixes Tire import

* Fixes spec helper method

* Separates ES wrappers based on ES version in controllers

* Fixes use of new ES code in helpers for use_old_search?

* Fixes old ES code usage in bookmarks controller

* Fixes search using old ES for bookmarks

* Removes tests that were catching a bug that is no longer a problem

* Fixes works failures for old es version

* Fixes features failing on Travis

* Fixes spec failures for old ES version

* Sets Travis to dl new version of ES to see how build does

* Attempt with ES 6.0 alpha

* Adds fix for bookmark deletion bug

* Adds missing details to work indexer

* Adds rollout to indexing

* Swaps out 'use_old_search?' with 'use_new_search?'

* Fixes param names in tests

* Adds rollout to application record use_new_search? method

* Fixes small details & removes unused code

* Fixes typo

* Fixes typo

* Fixes typo

* Fixes lack of question mark for rollout.active? method

* Runs Travis build on old ES and sets elasticsearch version with rollout

* Fixes inccorect method invocation

* Fixes incorrect method invocation in people controller

* Fixes works stats feature failures

* Adds fixes for failing specs

* Uses appropriate count method for old es version

* Removes debug line from feature

* Upgrades nokogiri due to security concern

* Makes it so app will respond appropriately to ES version

To run on Travis, all three ES urls need to be the same:
ENV['ELASTICSEARCH_URL'] &
ENV['ELASTICSEARCH_1_URL'] &
ENV['UPGRADED_ELASTICSEARCH_URL']

All need to point to the same thing. Whenever running an instance of the app
with two versions of ES, ENV['ELASTICSEARCH_URL'] and ENV['ELASTICSEARCH_1_URL']
need to point to the old version and ENV['UPGRADED_ELASTICSEARCH_URL'] needs to
point to the new version.

* Second attempt with 6.0.0-alpha1 ES

* For test with ES 6.0.0-alpha1

* Fixes Travis run in 6.0.0-alpha1 ES

* Untar

* Try starting both

* Simple test run

* Differentiate the builds

* Differentiate the builds

* Restore all the tests

* Fixes call to new elasticsearch api perform_request

* Updates to test suite to watch how upgraded es version works on its own

* refactors out index updating methods in feature specs

* Adds rollout specs

* Fixes bug in work search form object

* Matches config to travis

* Removes all but rspec tests from travis for now

* Sets up tests & rollout methods use expected behavior

* Fixes switch from string to text or keyword for index definitions

* Updates index definitions to be compatible with 6.0.0.beta2 ES version

* Changes localhost to home IP for old ES urls

* Does not require old es to work when old es is gone

* Switches ES bool queries to true/false

* Fixes spec failures for ES Group 1

* Adds specific test to ensure old elasticsearch does not index when it's not present

* Moves to new elasticsearch document indexing when old es is gone

* Fixes problem with helper method for specs

* Ensures app never attempts to reindex an old es index in the new es instance

* Makes it so that a user doesn't have to be present if use_new_search is 100% enabled

* Runs ES=1

* Runs ES=2

* Runs ES=3

* Runs ES=4

* Back to rspec

* Removes command to rebuild three times upon failure

* Updates set_rollout script to use global  variable

* Adds rollout definitions to test suite to see if that addresses Travis build problem

* Runs build with ES=1

* Runs all builds

* Adds same assurances to features as specs that ES will work w/ both versions

* Fixes imported image URL in feature spec

* Fixes reference to tire methods when tire is gone in feature support methods

* Runs only ES=4

* Moves es/rollout code for feature specs

* Fixes boolean representation in work search form

* Fixes boolean in ES search in bookmark search form

* Fixes bookmarks feature failures

* Fixes works_restricted feature failures

* Runs all four ES groups

* Runs ES=1 and ES=4

* Comments out test that's breaking due to third-party url bug

* Makes Travis only run 2 trials

1 - With the old Elasticsearch, in which we test that the old Elasticsearch
continues to work while start_new_indexing is true (individual tests also test
that the SearchForm classes continue to work as expected, meaning that the new
Elasticsearch also works in this case when use_new_search is true)

2 - With the new Elasticsearch

* Adds old exlclusion filter code

* Adds tests & code for work filtering with exclusion tags

* Addresses Travis test failures

* Adds bookmark exclusion filters

* Downgrades back to 5.6.1 (latest stable) ES version

* Adds single_mapping => true to ES indices

* Fixes failure to index bookmarks when they do not have a bookmarkable object

* Adds comments to help when removing old code

* Removes rollout manipulation from Travis

This was not actually setting features. All Travis needs to do is install one or
both versions of ES depending on the test group being run.

* Adds test cases for use_new_search? controller method

* Adds tests & fixes bugs for filtering

* Removes default 'true' from use_new_search method

Reverts old styles and scripts to master

* Fixes typos

* Fixes more typos

* Fixes rollout test for works controller

* Fixes works controller mistake

* Ports over ALL js and css changes that effect filters

* Removes useless method

* Removes file that has nothing to do with new search

* Fixes failing filter tests

* Pulls in fix for autocomplete bug from master

* AO3-4815: Fill out new batch indexing code

* Fixes merge clobbering of css & js files

* AO3-4815: Add new ES to codeship script and use local.yml instead of … (#3110)

* AO3-4815: Add new ES to codeship script and use local.yml instead of editing the regular config

* Fix ES download url and load local config when testing

* AO3-4815: Ensure correct results when browsing bookmarks by user (#3109)

* AO3-5213 Index authors on works correctly for sorting (#3114)

AO3-5213 Index authors on works correctly for sorting

* AO3-5207 Add StatCounterIndexer and fix order of reindexing. (#3111)

* AO3-5207 First go at StatCounter reindexing.

* AO3-5207 Add RSpec tests to make sure it works.

* AO3-5207 Small fixes to pass tests.

* AO3-5207 Make sure to call original when stubbing.

* AO3-5207 Finally fixed.

* AO3-5212 Index correct user ids for works. Also throw in a couple of updated work type tag ids (#3112)

* AO3-5209 Don't change the appearance of non-work & bookmark filters (#3117)

* AO3-5209 Use old JavaScript and views for old Elasticsearch filters (styling fixes to come)

* AO3-5209 Restyle old filters

* AO3-5209 Ensure new work and bookmark filter styling does not conflict with exisiting collection filter styles

* AO3-5216 Fix setting authenticity tokens when cached pages load (#3118)

This was the fix for AO3-5153, which got lost in a merge.

* AO3-5214 Only run the tests on Travis once for now (#3116)

* AO3-5208: Fix filtering behavior (#3113)

* AO3-5208: Fix filtering behavior by drilling down and setting facets appropriately.

* AO3-5208: Don't error when there are no filters

* AO3-5208: Ensure excluded tags are visible in filters

* AO3-5208: Make sure bookmark facet query knows about exclusions. Also don't index filters and other bookmarkable fields on the bookmark itself since that's what we're trying to avoid.

* AO3-5208: Dry up some tag-related query methods, reduce number of db requests, only exclude children of Character tags, and make exclusion work for bookmark tags again

* AO3-5208: Update some tests to match new behavior

* AO3-5208: Put excluded bookmark tags in the right filter bucket

* AO3-5208: Remove sub tag exclusion code, since the meta tag id is already indexed on works

* AO3-5208: Comment out tests for types of exclusion filtering we aren't currently doing for bookmarks

* AO3-5208: Enable querying on both parent and child bookmark fields and reflect queries in bookmark filters

* AO3-5208: Update tests for bookmark search syntax change and bookmarker indexing encompassing user name

* AO3-5208: Make 'other tags' filtering work for noncanonical tags as well

* AO3-5223: Fix id on bookmarks exclude field

* AO3-5208: Remove child exclusion from filters and enable inclusion for noncanonical tags

* AO3-5220 and AO3-5224: Fix searching bookmarks by notes and tag names and index bookmarkable date for sorting

* AO3-5220: Update old bookmark search code for notes fix, fix spacing in module

* AO3-5225 Fix sidebar counts and scope by user id if a user is present (#3119)

* AO3-5225: Fix sidebar counts and scope by user id if a user is present

* AO3-5225: Update user dashboard feature to check counts in multiple places

* AO3-5231: Fix formatting of search text and don't chop up tag searches

* AO3-5231: Remove duplication and add specs

* Upgrade elasticsearch version on travis

* Remove single type mapping which is no longer needed

* Update has_parent query syntax

* Update syntax for parent and child filters, which are now only supported as queries

* Update bookmark query spec to match new syntax

* Upgrade codeship

* AO3-5230 Fix range filters in bookmark search (#3184)

- Parse date updated and date bookmarked filters
- Unescape < and > characters
- Avoid re-escaping < and > characters in search summary
- Remove unused references to "bookmarkable_word_count"

* AO3-5254: Upgrade elasticsearch gem to 6.0.0 (#3187)

* AO3-5221: Bookmarkable indexing (#3186)

* AO3-4815 Update Elasticsearch and filter interface (#3104)

* Upgrades faraday (ran bundle update elasticsearch)

* Adds elasticsearch-model to directly replace tire model

Uses rollout to indicate which module to include in the searchable modules

* Allows application to connect to two ES instances

* Switches version of ES in use by Indexer and Query depending on rollout feature

* Fixes feature failure in importing

The image is rendered with https://, not http://

* Adds awesome_print gem, to make inspecting json easier

* Adds class to recreate indices in upgraded ES instance & reindex from remote

* Removes elasticsearch-model

* Removes rollout code from models

* WIP - Making app compatible with ES 5.5

* WIP - Pulls in elasticsearch overhaul code

Starting to debug elasticsearch overhaul code, both in its incompatibilities
with current ES and its underlying bugs.

* Gets search/works_anonymous feature specs to pass with new ES code

* Gets search/works_tags features to pass with new es code

* Fixes search/works_info spec failures

* Fixes test failures in search/work_stats

* Updates ES version read by Travis

* Updates ES instance to point to the url Travis will recognize

* Fixes some failing feature specs for search

* Fixes admins/admin_works specs

* Fixes bookmark_create and collection_dashboard feature specs

* Fixes importing/archivist feature specs

* Fixes other_a/orphan_work feature specs

Still using Tire, and reindexing with both Tire and elasticsearch will not break
anything and will be useful when running the test suite twice against the two
different ES versions

* Fixes all other other_a feature failures

* Fixes works_anonymous feature failures

* Fixes tag_wrangling_relationships feature failures

* Fixes users feature failures

* Fixes works feature failures

* Adds the new ES indexing code wherever Tire is use in test setup

* Fixes works default rails actions spec failures

* Fixes elasticsearch_upgrade_spec failures and refactors ES refresh code

* Fixes work query spec

* Adds some minor refactoring to tests

* Adds bookmark indexing/query code & fixes associated tests

* Updates BookmarkSearch references to BookmarkSearchForm

* Fixes bookmark_create feature failures

* Fixes admin/admin_works feature failures

* Fixes bookmarks feature spec failures

* Fixes collections feature specs

* Fixes other_a and search failures

* Fixes users feature specs

* Removes refrences to tire from tests and specs for now

* Fixes search steps problem when reindexing models with any? false

* Fixes reindexing models without any records in specs

* Removes outdated use of WorkSearch model in works controller

* Fixes typo

* Fixes failing specs caused by fixes to failing features

* Fixes bugs in bookmark query

* Some feature failure cleanup

* Adds code for Tag search using updated ES

* Adds pseud search code

* Small test fixes

* Fixes some failing tests, and attempts to address Travis issues

* Adds fixes for Travis failures that are repeatable locally

* Fixes problem where bookmarks without works can't be searched for

* Reindexes indexes everywhere they are updated in the features directory

This should remove inconsistent, nearly-unrepeatable errors caused by the fact
that Elasticsearch is asynchronous. Yay!

* Fixes bookmark query spec failure

* Refactors some of the index updating logic in features

* Fixes default rails actions for works spec

* Isolates Tire reindexing to one file in features

* Fixes tags and wrangling test failures

* Distinguishes ES versions in specs

* Fixes some typos

* Updates to catch old ES version no matter the environment

* Attempting a run with old ES version

* Fixes Tire import

* Fixes spec helper method

* Separates ES wrappers based on ES version in controllers

* Fixes use of new ES code in helpers for use_old_search?

* Fixes old ES code usage in bookmarks controller

* Fixes search using old ES for bookmarks

* Removes tests that were catching a bug that is no longer a problem

* Fixes works failures for old es version

* Fixes features failing on Travis

* Fixes spec failures for old ES version

* Sets Travis to dl new version of ES to see how build does

* Attempt with ES 6.0 alpha

* Adds fix for bookmark deletion bug

* Adds missing details to work indexer

* Adds rollout to indexing

* Swaps out 'use_old_search?' with 'use_new_search?'

* Fixes param names in tests

* Adds rollout to application record use_new_search? method

* Fixes small details & removes unused code

* Fixes typo

* Fixes typo

* Fixes typo

* Fixes lack of question mark for rollout.active? method

* Runs Travis build on old ES and sets elasticsearch version with rollout

* Fixes inccorect method invocation

* Fixes incorrect method invocation in people controller

* Fixes works stats feature failures

* Adds fixes for failing specs

* Uses appropriate count method for old es version

* Removes debug line from feature

* Upgrades nokogiri due to security concern

* Makes it so app will respond appropriately to ES version

To run on Travis, all three ES urls need to be the same:
ENV['ELASTICSEARCH_URL'] &
ENV['ELASTICSEARCH_1_URL'] &
ENV['UPGRADED_ELASTICSEARCH_URL']

All need to point to the same thing. Whenever running an instance of the app
with two versions of ES, ENV['ELASTICSEARCH_URL'] and ENV['ELASTICSEARCH_1_URL']
need to point to the old version and ENV['UPGRADED_ELASTICSEARCH_URL'] needs to
point to the new version.

* Second attempt with 6.0.0-alpha1 ES

* For test with ES 6.0.0-alpha1

* Fixes Travis run in 6.0.0-alpha1 ES

* Untar

* Try starting both

* Simple test run

* Differentiate the builds

* Differentiate the builds

* Restore all the tests

* Fixes call to new elasticsearch api perform_request

* Updates to test suite to watch how upgraded es version works on its own

* refactors out index updating methods in feature specs

* Adds rollout specs

* Fixes bug in work search form object

* Matches config to travis

* Removes all but rspec tests from travis for now

* Sets up tests & rollout methods use expected behavior

* Fixes switch from string to text or keyword for index definitions

* Updates index definitions to be compatible with 6.0.0.beta2 ES version

* Changes localhost to home IP for old ES urls

* Does not require old es to work when old es is gone

* Switches ES bool queries to true/false

* Fixes spec failures for ES Group 1

* Adds specific test to ensure old elasticsearch does not index when it's not present

* Moves to new elasticsearch document indexing when old es is gone

* Fixes problem with helper method for specs

* Ensures app never attempts to reindex an old es index in the new es instance

* Makes it so that a user doesn't have to be present if use_new_search is 100% enabled

* Runs ES=1

* Runs ES=2

* Runs ES=3

* Runs ES=4

* Back to rspec

* Removes command to rebuild three times upon failure

* Updates set_rollout script to use global  variable

* Adds rollout definitions to test suite to see if that addresses Travis build problem

* Runs build with ES=1

* Runs all builds

* Adds same assurances to features as specs that ES will work w/ both versions

* Fixes imported image URL in feature spec

* Fixes reference to tire methods when tire is gone in feature support methods

* Runs only ES=4

* Moves es/rollout code for feature specs

* Fixes boolean representation in work search form

* Fixes boolean in ES search in bookmark search form

* Fixes bookmarks feature failures

* Fixes works_restricted feature failures

* Runs all four ES groups

* Runs ES=1 and ES=4

* Comments out test that's breaking due to third-party url bug

* Makes Travis only run 2 trials

1 - With the old Elasticsearch, in which we test that the old Elasticsearch
continues to work while start_new_indexing is true (individual tests also test
that the SearchForm classes continue to work as expected, meaning that the new
Elasticsearch also works in this case when use_new_search is true)

2 - With the new Elasticsearch

* Adds old exlclusion filter code

* Adds tests & code for work filtering with exclusion tags

* Addresses Travis test failures

* Adds bookmark exclusion filters

* Downgrades back to 5.6.1 (latest stable) ES version

* Adds single_mapping => true to ES indices

* Fixes failure to index bookmarks when they do not have a bookmarkable object

* Adds comments to help when removing old code

* Removes rollout manipulation from Travis

This was not actually setting features. All Travis needs to do is install one or
both versions of ES depending on the test group being run.

* Adds test cases for use_new_search? controller method

* Adds tests & fixes bugs for filtering

* Removes default 'true' from use_new_search method

Reverts old styles and scripts to master

* Fixes typos

* Fixes more typos

* Fixes rollout test for works controller

* Fixes works controller mistake

* Ports over ALL js and css changes that effect filters

* Removes useless method

* Removes file that has nothing to do with new search

* Fixes failing filter tests

* Pulls in fix for autocomplete bug from master

* AO3-4815: Fill out new batch indexing code

* Fixes merge clobbering of css & js files

* AO3-4815: Add new ES to codeship script and use local.yml instead of … (#3110)

* AO3-4815: Add new ES to codeship script and use local.yml instead of editing the regular config

* Fix ES download url and load local config when testing

* AO3-4815: Ensure correct results when browsing bookmarks by user (#3109)

* AO3-5213 Index authors on works correctly for sorting (#3114)

AO3-5213 Index authors on works correctly for sorting

* AO3-5207 Add StatCounterIndexer and fix order of reindexing. (#3111)

* AO3-5207 First go at StatCounter reindexing.

* AO3-5207 Add RSpec tests to make sure it works.

* AO3-5207 Small fixes to pass tests.

* AO3-5207 Make sure to call original when stubbing.

* AO3-5207 Finally fixed.

* AO3-5212 Index correct user ids for works. Also throw in a couple of updated work type tag ids (#3112)

* AO3-5209 Don't change the appearance of non-work & bookmark filters (#3117)

* AO3-5209 Use old JavaScript and views for old Elasticsearch filters (styling fixes to come)

* AO3-5209 Restyle old filters

* AO3-5209 Ensure new work and bookmark filter styling does not conflict with exisiting collection filter styles

* AO3-5216 Fix setting authenticity tokens when cached pages load (#3118)

This was the fix for AO3-5153, which got lost in a merge.

* AO3-5214 Only run the tests on Travis once for now (#3116)

* AO3-5208: Fix filtering behavior (#3113)

* AO3-5208: Fix filtering behavior by drilling down and setting facets appropriately.

* AO3-5208: Don't error when there are no filters

* AO3-5208: Ensure excluded tags are visible in filters

* AO3-5208: Make sure bookmark facet query knows about exclusions. Also don't index filters and other bookmarkable fields on the bookmark itself since that's what we're trying to avoid.

* AO3-5208: Dry up some tag-related query methods, reduce number of db requests, only exclude children of Character tags, and make exclusion work for bookmark tags again

* AO3-5208: Update some tests to match new behavior

* AO3-5208: Put excluded bookmark tags in the right filter bucket

* AO3-5208: Remove sub tag exclusion code, since the meta tag id is already indexed on works

* AO3-5208: Comment out tests for types of exclusion filtering we aren't currently doing for bookmarks

* AO3-5208: Enable querying on both parent and child bookmark fields and reflect queries in bookmark filters

* AO3-5208: Update tests for bookmark search syntax change and bookmarker indexing encompassing user name

* AO3-5208: Make 'other tags' filtering work for noncanonical tags as well

* AO3-5223: Fix id on bookmarks exclude field

* AO3-5208: Remove child exclusion from filters and enable inclusion for noncanonical tags

* AO3-5220 and AO3-5224: Fix searching bookmarks by notes and tag names and index bookmarkable date for sorting

* AO3-5220: Update old bookmark search code for notes fix, fix spacing in module

* AO3-5225 Fix sidebar counts and scope by user id if a user is present (#3119)

* AO3-5225: Fix sidebar counts and scope by user id if a user is present

* AO3-5225: Update user dashboard feature to check counts in multiple places

* AO3-5221: Set up a pathway from bookmarked classes to our indexers

* AO3-5221: Fix code that got re-added on merge

* AO3-5221: Do a little method delegation

* AO3-5221: Make sure stat counter indexing still works

* AO3-5221: Update comments

* AO3-5222: Restore changes that got clobbered by merge

* Removes single_type mapping definition

* Fixes async indexer spec by changing mocked expectations

* AO3-5254: Fix bookmark search (#3188)

* AO3-5254: Upgrade elasticsearch gem to 6.0.0

* AO3-5254: Fix issue with parent key in child queries

* AO3-5280 Add co-creator names to co-creator emails (#3185)

* Add co-creator names to notification email

* Co-author email notifications

* AO3-5262: Move query cleaning out of the works controller (#3189)

* AO3-5262: Move query cleaning out of the works controller

* AO3-5262: Fine-tune category matching regex

* AO3-3576: Update tests for category escaping

* AO3-5229: Simple fix for ancient date errors (#3190)

* AO3-5229: Simple fix for ancient date errors

* AO3-5229: Extend fix to date ranges

* AO3-5265: Switch tag name search back to a query string to allow partial matching (#3196)

* AO3-5264: Set operator for bookmark search (#3195)

* AO3-5263: More filters! (#3194)

* Trying out new work filtering options

* Add new radio buttons to main search form

* Add help page for crossovers

* Fix spec

* AO3-5263 Front end adjustments for additional filter options

* AO3-5263 Update classes on bookmark filters

* AO3-5263 Wording change for work search crossover label

* AO3-5226: People Search (#3191)

* Update people search to include autocompletes and fandom filtering and strip out unused code for people index

* Fix pagination and remove duplicate ids

* AO3-5226: Use decorator to incorporate search results to save on lookups

* AO3-5226: Update pseud index for creations

* AO3-5226: Fix pseuds reference in work callback

* AO3-5226: Missed a collection test

* AO3-5226: Tidy up people page links

* AO3-5226: Reindex when other work visibility attributes change

* AO3-5226: Fine tune the general people query

* AO3-5226: Add to list of fields that should trigger pseud reindex, plus view tweaks

* AO3-5226: Remove colons from labels

* AO3-5273: Fix child queries for bookmark filter data (#3197)

* AO3-5274 Create visual distinction between exclusion and inclusion checkboxes (#3200)

* AO3-5274 Distinguish exclusion filters from inclusion filters

TODO: Update HTML of all other filter partials
TODO: Better styling for radio buttons

* AO3-5274 Update HTML of filter partials

* AO3-5274 Restyle checkboxes and radios for filters

* AO3-5274 Update radio styling

* AO3-5274 Use helper method for generating label contents

Also put the indicator in a separate span so it can be hidden from screen readers

* AO3-5274 Rename helper method

* AO3-5274 Tidy CSS and add focus style

* AO3-5274 HTML fixes for work filters

* AO3-5274 Adjust colors and add gradient fallbacks

* AO3-5274 Tweak CSS more

* AO3-5274 Remove style that was for a different experiment

* AO3-5269 Fix regex for getting sortable work authors (#3199)

* AO3-5269 Fix regex for getting sortable work authors

The hyphen should be escaped.

* AO3-5269 Move some tests to work_spec

* AO3-5269 Test pseuds starting with numbers and anonymous works

Improve spec names.
Avoid saving to the database.

* AO3-5277 Shrink "Show" button on collection Fandoms page (#3204)

* AO3-5277 Call the media selecting form on the collection Fandoms page something other than filters

* AO3-5277 Tidy fandom index

* AO3-5279 - Deleting bookmarks causes error in BookmarkIndexer. (#3201)

* AO3-5279 Don't call id on a nil object.

* AO3-5279 Missed one call to parent_id.

* Simplifies line in query_result class

* Fixes index sweeper/stat counter indexer interaction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants