Commit 26e338f4 authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

Revert "Add luci_migration recipe module."

This reverts commit 2a1ca3f6.

Reason for revert: to be replaced by recipe_engine runtime module
in https://chromium-review.googlesource.com/#/c/infra/luci/recipes-py/+/759677  

Original change's description:
> Add luci_migration recipe module.
> 
> R=​iannucci@chromium.org
> 
> Bug: 782460
> Change-Id: I022deb4d8e3cee8d48e1acccc78f8681490c72b9
> Reviewed-on: https://chromium-review.googlesource.com/757820
> Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>

TBR=iannucci@chromium.org,tandrii@chromium.org

Change-Id: Ieb874ad42b939edb66e35db3cfed0b8b8746e70e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 782460
Reviewed-on: https://chromium-review.googlesource.com/759357Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
parent 2a1ca3f6
......@@ -13,7 +13,6 @@
* [gitiles](#recipe_modules-gitiles)
* [gsutil](#recipe_modules-gsutil)
* [infra_paths](#recipe_modules-infra_paths)
* [luci_migration](#recipe_modules-luci_migration)
* [presubmit](#recipe_modules-presubmit)
* [rietveld](#recipe_modules-rietveld)
* [tryserver](#recipe_modules-tryserver)
......@@ -32,7 +31,6 @@
* [gitiles:examples/full](#recipes-gitiles_examples_full)
* [gsutil:examples/full](#recipes-gsutil_examples_full)
* [infra_paths:examples/full](#recipes-infra_paths_examples_full)
* [luci_migration:tests/full](#recipes-luci_migration_tests_full)
* [presubmit:examples/full](#recipes-presubmit_examples_full)
* [rietveld:examples/full](#recipes-rietveld_examples_full)
* [tryserver:examples/full](#recipes-tryserver_examples_full)
......@@ -614,30 +612,6 @@ It returns git_cache path if it is defined (Buildbot world), otherwise
uses the more generic [CACHE]/git path (LUCI world).
&mdash; **def [initialize](/recipes/recipe_modules/infra_paths/api.py#11)(self):**
### *recipe_modules* / [luci\_migration](/recipes/recipe_modules/luci_migration)
[DEPS](/recipes/recipe_modules/luci_migration/__init__.py#5): [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/properties][recipe_engine/recipe_modules/properties]
#### **class [LuciMigrationApi](/recipes/recipe_modules/luci_migration/api.py#8)([RecipeApi][recipe_engine/wkt/RecipeApi]):**
This module assists in migrating builders from Buildbot to pure LUCI stack.
Finishing migration means you no longer depend on this module.
&emsp; **@property**<br>&mdash; **def [is\_luci](/recipes/recipe_modules/luci_migration/api.py#18)(self):**
True if runs on LUCI stack.
&emsp; **@property**<br>&mdash; **def [is\_prod](/recipes/recipe_modules/luci_migration/api.py#23)(self):**
True if this builder is in production.
Typical usage is to modify steps which produce external side-effects so that
non-production runs of the recipe do not affect production data.
Examples:
* Uploading to an alternate google storage file name when in non-prod mode
* Appending a 'non-production' tag to external RPCs
### *recipe_modules* / [presubmit](/recipes/recipe_modules/presubmit)
[DEPS](/recipes/recipe_modules/presubmit/__init__.py#1): [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/python][recipe_engine/recipe_modules/python], [recipe\_engine/step][recipe_engine/recipe_modules/step]
......@@ -843,11 +817,6 @@ Move things around in a loop!
[DEPS](/recipes/recipe_modules/infra_paths/examples/full.py#7): [infra\_paths](#recipe_modules-infra_paths), [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step]
&mdash; **def [RunSteps](/recipes/recipe_modules/infra_paths/examples/full.py#16)(api):**
### *recipes* / [luci\_migration:tests/full](/recipes/recipe_modules/luci_migration/tests/full.py)
[DEPS](/recipes/recipe_modules/luci_migration/tests/full.py#7): [luci\_migration](#recipe_modules-luci_migration), [recipe\_engine/step][recipe_engine/recipe_modules/step]
&mdash; **def [RunSteps](/recipes/recipe_modules/luci_migration/tests/full.py#13)(api):**
### *recipes* / [presubmit:examples/full](/recipes/recipe_modules/presubmit/examples/full.py)
[DEPS](/recipes/recipe_modules/presubmit/examples/full.py#5): [presubmit](#recipe_modules-presubmit)
......
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'recipe_engine/path',
'recipe_engine/properties',
]
from recipe_engine.recipe_api import Property
from recipe_engine.config import ConfigGroup, Single
PROPERTIES = {
'$depot_tools/luci_migration': Property(
help='Properties specifically for the luci_migration module',
param_name='migration_properties',
kind=ConfigGroup(
# Whether builder runs on LUCI stack.
is_luci=Single(bool),
# Whether builder is in production.
is_prod=Single(bool),
),
default={},
),
}
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from recipe_engine import recipe_api
class LuciMigrationApi(recipe_api.RecipeApi):
"""This module assists in migrating builders from Buildbot to pure LUCI stack.
Finishing migration means you no longer depend on this module.
"""
def __init__(self, migration_properties, **kwargs):
super(LuciMigrationApi, self).__init__(**kwargs)
self._migration_properties = migration_properties
@property
def is_luci(self):
"""True if this recipe is currently running on LUCI stack."""
return bool(self._migration_properties.get('is_luci', False))
@property
def is_prod(self):
"""True if this recipe is currently running in production.
Typical usage is to modify steps which produce external side-effects so that
non-production runs of the recipe do not affect production data.
Examples:
* Uploading to an alternate google storage file name when in non-prod mode
* Appending a 'non-production' tag to external RPCs
"""
return bool(self._migration_properties.get('is_prod', True))
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from recipe_engine import recipe_test_api
class LuciMigrationTestApi(recipe_test_api.RecipeTestApi):
def __call__(self, is_luci, is_prod):
"""Simulate luci migration state of a builder."""
assert isinstance(is_luci, bool), '%r (%s)' % (is_luci, type(is_luci))
assert isinstance(is_prod, bool), '%r (%s)' % (is_prod, type(is_prod))
ret = self.test(None)
ret.properties = {
'$depot_tools/luci_migration': {
'is_luci': is_luci,
'is_prod': is_prod,
},
}
return ret
[
{
"cmd": [],
"name": "show properties",
"~followup_annotations": [
"@@@STEP_LOG_LINE@result@is_luci: True@@@",
"@@@STEP_LOG_LINE@result@is_prod: False@@@",
"@@@STEP_LOG_END@result@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]
\ No newline at end of file
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
DEPS = [
'depot_tools/luci_migration',
'recipe_engine/step',
]
def RunSteps(api):
api.step('show properties', [])
api.step.active_result.presentation.logs['result'] = [
'is_luci: %r' % (api.luci_migration.is_luci,),
'is_prod: %r' % (api.luci_migration.is_prod,),
]
def GenTests(api):
yield api.test('basic') + api.luci_migration(is_luci=True, is_prod=False)
Markdown is supported
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