Skip to content

Update push events webhook schema

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

A test showed that the SAMPLE_DATA and the actual schema do not match for data_builder/push.

Test

specify do
  expect(get_all_keys(Gitlab::DataBuilder::Push.build_sample(project, user))).to eq(get_all_keys(Gitlab::DataBuilder::Push.sample_data))
end

def get_all_keys(hash)
  hash.map do |k, v|
    Hash === v ? [k, get_all_keys(v)] : [k]
  end.flatten
end

Result

       Diff:
       @@ -7,6 +7,7 @@
         :message,
         :user_id,
         :user_name,
       + :user_username,
         :user_email,
         :user_avatar,
         :project_id,
       
       @@ -22,9 +23,20 @@
         :visibility_level,
         :path_with_namespace,
         :default_branch,
       + :ci_config_path,
       + :homepage,
       + :url,
       + :ssh_url,
       + :http_url,
         :commits,
         :total_commits_count,
         :push_options,
       - :ci,
       - :skip]
       + :repository,
       + :name,
       + :url,
       + :description,
       + :homepage,
       + :git_http_url,
       + :git_ssh_url,
       + :visibility_level]
Edited by 🤖 GitLab Bot 🤖