Commit Graph

70 Commits

Author SHA1 Message Date
GitLab Bot 71dc16a12c Add latest changes from gitlab-org/gitlab@master 2021-04-29 18:10:23 +00:00
GitLab Bot e7e40d45b0 Add latest changes from gitlab-org/gitlab@master 2021-04-26 18:09:45 +00:00
GitLab Bot 6a3c4476fa Add latest changes from gitlab-org/gitlab@master 2021-04-19 15:09:08 +00:00
GitLab Bot 807d57c18f Add latest changes from gitlab-org/gitlab@master 2021-03-25 06:09:02 +00:00
GitLab Bot dfda8b7e77 Add latest changes from gitlab-org/gitlab@master 2021-03-18 15:09:04 +00:00
GitLab Bot b9a2e3f2cc Add latest changes from gitlab-org/gitlab@master 2021-02-22 21:10:48 +00:00
GitLab Bot 1c6e8c1498 Add latest changes from gitlab-org/gitlab@master 2021-02-08 09:09:30 +00:00
GitLab Bot 7e81076708 Add latest changes from gitlab-org/gitlab@master 2021-01-22 15:09:08 +00:00
GitLab Bot 77d49e6a73 Add latest changes from gitlab-org/gitlab@master 2020-10-28 15:08:49 +00:00
GitLab Bot 34cd22d1a9 Add latest changes from gitlab-org/gitlab@master 2020-10-05 06:08:45 +00:00
GitLab Bot 4fa04f789e Add latest changes from gitlab-org/gitlab@master 2020-09-02 12:10:35 +00:00
GitLab Bot c8003cdfe1 Add latest changes from gitlab-org/gitlab@master 2020-06-06 15:08:10 +00:00
GitLab Bot 7892ed2e23 Add latest changes from gitlab-org/gitlab@master 2020-05-27 09:08:30 +00:00
GitLab Bot 41e8b05e8d Add latest changes from gitlab-org/gitlab@master 2020-05-13 12:07:54 +00:00
GitLab Bot 09093c1278 Add latest changes from gitlab-org/gitlab@master 2020-04-15 18:09:36 +00:00
GitLab Bot cf6a3e7ed4 Add latest changes from gitlab-org/gitlab@master 2020-02-21 15:09:05 +00:00
GitLab Bot b69f406585 Add latest changes from gitlab-org/gitlab@master 2020-02-15 00:08:48 +00:00
GitLab Bot 76623c12c1 Add latest changes from gitlab-org/gitlab@master 2020-02-05 21:09:02 +00:00
GitLab Bot 8f764d21b0 Add latest changes from gitlab-org/gitlab@master 2019-12-05 09:07:27 +00:00
GitLab Bot 4204cf3085 Add latest changes from gitlab-org/gitlab@master 2019-12-03 15:06:20 +00:00
GitLab Bot ee6b185429 Add latest changes from gitlab-org/gitlab@master 2019-11-07 00:06:18 +00:00
GitLab Bot 76923eae4b Add latest changes from gitlab-org/gitlab@master 2019-10-22 09:06:14 +00:00
GitLab Bot 6b75320f52 Add latest changes from gitlab-org/gitlab@master 2019-10-17 12:07:33 +00:00
GitLab Bot 80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
Bian Jiaping 9c0e2d5b47 Add source and merge_request fields to pipeline event webhook 2019-09-11 19:33:45 +00:00
Stan Hu b46b9d5e89 Fix pipelines not always being created after a push
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31741 introduced
a regression where not all the right parameters would be passed into
`Ci::CreatePipelineService`. We fix this by breaking out the pipeline
parameters and reusing a method from `Gitlab::DataBuilder::Push`.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66196
2019-08-17 06:23:26 -07:00
Stan Hu 4e2bb4e5e7 Reduce Gitaly calls in PostReceive
This commit reduces I/O load and memory utilization during PostReceive
for the common case when no project hooks or services are set up.

We saw a Gitaly N+1 issue in `CommitDelta` when many tags or branches
are pushed. We can reduce this overhead in the common case because we
observe that most new projects do not have any Web hooks or services,
especially when they are first created. Previously, `BaseHooksService`
unconditionally iterated through the last 20 commits of each ref to
build the `push_data` structure. The `push_data` structured was used in
numerous places:

1. Building the push payload in `EventCreateService`
2. Creating a CI pipeline
3. Executing project Web or system hooks
4. Executing project services
5. As the return value of `BaseHooksService#execute`
6. `BranchHooksService#invalidated_file_types`

We only need to generate the full `push_data` for items 3, 4, and 6.

Item 1: `EventCreateService` only needs the last commit and doesn't
actually need the commit deltas.

Item 2: In addition, `Ci::CreatePipelineService` only needed a subset of
the parameters.

Item 5: The return value of `BaseHooksService#execute` also wasn't being
used anywhere.

Item 6: This is only used when pushing to the default branch, so if
many tags are pushed we can save significant I/O here.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65878

Fic
2019-08-12 22:28:49 -07:00
Jan Provaznik 4189ffe214 Added labels_hook_attrs method
Based on review comment fetching labels hook_attrs is now
wrapped in an issue's model method.
2019-06-24 11:51:34 +02:00
Sean McGivern da4702493d Fix label serialisation in issue and note hooks
We were not calling hook_attrs on the labels correctly. Specs were
passing because the issues under test did not have any labels!
2019-06-20 13:50:28 +01:00
Sujay Patel ed8a00b9c4 Adding labels to note event payload. 2019-06-10 15:35:38 +05:30
Shinya Maeda 7e05f3b78b Use source ref for pipeline webhook
When user uses Pipelines for merge requests, the pipeline is a run on
a merge request ref instead of branch ref. However, we should send
source ref as a webhook in order to respect the original behavior.
2019-05-28 09:29:59 +07:00
Jason Goodman 1b8646804d Update deployment chat message notification
Include link to user and commit title.
Rearrange text
2019-05-02 16:07:26 +00:00
Douglas Barbosa Alexandre f832b96ad7 Merge branch 'use-keyword-args-for-databuilder-push' into 'master'
Use keyword args for databuilder push

See merge request gitlab-org/gitlab-ce!24088
2019-04-29 14:43:56 +00:00
Jason Goodman fe86890b9d Add deployment events to chat notification services
This enables sending a chat message to Slack or Mattermost
  upon a successful, failed, or canceled deployment
2019-04-26 21:08:41 +00:00
Jonathon Reinhart f48605c796 Use all keyword args for DataBuilder::Push.build() 2019-04-25 13:54:26 +02:00
Luke Duncalfe 1883e320ea Use Gitlab::PushOptions for `ci.skip` push option
Previously the raw push option Array was sent to Pipeline::Chain::Skip.

This commit updates this class (and the chain of classes that pass the
push option parameters from the API internal `post_receive` endpoint to
that class) to treat push options as a Hash of options parsed by
GitLab::PushOptions.

The GitLab::PushOptions class takes options like this:

    -o ci.skip -o merge_request.create -o merge_request.target=branch

and turns them into a Hash like this:

    {
      ci: {
        skip: true
      },
      merge_request: {
        create: true,
        target: 'branch'
      }
    }

This now how Pipeline::Chain::Skip is determining if the `ci.skip` push
option was used.
2019-04-09 10:03:26 +12:00
Shinya Maeda 8e51439e80 Drop legacy artifacts usage
Legacy artifacts have been correctly migrated to new place -
ci_job_artifacts. Now it's time to remove the related code, but before
that we should ensure it doesn't break anything by using feature flag.
2019-04-04 16:19:43 +07:00
Luke Duncalfe f27cba0fee
Fix private user email being visible in tag webhooks
Fixes #54721
2019-01-31 16:51:18 +01:00
Jonathon Reinhart ba781484c7 Add support for Git push options, specifically ci.skip
gitlab-org/gitlab-shell!166 added support for collecting push options
from the environment, and passing them along to the
/internal/post_receive API endpoint.

This change handles the new push_options JSON element in the payload,
and passes them on through to the GitPushService and GitTagPushService
services.

Futhermore, it adds support for the first push option, ci.skip.  With
this change, one can use 'git push -o ci.skip' to skip CI pipe
execution. Note that the pipeline is still created, but in the "skipped"
state, just like with the 'ci skip' commit message text.

Implements #18667
2018-12-31 13:57:53 -05:00
gfyoung 7e6f6e1603 Enable even more frozen string in lib/gitlab
Enables frozens string for the following:

* lib/gitlab/conflict/**/*.rb
* lib/gitlab/cross_project_access/**/*.rb
* lib/gitlab/cycle_analytics/**/*.rb
* lib/gitlab/data_builder/**/*.rb
* lib/gitlab/database/**/*.rb
* lib/gitlab/dependency_linker/**/*.rb
* lib/gitlab/diff/**/*.rb
* lib/gitlab/downtime_check/**/*.rb
* lib/gitlab/email/**/*.rb
* lib/gitlab/etag_caching/**/*.rb

Partially addresses gitlab-org/gitlab-ce#47424.
2018-11-06 22:47:32 -08:00
Pierre Tardy 57a4ee88ae Add variables on pipeline webhook 2018-10-01 17:22:41 +00:00
Takuya Noguchi 7a57e59e1a Use sample data for push event when no commits created 2018-08-31 10:27:41 +09:00
Maciej Sokołowski 93c60f611c #47845 - Propagate failure_reason to job webhook. 2018-08-10 14:43:10 +00:00
Kamil Trzciński ca93faf15f Remove the use of `is_shared` of `Ci::Runner` 2018-06-26 15:53:09 +02:00
Douwe Maan 52967b107b
Merge branch 'jej/mattermost-notification-confidentiality-10-6' into 'security-10-6'
[10.6] Prevent notes on confidential issues from being sent to chat

See merge request gitlab/gitlabhq!2366
# Conflicts:
#	app/helpers/services_helper.rb
2018-04-05 08:41:56 +02:00
Douwe Maan 7734e85bc6 Merge branch 'ce-jej/github-project-service-for-ci' into 'master'
Backport changes from introducing GithubService interation in EE

See merge request gitlab-org/gitlab-ce!17607
2018-03-08 00:39:27 +00:00
James Edwards-Jones 6253d4456a Backport changes from EE's GithubService integration
Adds detailed_status to pipeline hook data
Adds detailed_description option for Services
Integration edit page renders 404 if a service is disabled
2018-03-07 17:50:10 +00:00
Dmitriy Zaporozhets aeab4e6263
Use Project#full_name instead of name_with_namespace
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-03-07 16:07:09 +02:00
Vitaliy @blackst0ne Klachkov 614bfc3afb Use full URL of user avatar on webhook push 2017-10-05 23:54:56 +11:00
Andrew Newdigate 9f71ea0d4d Workaround for #38259 2017-09-22 18:54:35 +00:00