Skip to content

Upgrade `kas-grpc` gem for git push events

Timo Furrer requested to merge kas-client-git-push-event into master

What does this MR do and why?

This change set upgrades kas-grpc gem to 0.1.0 and implements the git_push_event gRPC client method in Kas::Client. Which in a follow-up will be used to send git push events to Kas.

Part of Hook into GitLab's internal/post_receive notifi... (gitlab-org/cluster-integration/gitlab-agent#43 - closed)

The kas-grpc upgrade is backwards compatible and contains the following changes: https://my.diffend.io/gems/kas-grpc/0.0.2/0.1.0

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

  1. Use latest gitlab-agent (KAS) from master in GDK
  2. Configure a project with an agent and configure the gitops module for that project and agent
  3. In gdk rails console you can initialize the client and send the request.
[1] pry(main)> client = Gitlab::Kas::Client.new()
=> #<Gitlab::Kas::Client:0x000000012c246b98>
[2] pry(main)> client.send_git_push_event(project: Project.find(20))
  Project Load (1.9ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = 20 LIMIT 1 /*application:console,db_config_name:main,console_hostname:tuxmac.local,console_username:timo,line:(pry):2:in `__pry__'*/
  Route Load (2.2ms)  SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 20 AND "routes"."source_type" = 'Project' LIMIT 1 /*application:console,db_config_name:main,console_hostname:tuxmac.local,console_username:timo,line:/app/models/concerns/routable.rb:141:in `block in full_attribute'*/
=> <Gitlab::Agent::Notifications::Rpc::GitPushEventResponse: >
[3] pry(main)>
  1. You'll see a log that the event has been received.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Timo Furrer

Merge request reports

Loading