[obs-commits] [openSUSE/open-build-service] e2ac73: [api] Split Event::Build
Branch: refs/heads/master Home: https://github.com/openSUSE/open-build-service Commit: e2ac73b4b8ba995bd7eed8632690fe8d94277f04 https://github.com/openSUSE/open-build-service/commit/e2ac73b4b8ba995bd7eed8... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: M src/api/app/models/event/build.rb A src/api/app/models/event/build_fail.rb A src/api/app/models/event/build_success.rb A src/api/app/models/event/build_unchanged.rb Log Message: ----------- [api] Split Event::Build Have every `Event::Build` subclass in a different file, as it is normally done in Rails. Commit: 59c4fcb26cbb16de5708f3668b87ecfd460a7315 https://github.com/openSUSE/open-build-service/commit/59c4fcb26cbb16de5708f3... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: A src/api/app/models/event/branch_command.rb M src/api/app/models/event/comment.rb A src/api/app/models/event/comment_for_package.rb A src/api/app/models/event/commit.rb A src/api/app/models/event/create_package.rb A src/api/app/models/event/delete_package.rb M src/api/app/models/event/package.rb A src/api/app/models/event/service_fail.rb A src/api/app/models/event/service_success.rb A src/api/app/models/event/undelete_package.rb A src/api/app/models/event/update_package.rb A src/api/app/models/event/upload.rb A src/api/app/models/event/version_change.rb Log Message: ----------- [api] Split Event::Package Have every `Event::Package` subclass in a different file, as it is normally done in Rails. Commit: 48d46465946e667c6fee031c08b4dcf0b0c2b9b4 https://github.com/openSUSE/open-build-service/commit/48d46465946e667c6fee03... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: M src/api/app/models/event/comment.rb A src/api/app/models/event/comment_for_project.rb A src/api/app/models/event/create_project.rb A src/api/app/models/event/delete_project.rb M src/api/app/models/event/project.rb A src/api/app/models/event/undelete_project.rb A src/api/app/models/event/update_project.rb A src/api/app/models/event/update_project_config.rb Log Message: ----------- [api] Split Event::Project Have every `Event::Project` subclass in a different file, as it is normally done in Rails. Commit: d60d6b760b8fed9c767880e30a169cf3b76f12a1 https://github.com/openSUSE/open-build-service/commit/d60d6b760b8fed9c767880... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: M src/api/app/models/event/comment.rb A src/api/app/models/event/comment_for_request.rb M src/api/app/models/event/request.rb A src/api/app/models/event/request_change.rb A src/api/app/models/event/request_create.rb A src/api/app/models/event/request_delete.rb A src/api/app/models/event/request_statechange.rb A src/api/app/models/event/review_wanted.rb Log Message: ----------- [api] Split Event::Request Have every `Event::Request` subclass in a different file, as it is normally done in Rails. Commit: cdfe0e101d64f248b0d035503336ff49ada8e51b https://github.com/openSUSE/open-build-service/commit/cdfe0e101d64f248b0d035... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: M src/api/app/controllers/request_controller.rb M src/api/app/models/event.rb R src/api/app/models/event/all.rb Log Message: ----------- [api] Remove inclusion for Event subclases Now that all the classes follow Rails name convention, we do not need to include the files one by one. Remove also the `require_dependency 'event/all'` in `request_controller`. Commit: bfdf2c5946889134bf539e45bb19c4137d28e89c https://github.com/openSUSE/open-build-service/commit/bfdf2c5946889134bf539e... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: M src/api/app/models/event/factory.rb Log Message: ----------- [api] Remove ghost comment This comment was introduced in: https://github.com/openSUSE/open-build-service/commit/6589e1625b7b01ed63e4fe... But the code it is commenting was removed in: https://github.com/openSUSE/open-build-service/commit/20740ef3554376745499e8... But the comment was not removed. Commit: 79ace9551b4d64881596ffc59fb63d0c9299a56c https://github.com/openSUSE/open-build-service/commit/79ace9551b4d64881596ff... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: M src/api/app/controllers/source_controller.rb M src/api/app/controllers/webui/user_controller.rb M src/api/app/models/bs_request.rb M src/api/app/models/comment.rb M src/api/app/models/update_notification_events.rb M src/api/config/clock.rb M src/api/test/models/event_test.rb Log Message: ----------- [api] Remove all require event As Event module is now structure in a Rails way the requires are not longer needed. Commit: f26400814482646feff7ce02a8a5f91de3238055 https://github.com/openSUSE/open-build-service/commit/f26400814482646feff7ce... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: M .rubocop_todo.yml Log Message: ----------- [ci] Regenerate Rubocop todo file When moving the code into different classes the exclusion in the `rubocop_todo.yml` doesn't have effect any more. Also, we had an inclussion of a helper outside a class/module. Rubocop was not complainning before due to a bug, that is already fixed in master and will be in the next release. Regenerating the todo file solve this as well. As we need to solve this in more places, it seems to be fine to exclude it by now. Commit: e41bd74e329aaab02563518cb4b7dc57f1dffa65 https://github.com/openSUSE/open-build-service/commit/e41bd74e329aaab0256351... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: R src/api/app/models/event/comment.rb A src/api/app/models/event/comment_event.rb Log Message: ----------- [api] Include CommentEvent in the Event module To allow that the classes which includes it can find it, as now we do things in the Rails way. Commit: c46bb892aa994acb8e5809a454ce08948081d9a2 https://github.com/openSUSE/open-build-service/commit/c46bb892aa994acb8e5809... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: M src/api/app/models/event/comment_for_package.rb M src/api/app/models/event/comment_for_project.rb M src/api/app/models/event/comment_for_request.rb Log Message: ----------- [api] Do not use shortcut for Comment clases Using `Event::Class` oblies us to include `CommentEvent` with an explicit namespace qualifier (`Event::CommentEvent`), because Ruby will not look inside `Event` for this name. Commit: 678410a14a0f19738928f4288f95460496ee35cb https://github.com/openSUSE/open-build-service/commit/678410a14a0f19738928f4... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: M src/api/app/models/event/build.rb M src/api/app/models/event/build_fail.rb M src/api/app/models/event/build_success.rb M src/api/app/models/event/build_unchanged.rb M src/api/app/models/event/packtrack.rb M src/api/app/models/event/repo_publish_state.rb M src/api/app/models/event/repo_published.rb M src/api/app/models/event/request.rb M src/api/app/models/event/request_change.rb M src/api/app/models/event/request_create.rb M src/api/app/models/event/request_delete.rb M src/api/app/models/event/request_statechange.rb M src/api/app/models/event/review_wanted.rb Log Message: ----------- [api] Do not use shortcut for classes definitions For consistency with the rest classes of the `Event` module. Commit: ea0a7d664584000eee1cf6532a8ba6f313e84ea9 https://github.com/openSUSE/open-build-service/commit/ea0a7d664584000eee1cf6... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: M src/api/app/models/event/branch_command.rb M src/api/app/models/event/build_fail.rb M src/api/app/models/event/build_success.rb M src/api/app/models/event/build_unchanged.rb M src/api/app/models/event/comment_for_package.rb M src/api/app/models/event/comment_for_project.rb M src/api/app/models/event/comment_for_request.rb M src/api/app/models/event/commit.rb M src/api/app/models/event/create_package.rb M src/api/app/models/event/create_project.rb M src/api/app/models/event/delete_package.rb M src/api/app/models/event/delete_project.rb M src/api/app/models/event/package.rb M src/api/app/models/event/project.rb M src/api/app/models/event/request_change.rb M src/api/app/models/event/request_create.rb M src/api/app/models/event/request_delete.rb M src/api/app/models/event/request_statechange.rb M src/api/app/models/event/service_fail.rb M src/api/app/models/event/service_success.rb M src/api/app/models/event/undelete_package.rb M src/api/app/models/event/undelete_project.rb M src/api/app/models/event/update_package.rb M src/api/app/models/event/update_project.rb M src/api/app/models/event/update_project_config.rb M src/api/app/models/event/upload.rb M src/api/app/models/event/version_change.rb Log Message: ----------- [api] Add schema information for all new classes And now that we are following Rails way, they are correct! Commit: ee7a10972628377e4827ce0f449cb52a3ec11967 https://github.com/openSUSE/open-build-service/commit/ee7a10972628377e4827ce... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: M src/api/app/models/event/branch_command.rb M src/api/app/models/event/build.rb M src/api/app/models/event/comment_for_package.rb M src/api/app/models/event/commit.rb M src/api/app/models/event/create_package.rb M src/api/app/models/event/delete_package.rb R src/api/app/models/event/package.rb M src/api/app/models/event/service_fail.rb M src/api/app/models/event/service_success.rb M src/api/app/models/event/undelete_package.rb M src/api/app/models/event/update_package.rb M src/api/app/models/event/upload.rb M src/api/app/models/event/version_change.rb Log Message: ----------- [api] Remove Event::Package `Event::Package` is a class with almost nothing that is used as superclass for: - `Event::BranchCommand` - `Event::Build` - `Event::CommentForPackage` - `Event::Commit` - `Event::CreatePackage` - `Event::DeletePackage` - `Event::ServiceFail` - `Event::ServiceSuccess` - `Event::UndeletePackage` - `Event::UpdatePackage` - `Event::Upload` - `Event::VersionChange` The `Event::Package` causes problem as we also have a `Package` model in the root level. So once one of the two packages models is loaded, Rails doens't look for the second one, which lead to uses of the wrong model. To avoid that Rails uses the `Package` in the root level in `Event::Package` subclasses we can call the Package specifying the module. But for the other case there is nothing we can do. This is all caused because we shouldn't have models with repeated names even if they are in different levels. As the `Event::Package` is useless, we can just remove it and add its data directly to the subclasses. Commit: a571bb9b3dbab4a9890174f6f554202f2f04928b https://github.com/openSUSE/open-build-service/commit/a571bb9b3dbab4a9890174... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-06 (Wed, 06 Dec 2017) Changed paths: M src/api/app/models/event/comment_for_project.rb M src/api/app/models/event/create_project.rb M src/api/app/models/event/delete_project.rb R src/api/app/models/event/project.rb M src/api/app/models/event/undelete_project.rb M src/api/app/models/event/update_project.rb M src/api/app/models/event/update_project_config.rb Log Message: ----------- [api] Remove Event::Project `Event::Package` is a class with almost nothing that is used as superclass for: - `Event::CommentForProject` - `Event::CreateProject` - `Event::DeleteProject` - `Event::UndeleteProject` - `Event::UpdateProjectConfig` - `Event::UpdateProject` The `Event::Project` causes problem as we also have a `Project` model in the root level. So once one of the two projects models is loaded, Rails doens't look for the second one, which lead to uses of the wrong model. To avoid that Rails uses the `Project` in the root level in `Event::Project` subclasses we can call the Project specifying the module. But for the other case there is nothing we can do. This is all caused because we shouldn't have models with repeated names even if they are in different levels. As the `Event::Project` is useless, we can just remove it and add its data directly to the subclasses. Commit: 10a9af1725728181f2d2509529b957ff674a84df https://github.com/openSUSE/open-build-service/commit/10a9af1725728181f2d250... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-07 (Thu, 07 Dec 2017) Changed paths: M src/api/app/jobs/project_log_rotate_job.rb M src/api/script/delayed_job_stats.rb Log Message: ----------- [ci] Do not use Event::Project & Package in job I could have assigned the classes array to event_classes, but as the `flat_map(&:descendants)` is no longer needed in ``` event_classes.flat_map(&:descendants).map(&:name) ``` having an array with the name Strings directly seems to be better. Commit: 4e6efd8ae49969a1aa3008a97cd2b5dbecefd171 https://github.com/openSUSE/open-build-service/commit/4e6efd8ae49969a1aa3008... Author: Henne Vogelsang <hvogel@opensuse.org> Date: 2017-12-07 (Thu, 07 Dec 2017) Changed paths: M .rubocop_todo.yml M src/api/app/controllers/request_controller.rb M src/api/app/controllers/source_controller.rb M src/api/app/controllers/webui/user_controller.rb M src/api/app/jobs/project_log_rotate_job.rb M src/api/app/models/bs_request.rb M src/api/app/models/comment.rb M src/api/app/models/event.rb R src/api/app/models/event/all.rb A src/api/app/models/event/branch_command.rb M src/api/app/models/event/build.rb A src/api/app/models/event/build_fail.rb A src/api/app/models/event/build_success.rb A src/api/app/models/event/build_unchanged.rb R src/api/app/models/event/comment.rb A src/api/app/models/event/comment_event.rb A src/api/app/models/event/comment_for_package.rb A src/api/app/models/event/comment_for_project.rb A src/api/app/models/event/comment_for_request.rb A src/api/app/models/event/commit.rb A src/api/app/models/event/create_package.rb A src/api/app/models/event/create_project.rb A src/api/app/models/event/delete_package.rb A src/api/app/models/event/delete_project.rb M src/api/app/models/event/factory.rb R src/api/app/models/event/package.rb M src/api/app/models/event/packtrack.rb R src/api/app/models/event/project.rb M src/api/app/models/event/repo_publish_state.rb M src/api/app/models/event/repo_published.rb M src/api/app/models/event/request.rb A src/api/app/models/event/request_change.rb A src/api/app/models/event/request_create.rb A src/api/app/models/event/request_delete.rb A src/api/app/models/event/request_statechange.rb A src/api/app/models/event/review_wanted.rb A src/api/app/models/event/service_fail.rb A src/api/app/models/event/service_success.rb A src/api/app/models/event/undelete_package.rb A src/api/app/models/event/undelete_project.rb A src/api/app/models/event/update_package.rb A src/api/app/models/event/update_project.rb A src/api/app/models/event/update_project_config.rb A src/api/app/models/event/upload.rb A src/api/app/models/event/version_change.rb M src/api/app/models/update_notification_events.rb M src/api/config/clock.rb M src/api/script/delayed_job_stats.rb M src/api/test/models/event_test.rb Log Message: ----------- Merge pull request #4191 from Ana06/refactor_event Refactor Event module Compare: https://github.com/openSUSE/open-build-service/compare/2e615f4011e6...4e6efd...
participants (1)
-
Henne Vogelsang