./mach try fuzzy: A Try Syntax Alternative

Andrew Halberstadt ahalberstadt at mozilla.com
Thu Aug 31 14:47:51 UTC 2017

+tools at lists.mozilla.org

There have been a bunch of new features added here I'd like to highlight:

   - --artifact/--no-artifact: This works similarly to try syntax. If a
   local build with artifact builds is detected, --artifact will be used
   automatically. Unlike try syntax, this will change your treeherder symbols
   to 'Ba' to make it more obvious artifact builds are being used.
   - --env: You can now set environment variables in your tasks directly
   from the command line, e.g:
      - ./mach try fuzzy --env XPCOM_DEBUG_BREAK=stack --env
   - --full: Populate the fuzzy interface with the "full" set of tasks.
   This will let you choose tasks that were previously hard to select (e.g
   nightlies, l10n, signing tasks, etc)
   - --save/--preset: Works the same as try syntax, using the --query
   argument. E.g:
      - ./mach try fuzzy --save reftest -q "!cov !pgo 'reftest !jsreftest"
      - ./mach try --preset reftest

See |mach try fuzzy --help| for more information.

At this point I consider |mach try fuzzy| to be superior to try syntax in
almost every way [1], and would encourage people to start using it by
default. To do this, create a ~/.mozbuild/machrc file (if you don't already
have one) and add:
default = fuzzy

Now when you run |mach try| it will default to the fuzzy interface instead
of try syntax. If you need to use try syntax for some reason, you can still
run |mach try syntax -b do ... |. By the end of Q3 I plan on writing up an
outline to deprecate try syntax (it'll likely never be removed completely)
in favour of 'try_task_config.json' mechanisms. Nothing major will change
anytime soon, but it's worth being aware that there are now better methods
for scheduling tasks and finding people willing to maintain try syntax is
going to be even harder than it was before.


[1] Try syntax still has a few benefits over fuzzy. You can specify paths,
use --rebuild and it will detect compiled tests and error out if you try to
use artifact builds. There are bugs on file to reach parity here.

On Wed, Aug 2, 2017 at 10:30 AM Andrew Halberstadt <ahalberstadt at mozilla.com>

> I'm pleased to announce an alternative method for scheduling tasks on try
> is now landed on mozilla-central. It makes use of the awesome fzf [1]
> project to filter down the list of all task labels with a fuzzy matching
> algorithm.
> It works both with mercurial or git. If using mercurial, you'll need to
> make sure you're updated to the latest version-control-tools:
> $ ./mach mercurial-setup --update
> To push to try, run:
> $ ./mach try fuzzy
> This will prompt you to install fzf. After bootstrapping is complete,
> it'll generate the task list. This takes around ~10-20 seconds, but will be
> cached so subsequent invocations won't incur this penalty again.
> Now you'll be in the fzf interface. Basic usage is to start typing to
> filter down the task list. You can use the arrow keys to move the cursor up
> or down, <tab> to select a task, <ctrl-a> to select all tasks and <enter>
> to schedule the current selection (and their dependencies) on try.
> There are a ton more keyboard shortcuts and features you can use to tweak
> fzf just to your liking. For extra help, see:
> $ ./mach try fuzzy --help
> or
> $ man fzf
> For a demo and more information on implementation details, see:
> https://ahal.ca/blog/2017/mach-try-fuzzy/
> I expect this to work on all platforms including Windows for both
> mercurial (with push-to-try) and git (with git-cinnabar). But it's a new
> tool without a lot of real world testing, so a few bumps are likely. If you
> find any bugs or bad UX, please file a bug under Testing :: General and let
> me know (we should find a better component for this).
> Cheers,
> Andrew
> p.s When running the fzf bootstrap, you'll be prompted to install some
> shell extensions. These aren't necessary for |mach try fuzzy| to work so
> feel free to hit 'N' at each prompt. That being said, the fzf shell
> extensions are awesome. I highly encourage you to look into setting it up
> for your shell. The fzf vim plugin is also great. See the project [1] for
> more details.
> [1] https://github.com/junegunn/fzf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/firefox-dev/attachments/20170831/d9add137/attachment.html>

More information about the firefox-dev mailing list