[obs-commits] [openSUSE/open-build-service] b2703a: Switch to Thinking::Sphinx real-time indices
Branch: refs/heads/master Home: https://github.com/openSUSE/open-build-service Commit: b2703afdbb385e1526085d6e045a0cb119420698 https://github.com/openSUSE/open-build-service/commit/b2703afdbb385e1526085d... Author: Saray Cabrera Padrón <scabrerapadron@suse.de> Date: 2019-10-24 (Thu, 24 Oct 2019) Changed paths: M ReleaseNotes-2.11 M src/api/.rubocop_todo.yml M src/api/app/indices/package_index.rb M src/api/app/indices/project_index.rb A src/api/app/mixins/package_sphinx.rb A src/api/app/mixins/populate_sphinx.rb A src/api/app/mixins/project_sphinx.rb M src/api/app/models/attrib.rb M src/api/app/models/package.rb M src/api/app/models/package_issue.rb M src/api/app/models/project.rb M src/api/config/clock.rb Log Message: ----------- Switch to Thinking::Sphinx real-time indices Instead of reindexing every hour with SQL-backed indices, we now use real-time indices. That allows us to get results when searching by just created or updated projects or packages. Real-time indices require references to models' methods when defining attributes. For this reason, it was needed to add methods like `attribs_attrib_type_ids`, `packages_package_issues_ids` or `devel_packages?` for both package and project indices. Real-time indices are updated with callbacks, so we don't need an external process for updating indices. Temporarily, the entry in the `config/clock.rb` file for updating the indices is commented. The search can also be done by attributes and issues. Therefore, when attributes or issues are created/updated, an update of the indices is done through callbacks. Also, every time an issue of a package is updated, both indices of the package and its related project are updated. All the other attributes of the indices are used for sorting the results. For now the indices are not going to be updated when the values of these attributes change. It was fixed the way the `activity_index` is obtained for a project. Before it took the maximum `activity_index` value of its packages that had the oldest `updated_at` value. Now it takes the maximum `activity_index` value of its packages that have the more recent `updated_at` value. Co-authored-by: David Kang <dkang@suse.com> Co-authored-by: Eduardo Navarro <enavarro@suse.com> Commit: a72abf963e601a712f97632c5af451ca66c03d02 https://github.com/openSUSE/open-build-service/commit/a72abf963e601a712f9763... Author: Saray Cabrera Padrón <scabrerapadron@suse.de> Date: 2019-10-24 (Thu, 24 Oct 2019) Changed paths: M src/api/spec/factories/attribs.rb Log Message: ----------- Fix attrib factory with packages In the attrib factory there was an `after(:create)` clause, that in case of having a package attribute never got saved. Using a `before(:create)` clause instead, the attribute gets saved. Co-authored-by: David Kang <dkang@suse.com> Co-authored-by: Eduardo Navarro <enavarro@suse.com> Commit: 4c744748f3f59b8261ef3117ebb1754cdeca366f https://github.com/openSUSE/open-build-service/commit/4c744748f3f59b8261ef31... Author: Saray Cabrera Padrón <scabrerapadron@suse.de> Date: 2019-10-24 (Thu, 24 Oct 2019) Changed paths: M src/api/config/thinking_sphinx.yml.example M src/api/lib/tasks/dev.rake M src/api/spec/features/webui/search_spec.rb A src/api/spec/models/full_text_search_spec.rb M src/api/spec/rails_helper.rb R src/api/spec/sphinx_helper.rb M src/api/spec/support/database_cleaner.rb M src/api/spec/support/thinking_sphinx.rb Log Message: ----------- Adapt rspec tests for real-time Sphinx indices Spec configuration has been adapted in order to start and stop a test Sphinx daemon before and after running search tests. The default DatabaseCleaner strategy is `transaction`. We added a condition to make Sphinx tests make use of the `truncation` strategy instead. That way the indices are correctly cleaned up between each example. Co-authored-by: David Kang <dkang@suse.com> Co-authored-by: Eduardo Navarro <enavarro@suse.com> Commit: 6df610562c7b7d301739c32a2c2dd75638452007 https://github.com/openSUSE/open-build-service/commit/6df610562c7b7d301739c3... Author: Saray Cabrera Padrón <scabrerapadron@suse.de> Date: 2019-10-24 (Thu, 24 Oct 2019) Changed paths: R src/api/lib/obsapi/test_sphinx.rb R src/api/test/models/full_text_search_test.rb M src/api/test/test_helper.rb Log Message: ----------- Remove minitest that use Sphinx These tests are now migrated to the rspec suite, after Sphinx SQL-backed indices were replaced by real-time indices. Co-authored-by: David Kang <dkang@suse.com> Co-authored-by: Eduardo Navarro <enavarro@suse.com> Commit: e40a3ca096b946f72968eedf81182b742a733cbb https://github.com/openSUSE/open-build-service/commit/e40a3ca096b946f72968ee... Author: Eduardo Navarro <enavarro@suse.com> Date: 2019-10-24 (Thu, 24 Oct 2019) Changed paths: M src/api/Procfile Log Message: ----------- Adjust Procfile to work with real-time indices When `ts:rebuild` is called in the development environment to start the Sphinx daemon, it never reaches `ts:rt:index` because `ts:start` runs with `NODETACH=true` and takes the control of the console, so it never returns. The hack was to add code in Procfile to run in paralell a process that after a while (time needed for the Sphinx daemon to start) builds the real-time indices. Co-authored-by: Saray Cabrera Padrón <scabrerapadron@suse.de> Commit: be437c9d52ff530afc905fc18d1bdf2c0d206eeb https://github.com/openSUSE/open-build-service/commit/be437c9d52ff530afc905f... Author: Henne Vogelsang <hvogel@opensuse.org> Date: 2019-10-25 (Fri, 25 Oct 2019) Changed paths: M ReleaseNotes-2.11 M src/api/.rubocop_todo.yml M src/api/Procfile M src/api/app/indices/package_index.rb M src/api/app/indices/project_index.rb A src/api/app/mixins/package_sphinx.rb A src/api/app/mixins/populate_sphinx.rb A src/api/app/mixins/project_sphinx.rb M src/api/app/models/attrib.rb M src/api/app/models/package.rb M src/api/app/models/package_issue.rb M src/api/app/models/project.rb M src/api/config/clock.rb M src/api/config/thinking_sphinx.yml.example R src/api/lib/obsapi/test_sphinx.rb M src/api/lib/tasks/dev.rake M src/api/spec/factories/attribs.rb M src/api/spec/features/webui/search_spec.rb A src/api/spec/models/full_text_search_spec.rb M src/api/spec/rails_helper.rb R src/api/spec/sphinx_helper.rb M src/api/spec/support/database_cleaner.rb M src/api/spec/support/thinking_sphinx.rb R src/api/test/models/full_text_search_test.rb M src/api/test/test_helper.rb Log Message: ----------- Merge pull request #8558 from eduardoj/fix_8541_improve_indexing Switch to Thinking::Sphinx real-time indexes Compare: https://github.com/openSUSE/open-build-service/compare/8b6367de5936...be437c...
participants (1)
-
Henne Vogelsang