gitlab-org--gitlab-foss/spec
Nick Thomas b2c73fde79
Look for new branches more carefully
In certain cases, GitLab can miss a PostReceive invocation the first
time a branch is pushed. When this happens, the "branch created" hooks
are not run, which means various features don't work until the branch
is deleted and pushed again.

This MR changes the `Git::BranchPushService` so it checks the cache of
existing branches in addition to the `oldrev` reported for the branch.
If the branch name isn't in the cache, chances are we haven't run the
service yet (it's what refreshes the cache), so we can go ahead and
run it, even through `oldrev` is set.

If the cache has been cleared by some other means in the meantime, then
we'll still fail to run the hooks when we should. Fixing that in the
general case is a larger problem, and we'd need to devote significant
engineering effort to it.

There's a chance that we'll run the relevant hooks *multiple times*
with this change, if there's a race between the branch being created,
and the `PostReceive` worker being run multiple times, but this can
already happen, since Sidekiq is "at-least-once" execution of jobs. So,
this should be safe.
2019-06-18 12:53:53 +01:00
..
bin
config
controllers Search issuables by iids 2019-06-18 07:45:47 +00:00
db Backport the EE schema and migrations to CE 2019-06-17 17:09:05 +02:00
dependencies
factories Make KubernetesService readonly 2019-06-18 00:01:56 +00:00
features Remove support for creating non-RBAC kubernetes clusters 2019-06-18 08:59:27 +00:00
finders Hashed Storage is enabled by default on new installations 2019-06-17 20:35:22 +02:00
fixtures Ensure duplicate sections collapse 2019-06-17 15:22:40 +01:00
frontend Fix IDE commit to use start_ref 2019-06-17 14:04:35 -05:00
graphql Expose comments on Noteables in GraphQL 2019-06-14 12:36:27 +02:00
haml_lint/linter
helpers Fix missing deployment rockets in monitor dashboard 2019-06-14 07:59:42 +00:00
initializers
javascripts Merge branch '59023-fix-web-ide-creating-branches-off-new-commits' into 'master' 2019-06-18 08:22:06 +00:00
lib Make KubernetesService readonly 2019-06-18 00:01:56 +00:00
mailers Omit blocked admins from repository check e-mails 2019-06-12 12:55:25 -07:00
migrations Merge branch 'migrate_k8s_service_integration' into 'master' 2019-06-17 23:31:36 +00:00
models Merge branch '62760-unquarantine-spec' into 'master' 2019-06-18 09:09:05 +00:00
policies Allow Developer role to delete tags via container registry api 2019-06-17 11:13:03 +00:00
presenters Expose ci_default_git_depth via project API 2019-06-12 09:51:45 +01:00
rack_servers Add metric for measuring PumaWorkerKiller activity 2019-06-10 16:09:40 +00:00
requests Make KubernetesService readonly 2019-06-18 00:01:56 +00:00
routing Merge branch 'dz-scope-project-routes-3' into 'master' 2019-05-31 15:53:04 +00:00
rubocop
serializers Make KubernetesService readonly 2019-06-18 00:01:56 +00:00
services Look for new branches more carefully 2019-06-18 12:53:53 +01:00
sidekiq/cron
support Make KubernetesService readonly 2019-06-18 00:01:56 +00:00
tasks Merge branch 'gitaly-version-v1.43.0' into 'master' 2019-05-31 14:16:54 +00:00
uploaders Remove legacy artifact related code 2019-05-31 10:49:17 +07:00
validators
views Merge branch 'error-pipelines-for-blocked-users' into 'master' 2019-06-17 13:00:34 +00:00
workers Make KubernetesService readonly 2019-06-18 00:01:56 +00:00
factories_spec.rb
fast_spec_helper.rb
rails_helper.rb
rake_helper.rb
simplecov_env.rb
spec_helper.rb