Commit 376d59c0 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Post-receives for repository files and merges with changeset

Post-receive notificiations are necessary to trigger pipelines and
other post branch update actions that must be taken on the GitLab
side

Previously, we enabled them in merges with changeset performed by the
Rails app itself, but we had only the publication step send them
to avoid unnecessary consequences like redundant pipelines, but that
was wrong: if there's already an added commit on `branch/default`
a publication doesn't trigger any change on `branch/default`. The
only post-receive it can send is a topic branch prune.
parent 8843a066c5ae
......@@ -339,6 +339,7 @@
else
hg_env_for_write(user)
end
hg_env.delete('HEPTAPOD_SKIP_ALL_GITLAB_HOOKS')
hg_tmp_workdir(target_hgsha) do |share_path|
logger.info("#{logprefix} calling #{hg_exe} merge -r #{source_hgsha}")
......@@ -752,6 +753,7 @@
hg_exe = Gitlab.config.mercurial.bin_path
hg_env = hg_env_for_write(user)
hg_env.delete('HEPTAPOD_SKIP_ALL_GITLAB_HOOKS')
committer = Gitlab::Git.committer_hash(email: user.email, name: user.name)
username = "#{committer[:name]} <#{committer[:email]}>"
......@@ -883,7 +885,7 @@
if topic.nil?
publish_str, status = popen([hg_exe, 'config', 'experimental.topic.publish-bare-branch'], share_path, hg_env)
publish = ['yes', 'true', 'on', '1'].include?(publish_str.downcase.strip)
hg_changeset_publish(user, commit_hgsha) if publish
hg_changeset_publish(user, commit_hgsha, notify_gitlab: true) if publish
end
commit_hgsha
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment