Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: PRESUBMIT.py

Issue 1345303002: Allow PRESUBMIT run pcg on trybuilder. (Closed) Base URL: https://github.com/luci/gae@master
Patch Set: added CQ config change Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | infra/config/cq.cfg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index bb626f8b1c82f76700d33a8ffcefbf3624de1b82..e338f43762aaf3908aef03ba6df43b8591a7f960 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -32,10 +32,13 @@ def PreCommitGo(input_api, output_api, pcg_mode):
'checks are skipped. See https://github.com/maruel/pre-commit-go.')
]
- # pcg can figure out what files to check on its own based on upstream ref.
cmd = [pcg, 'run', '-m', ','.join(pcg_mode)]
if input_api.verbose:
cmd.append('-v')
+ # pcg can figure out what files to check on its own based on upstream ref,
+ # but on PRESUBMIT try builder upsteram isn't set, and it's just 1 commit.
+ if os.getenv('PRESUBMIT_BUILDER', ''):
+ cmd.extend(['-r', 'HEAD~1'])
return input_api.RunTests([
input_api.Command(
name='pre-commit-go: %s' % ', '.join(pcg_mode),
« no previous file with comments | « no previous file | infra/config/cq.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698