aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix broken useflag search resultsv7.0.5dev/es-7.3Max Magorsch2019-10-151-5/+1
| | | | | | | | Whenever a search for a useflag leads to multiple search results the search currently fails. This commit fixes this bug. Signed-off-by: Max Magorsch <max@magorsch.de>
* Fix the broken feedsMax Magorsch2019-10-157-2/+56
| | | | | | | | | | | | | | Due to the migration to the repository pattern in elasticsearch-persistence the fields created_at and updated_at are no longer automatically parsed. That's why the feeds have been broken, as they rely on the parsed dates. To fix this problem, we manually parse the dates during the deserialization now. Fixes https://bugs.gentoo.org/697666 Signed-off-by: Max Magorsch <max@magorsch.de>
* Turn off dynamic mapping in all indexesv7.0.4Max Magorsch2019-10-076-6/+6
| | | | | | | | | | | By default, fields are added dynamically, whenever they are not present in the current mapping. However, we exactly specify the mapping, so we don't want any unexpected fields to be added to the index. That's why we use 'strict' here. This way we will get an exception every time an unexpected field is detected (which should not happen). Signed-off-by: Max Magorsch <max@magorsch.de>
* Add further mappings for the indexesMax Magorsch2019-10-074-2/+12
| | | | | | | | | | The mapping for maintainers field in the package index has been added. Furthermore, the commit field in the change index has been changed from object to keyword. However, currently, it is not used. It may be removed in future versions. Finally, missing id fields have been added to the mappings. Signed-off-by: Max Magorsch <max@magorsch.de>
* Remove dynamic field names from the packages indexMax Magorsch2019-10-075-17/+37
| | | | | | | | | | | | | | | | | | So far, dynamic field names have been used for useflags in the packages index. This leads to a large number of fields, which is continuously growing, as obsolete fields are not cleaned up from the mapping when the useflag is deleted. This way, the maximum limit of 50000 fields may be hit. To avoid this, the dynamic field names have been removed in favour of a simple list. This way it was possible to reduce the number of fields from nearly 50000 to 41. Please note: Due to the change of the mapping, the new index will no longer be compatible with the old one. A fresh index has to be populated. Signed-off-by: Max Magorsch <max@magorsch.de>
* Merge tag 'v7.0.2' into dev/es-7.3v7.0.3Robin H. Johnson2019-09-251-1/+6
|\ | | | | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
| * Fix in_docker check.v7.0.2Alec Warner2019-09-241-1/+6
| | | | | | | | | | | | When not in docker /proc/1/cgroup may not exist. Signed-off-by: Alec Warner <antarus@gentoo.org>
* | bin/update-all: handle non-cgroup kernelRobin H. Johnson2019-09-251-1/+1
|/ | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* bin/update-all: handle non-docker dev environmentv7.0.1Robin H. Johnson2019-09-211-1/+10
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* Add missing then.Alec Warner2019-09-171-1/+1
| | | | | | Thanks to grknight for pointing this out to me. Signed-off-by: Alec Warner <antarus@gentoo.org>
* Disable sync in production.Alec Warner2019-09-161-1/+3
| | | | | | | | This should allow RAILS_ENV=development to work for docker. In production the sync is handled by puppet and the user running update-all.sh doens't have permission to sync. Signed-off-by: Alec Warner <antarus@gentoo.org>
* Keep the footer at the bottom of the pagedev/rails-6Max Magorsch2019-09-071-0/+14
| | | | | | | | | | | | | | | Whenever the content of the page is taller than the viewport, the footer is currently kept correctly beneath the content. If, however, the content is too small to fill the viewport, the footer is displayed in the middle of the page. For instance, please note: - https://packages.gentoo.org/about - https://packages.gentoo.org/about/help - https://packages.gentoo.org/arches The introduced change keeps the footer at the bottom of the page no matter how tall the content is. Signed-off-by: Max Magorsch <max@magorsch.de>
* Fix a small bug to select the correct changelog entryMax Magorsch2019-09-061-1/+1
| | | | Signed-off-by: Max Magorsch <max@magorsch.de>
* Add an ES index containing the git commitsMax Magorsch2019-09-0611-39/+152
| | | | | | | | | | | | | | | | | So far, any history-related information has been fetched using git. That is, whenever a user requested any history-related information 'git log' was run and the output was parsed. That is time-consuming. Loading the page https://packages.gentoo.org/packages/keyworded takes around 120 seconds this way. Instead of doing so, any git commits are now added to an ES index and retrieved using ES. This way, the same page as mentioned before, loads in under 3 seconds. The commits for populating the index are fetched incrementally. This way, the first run may take some time, but afterwards, updates are fast. Signed-off-by: Max Magorsch <max@magorsch.de>
* Run the initialization scripts using docker-composefeature/es-7.3developMax Magorsch2019-09-057-12/+29
| | | | | | | | docker-compose can be used to deploy the application. The index will be initialized and updated. Furthermore a cron job will be registered for production environments to update the index every 10 minutes. ° Signed-off-by: Max Magorsch <max@magorsch.de>
* Use docker volumes for the portage treeMax Magorsch2019-09-052-1/+34
| | | | Signed-off-by: Max Magorsch <max@magorsch.de>
* Use ES 7.3 in the DockerfileMax Magorsch2019-09-052-3/+3
| | | | | | Furthermore dejavu 3.4.0 will be used. Signed-off-by: Max Magorsch <max@magorsch.de>
* Include a cron daemon into the dockerfileMax Magorsch2019-09-051-0/+1
| | | | Signed-off-by: Max Magorsch <max@magorsch.de>
* Include a kkuleomi_config into the docker image.Max Magorsch2019-09-051-0/+1
| | | | Signed-off-by: Max Magorsch <max@magorsch.de>
* Use bundler-1.17.3 in the Dockerfile nowMax Magorsch2019-09-051-1/+3
| | | | | | | The current Gemfile.lock has been bundled with bundler 1.17.3. That's why will use this version in the Dockerfile as well. Signed-off-by: Max Magorsch <max@magorsch.de>
* Update the runtime directory to /mnt/packages-treeMax Magorsch2019-09-051-1/+1
| | | | | | | | | So far /var/db/repos/gentoo has been used as PORT_DIR and as RUNTIME_PORTDIR. RUNTIME_PORTDIR will now by default point to /mnt/packages-tree/gentoo to match what is specified in the Dockerfile. Signed-off-by: Max Magorsch <max@magorsch.de>
* Migrate to ES 7.3 and the repository patternMax Magorsch2019-09-0544-505/+819
| | | | | | | | | | | | | | | | | | Elasticsearch-persistence is used as the persistence layer for Ruby domain objects in Elasticsearch in this application. So far, the ActiveRecord pattern has been used here. However, this pattern has been deprecated as of version 6 of the gem and was removed in version 7. That's why the application has been migrated to use the repository pattern instead. For further information, please see: https://www.elastic.co/blog/activerecord-to-repository-changing- persistence-patterns-with-the-elasticsearch-rails-gem Note: The old Elasticsearch index won't be compatible with this version anymore. That's why a fresh index should be populated. Signed-off-by: Max Magorsch <max@magorsch.de>
* Added docker-compose.override.yml for development purposesMax Magorsch2019-09-012-1/+95
| | | | | | | | | | | | | | | | | | | | | | | The newly added docker-compose.override.yml file overrides settings in docker-compose.yml for development purposes. In particular: - the source code will be mounted into the container for live reloading during the development - dejavu is used as gui for elasticsearch for debugging purposes - cors is enabled in elasticsearch for usage with dejavu These settings will automatically be used when executing: $ docker-compose up If you, however, don't want to use these settings (e.g. in production) use: $ docker-compose -f docker-compose.yml up For further information please refer to: https://docs.docker.com/compose/extends/#multiple-compose-files Signed-off-by: Max Magorsch <max@magorsch.de>
* Ensure that the rake version bundled in Gemfile.lock is usedMax Magorsch2019-08-311-1/+1
| | | | Signed-off-by: Max Magorsch <max@magorsch.de>
* Migrate gentoo portage location to default /var/db/repos/gentooMax Magorsch2019-08-312-3/+3
| | | | | | | | | | The default portage location has changed: https://wiki.gentoo.org/wiki//usr/portage and so has the location in the portage container: https://github.com/gentoo/gentoo-docker-images/commit/7c0dfcc Signed-off-by: Max Magorsch <max@magorsch.de>
* Fix eager loading in productionv6.0.25Hans de Graaff2019-07-251-0/+1
| | | | | | | | | Rails 5 no longer falls back to autoloading in the production environment by default, so all code needs to be eagerly loaded. Specificy that code in lib should also be included here, similar to autoload_paths. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Use sassc-rails instead of sass-railsHans de Graaff2019-07-242-13/+11
| | | | | | | sass is no longer maintained and is now deprecated. sassc is the recommended replacement and sassc-rails provides that to rails. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Run tests in script on travis and add rubocopv6.0.24Hans de Graaff2019-07-221-0/+3
| | | | | | | Run the tests in the script phase instead of before_script and include a rubocop step. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Update rubocop configurationHans de Graaff2019-07-224-6/+853
| | | | | | | | Include the new performance and rails cops. Add a rubocop todo file so that running rubocop now results in a clean run. Specific issues from the todo file can be removed at a later stage. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Use Ruby 2.4 as the lowest versionHans de Graaff2019-07-222-0/+4
| | | | | | | Include this in travis tests and add this as the lower boundary for rubocop. Ruby 2.4 is currently the stable ruby on Gentoo. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Update to Rails 5.2Hans de Graaff2019-07-2211-77/+99
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Update to Rails 5.1Hans de Graaff2019-07-229-56/+88
| | | | | | | | This also fixes a bug in the fresh_when handling for the changelog view, which was exposed by the update (due to ETag now taking the flash message, if any, into account). Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Add ETag and Last-Modified headers based on specific packageHans de Graaff2019-07-221-2/+2
| | | | | | https://guides.rubyonrails.org/caching_with_rails.html#conditional-get-support Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Set ETag and Last-Modified based on package infoHans de Graaff2019-07-221-0/+4
| | | | | | | This should avoid stale information being reported in the browser because an older, stale but cached, version is shown. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Fix deprecation of positional arguments in controller testsHans de Graaff2019-07-222-3/+3
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Run "rails app:update"Hans de Graaff2019-07-2211-58/+70
| | | | | | Merge all upstream changes for a new Rails 5.0 application. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Migrate to Rails 5.0Hans de Graaff2019-07-229-68/+87
| | | | | | | | | This commit contains all the recommended steps in the commit guide: https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-4-2-to-rails-5-0 It also updates the associated web-console dependency. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Pin jquery-rails and require new enough versionHans de Graaff2019-07-222-2/+2
| | | | | | | We need at least 4.3.5 to get jQuery 3.4.1 which fixes a security issue: https://blog.jquery.com/2019/04/10/jquery-3-4-0-released/ Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Update sdoc to a more modern versionHans de Graaff2019-07-222-7/+5
| | | | | | sdoc 1.x supports rdoc 5.x and newer. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Remove unused git dependencyHans de Graaff2019-07-222-3/+0
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Remove unused sinatra dependencyHans de Graaff2019-07-222-7/+1
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Remove unused ruby-progressbar dependencyHans de Graaff2019-07-222-3/+0
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Remove unused parallel package from GemfileHans de Graaff2019-07-222-3/+0
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Lock elasticsearch dependency to 5.xHans de Graaff2019-07-222-38/+36
| | | | | | | The 5.x series still supports the deprecated persistence pattern so we cannot update beyond that at the moment. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Use the fixture repo in the test environmentHans de Graaff2019-07-223-0/+5
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Add a package test fixture and fix USE flag testsHans de Graaff2019-07-227-3/+38
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Remove stubs for category search methodHans de Graaff2019-07-223-15/+2
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Provide a test fixture repo and use it for testsHans de Graaff2019-07-224-4/+16
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Remove category tests for unimplemented methodsHans de Graaff2019-07-221-27/+2
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* Set up the test index since these are used for testsHans de Graaff2019-07-221-1/+1
| | | | | | | | The tests expect the indices to have a "-test" extension since that is the test environment, so make sure to set this up in travis as well so that the test indices exists. Signed-off-by: Hans de Graaff <graaff@gentoo.org>