summaryrefslogtreecommitdiff
path: root/changelogs
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-06-17 16:12:05 +0100
committerNick Thomas <nick@gitlab.com>2019-06-18 12:53:53 +0100
commitb2c73fde791ebac6c2cc615fce19294190b05609 (patch)
tree823c03b649c56e72ce81e9a21c26583c59e8fcc7 /changelogs
parentc7b72a6ee4e271906a4087b1ec6c818200dd7e07 (diff)
downloadgitlab-ce-b2c73fde791ebac6c2cc615fce19294190b05609.tar.gz
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.
Diffstat (limited to 'changelogs')
-rw-r--r--changelogs/unreleased/59257-find-new-branches-harder.yml5
1 files changed, 5 insertions, 0 deletions
diff --git a/changelogs/unreleased/59257-find-new-branches-harder.yml b/changelogs/unreleased/59257-find-new-branches-harder.yml
new file mode 100644
index 00000000000..631eaa22ef0
--- /dev/null
+++ b/changelogs/unreleased/59257-find-new-branches-harder.yml
@@ -0,0 +1,5 @@
+---
+title: Look for new branches more carefully
+merge_request: 29761
+author:
+type: fixed