# Run all steps in the checkout dir (consistent with chromium_tests). with api.step.context(context): # TODO(phajdan.jr): remove redundant **context below once we fix things # to behave the same without it. step_result = api.bot_update.ensure_checkout(force=True, **context)
if step_result.json.output['did_run']: co_root = step_result.json.output['root'] cwd = kwargs.get('cwd', self.m.path['slave_build']) if 'checkout' not in self.m.path: self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep))
compositor = recipe_api._STEP_CONTEXT name = compositor.get_with_context('name', name) if 'cwd' not in kwargs: kwargs['cwd'] = compositor.get('cwd') kwargs['env'] = compositor.get_with_context('env', kwargs.get('env', {})) kwargs['infra_step'] = compositor.get_with_context( 'infra_step', bool(infra_step)) kwargs['step_nest_level'] = compositor.get_with_context('nest_level', 0)
schema = self.make_config() schema.set_val(kwargs) return self.run_from_dict(self._engine.create_step(schema))
--
You received this message because you are subscribed to the Google Groups "infra-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to infra-dev+...@chromium.org.
To post to this group, send email to infr...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/CAATLsPaPFLhsJw-2gjy_PTfLoC8oq_o7s_%2BbAJfMN2J591HvrA%40mail.gmail.com.
def ensure_checkout(self, checkout_path, ...): ... try: self(..., cwd=checkout_path) finally: if step_result.json.output['did_run']: ... other code
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/f535ec5d-091a-40cc-9df8-f10fd56d258d%40chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to infra-dev+unsubscribe@chromium.org.
Oh! Yeah definitely. Having an explicit API to read the context lgtm. I just don't like having all the conflicting options :P
I think 'with ... context:' actually reads pretty well right now, not sure if the 'set' is necessary. I would definitely not be a fan of a non-lexically scoped context setting method though (unless there is a usecase for that I think it will lead to leaked chdir and environmental variables)
R
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/f535ec5d-091a-40cc-9df8-f10fd56d258d%40chromium.org.