[openSUSE/open-build-service] e031ec: Re-introduce the skip of the validate_params callback
Branch: refs/heads/workflow_token Home: https://github.com/openSUSE/open-build-service Commit: e031ec5887d91c3073dda4c52ffd31f30706bd16 https://github.com/openSUSE/open-build-service/commit/e031ec5887d91c3073dda4... Author: Saray Cabrera Padrón <scabrerapadron@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/controllers/trigger_controller.rb Log Message: ----------- Re-introduce the skip of the validate_params callback GitLab sends data as parameters which are not strings, like the project hash. That validation would prevent us to receive webhooks from GitLab. Co-authored-by: Eduardo Navarro <enavarro@suse.com> Commit: 7b8f6697c31e968e60c26f6dd6cabb4feb5ca405 https://github.com/openSUSE/open-build-service/commit/7b8f6697c31e968e60c26f... Author: Saray Cabrera Padrón <scabrerapadron@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/models/token.rb A src/api/app/models/token/workflow.rb A src/api/app/policies/token/workflow_policy.rb M src/api/config/routes/api_routes.rb Log Message: ----------- Define the new Token::Workflow This token will handle the incoming webhooks/events from SCMs like GitHub or GitLab. Co-authored-by: Eduardo Navarro <enavarro@suse.com> Commit: 1278bef466a4bca57721e3fc3d7e85176113b90a https://github.com/openSUSE/open-build-service/commit/1278bef466a4bca57721e3... Author: Saray Cabrera Padrón <scabrerapadron@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/controllers/trigger_controller.rb A src/api/app/controllers/trigger_workflow_controller.rb M src/api/app/models/token/rebuild.rb M src/api/app/models/token/workflow.rb A src/api/app/services/trigger_controller_service/scm_extractor.rb M src/api/config/routes/api_routes.rb Log Message: ----------- Extract data from a incoming SCM's webhook This kind of webhooks trigger the new Token::Workflow. They come from SCMs like GitHub or GitLab. We extract the data from the payload of the incoming webhook/event, then check that the event and data are valid, and add it to the token as attributes. We create a new controller with the behaviour of the token workflow. Co-authored-by: Daniel Donisa <daniel.donisa@suse.com> Co-authored-by: Eduardo Navarro <enavarro@suse.com> Commit: 253e0a6ad36e8b706c9da222154d649d7b1b9f91 https://github.com/openSUSE/open-build-service/commit/253e0a6ad36e8b706c9da2... Author: Lukas Krause <lkrause@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: A src/api/app/models/workflow.rb A src/api/app/models/workflow/step/branch_package_step.rb Log Message: ----------- Create wrapper model for SCM workflows Commit: ff6552f4722ba20826132f064bf4e712c97bd545 https://github.com/openSUSE/open-build-service/commit/ff6552f4722ba20826132f... Author: Lukas Krause <lkrause@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/Gemfile M src/api/Gemfile.lock Log Message: ----------- Add Down gem to gemfile The gem helps us to download the yaml file with the workflow instructions from github and gitlab. Many things that would require a lot of custom code, like limiting the download size are done by the gem. Commit: e600f9da47e94f6a4b67884c56b72c9c36ba4235 https://github.com/openSUSE/open-build-service/commit/e600f9da47e94f6a4b6788... Author: Lukas Krause <lkrause@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: A src/api/app/services/workflows/yaml_download_service.rb A src/api/app/services/workflows/yaml_to_workflows_service.rb M src/api/config/initializers/zeitwerk.rb Log Message: ----------- Add services to download and parse workflow yaml Commit: 5e963b46e0588a26876da1a6a1eef7e354d9e125 https://github.com/openSUSE/open-build-service/commit/5e963b46e0588a26876da1... Author: Dany Marcoux <dmarcoux@posteo.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/models/event_subscription.rb A src/api/db/migrate/20210428112249_add_token_id_to_event_subscriptions.rb M src/api/db/schema.rb Log Message: ----------- Add token_id column to event_subscriptions table Commit: a16facc35fc87b59bbf0d283655b97e6076e21da https://github.com/openSUSE/open-build-service/commit/a16facc35fc87b59bbf0d2... Author: Dany Marcoux <dmarcoux@posteo.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/Gemfile M src/api/Gemfile.lock Log Message: ----------- Add octokit to Gemfile Commit: 9a90104a7dea16e051ea17620b6c10b492b1a5f9 https://github.com/openSUSE/open-build-service/commit/9a90104a7dea16e051ea17... Author: Dany Marcoux <dmarcoux@posteo.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/models/event_subscription.rb M src/api/app/models/token.rb Log Message: ----------- Setup associations for the event_subscriptions.token_id column Commit: 5f6be8d86952d0aa7f2399197effbbc79b4880e6 https://github.com/openSUSE/open-build-service/commit/5f6be8d86952d0aa7f2399... Author: Dany Marcoux <dmarcoux@posteo.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/models/token.rb M src/api/app/models/token/rebuild.rb M src/api/app/models/token/release.rb M src/api/app/models/token/rss.rb M src/api/app/models/token/service.rb A src/api/db/migrate/20210428122525_add_scm_token_to_tokens.rb M src/api/db/schema.rb Log Message: ----------- Add scm_token column to tokens table Commit: 3901e75ce8be22bf90bcd58dbbb26e01233b98d9 https://github.com/openSUSE/open-build-service/commit/3901e75ce8be22bf90bcd5... Author: Dany Marcoux <dmarcoux@posteo.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/models/event_subscription.rb A src/api/db/migrate/20210428132708_add_payload_to_event_subscriptions.rb M src/api/db/schema.rb Log Message: ----------- Add payload column to event_subscriptions table Commit: 13a5cde837bd423dc7e43ad4032ffd0c3ffed15f https://github.com/openSUSE/open-build-service/commit/13a5cde837bd423dc7e43a... Author: Dany Marcoux <dmarcoux@posteo.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/controllers/person/token_controller.rb M src/api/spec/controllers/person/token_controller_spec.rb Log Message: ----------- Add support for token.scm_token in POST /person/<login>/token Commit: a98d8dfd06dbcd8b84fc5db135ed418095fac806 https://github.com/openSUSE/open-build-service/commit/a98d8dfd06dbcd8b84fc5d... Author: Dany Marcoux <dmarcoux@posteo.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/Gemfile M src/api/Gemfile.lock Log Message: ----------- Add gitlab to Gemfile Commit: 5b99cfd998b3a53c1efdfcf376548084bc8a4317 https://github.com/openSUSE/open-build-service/commit/5b99cfd998b3a53c1efdfc... Author: Dany Marcoux <dmarcoux@posteo.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/controllers/trigger_controller.rb A src/api/app/jobs/report_to_scm_job.rb M src/api/app/models/event_subscription.rb M src/api/app/models/token/rebuild.rb A src/api/app/services/scm_status_reporter.rb M src/api/config/initializers/zeitwerk.rb Log Message: ----------- Create SCMStatusReporter service Commit: 0413d6202f2cd7d64f6b0d81a1e14c1ed88c94fd https://github.com/openSUSE/open-build-service/commit/0413d6202f2cd7d64f6b0d... Author: Victor Pereira <vpereira@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/models/token/rebuild.rb M src/api/app/models/token/workflow.rb Log Message: ----------- Move code from Token::Rebuild to Token::Workflow Commit: 703e5072bcce5431f3e6d1f5c2b58f2845745522 https://github.com/openSUSE/open-build-service/commit/703e5072bcce5431f3e6d1... Author: Eduardo Navarro <enavarro@suse.com> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/models/token/workflow.rb M src/api/app/services/trigger_controller_service/scm_extractor.rb M src/api/app/services/workflows/yaml_download_service.rb Log Message: ----------- Implement download of the workflows configuration ... ... file, both for GitHub and GitLab. Co-authored-by: Saray Cabrera Padrón <scabrerapadron@suse.de> Commit: 6cde0bd2a3ba2bc8375f740a317e622d25b5ab2a https://github.com/openSUSE/open-build-service/commit/6cde0bd2a3ba2bc8375f74... Author: Victor Pereira <vpereira@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/models/token/workflow.rb Log Message: ----------- call ScmExtractor with full-path Commit: d0ef4db06e9ae63e23af35e4dd3b8e3313e12983 https://github.com/openSUSE/open-build-service/commit/d0ef4db06e9ae63e23af35... Author: Dani Donisa <dani.doni@gmail.com> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/controllers/trigger_controller.rb Log Message: ----------- Fix missing method Commit: e3ae3631a91a2d8b2a69d619ddf27f28adf55a63 https://github.com/openSUSE/open-build-service/commit/e3ae3631a91a2d8b2a69d6... Author: Lukas Krause <lkrause@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/models/workflow/step/branch_package_step.rb Log Message: ----------- Reduce cognitive complexity of branch method Commit: a53e8006f11a5d41c6f1bb1180bc458b65755faa https://github.com/openSUSE/open-build-service/commit/a53e8006f11a5d41c6f1bb... Author: Saray Cabrera Padrón <scabrerapadron@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/models/token/workflow.rb M src/api/app/policies/token/workflow_policy.rb M src/api/app/services/trigger_controller_service/scm_extractor.rb Log Message: ----------- Fix policy and extractor Also rename `extract` method to `call` and sort the pseudocode on Token#call. Co-authored-by: Eduardo Navarro <enavarro@suse.com> Commit: 53675cc926c5b7dcbf9a2a63831e947ed20f3918 https://github.com/openSUSE/open-build-service/commit/53675cc926c5b7dcbf9a2a... Author: Victor Pereira <vpereira@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/controllers/trigger_workflow_controller.rb Log Message: ----------- Do not use set_package on TriggerWorkflowController Commit: e54e64fbad98e44861195ddd337a89139c307526 https://github.com/openSUSE/open-build-service/commit/e54e64fbad98e44861195d... Author: Victor Pereira <vpereira@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/models/token/workflow.rb M src/api/app/services/scm_status_reporter.rb Log Message: ----------- WIP: Token Workflow Commit: b2b88adc5a0b4996bb1a158e0096d78ba25d4ec8 https://github.com/openSUSE/open-build-service/commit/b2b88adc5a0b4996bb1a15... Author: Saray Cabrera Padrón <scabrerapadron@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/services/scm_status_reporter.rb Log Message: ----------- Reduce complexity of ScmStatusReporter#initialize Attending to Code Climate complains. Co-authored-by: Eduardo Navarro <enavarro@suse.com> Commit: c02d7b740329fc5a255220a093c8903118ae7a30 https://github.com/openSUSE/open-build-service/commit/c02d7b740329fc5a255220... Author: Saray Cabrera Padrón <scabrerapadron@suse.de> Date: 2021-05-03 (Mon, 03 May 2021) Changed paths: M src/api/app/controllers/trigger_workflow_controller.rb M src/api/app/models/token/workflow.rb M src/api/app/services/trigger_controller_service/scm_extractor.rb Log Message: ----------- Add little improvements - Drop unnecessary curly brackets from method parameters. - Don't assign to variable values that are going to be used only once. - Add .with_indifferent_access to SCMExtractor resulting payload. - Adjust comments. - Rename 'accepted*_event_and_action' to 'allowed*_event_and_action' to be consistent with the constant names (ALLOWED_GITHUB_ACTIONS, ALLOWED_GITLAB_ACTIONS). Compare: https://github.com/openSUSE/open-build-service/compare/23d9fd950e8d...c02d7b...
participants (1)
-
Saray Cabrera Padrón