escapewindow: escape window (Default)
[personal profile] escapewindow

that allows production infrastructure and individual developers to use the same scripts.

What are actions?

Actions are discrete logical steps to a script, similar to [simple] makefile targets.

Since certain actions, like upload or notify might not be useful to certain consumers of a script, it's helpful to be able to turn those off.

Versatile, reusable configs are key to sharing scripts between automation and users with different workflows. Actions are another key ingredient.

What are default actions?

default_actions is a subset of all_actions, and specifies the list of actions to run if no action-specific command line options are specified.

Using the script as an example:

deathduck:~/src/clean/mozharness [19:09:59] (default)
621$ scripts/ --list-actions
Actions available: list-config-files, test-json-configs, test-python-configs
Default actions: test-json-configs, test-python-configs

These are specified here.

It's now possible to specify your own default_actions in your config file, so if you want to run a script with a different set of default actions, you can do so without copy/pasting a ton of command line arguments.

How is the list of actions-to-run generated?

I have that documented here.

Using as an example again:

# Only run the list-config-files action --list-config-files

# Run the list-config-files and test-json-configs actions --list-config-files --test-json-configs
# or --action list-config-files,test-json-configs
# or --action list-config-files --action test-json-configs

# Run list-config-files in addition to the default actions --add-action list-config-files

# Run the default actions, but not test-python-configs --no-test-python-configs

How are the actions run in the script?

That's handled by

  1. Change all dashes in the action name to underscores; that's the method to call
  2. If the action is not in the list of actions to run, skip + go to the next action.
  3. if preflight_METHODNAME exists, run that before running METHODNAME.
  5. If postflight_METHODNAME exists, run that after running METHODNAME.

Mozharness home

February 2017


Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 20th, 2019 07:08 am
Powered by Dreamwidth Studios