From 25e7634d692a91774f12eb255eff9d456e433ab4 Mon Sep 17 00:00:00 2001 From: Carl Johnson Date: Mon, 29 Jun 2020 14:15:18 +0100 Subject: [PATCH] Allow unshelving pending changelists for git-based pipelines (#166) --- python/buildkite.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/buildkite.py b/python/buildkite.py index 40ac75c..fba5c48 100644 --- a/python/buildkite.py +++ b/python/buildkite.py @@ -74,6 +74,12 @@ def set_metadata(key, value, overwrite=False): def get_users_changelist(): """Get the shelved changelist supplied by the user, if applicable""" + # Overrides the CL to unshelve via plugin config + # TODO: Remove this to discourage git-based pipelines that sync perforce + shelved_cl = os.environ.get('BUILDKITE_PLUGIN_PERFORCE_SHELVED_CHANGE') + if shelved_cl: + return shelved_cl + branch = os.environ.get('BUILDKITE_BRANCH', '') if branch.isdigit(): return branch