The moz.yaml files are used to (1) provide information and context about
third party code in our tree (2) provide repeatable steps to update that
third party code and (3) instruct Updatebot to try to update that code
regurally and give you patches to approve to make the updating process
easier and require less thought.

Pretty much all third party code should have a moz.yaml file for the
purposes of (1).  It can optionally have the vendoring steps for (2), and
(if it does have the vendoring steps) it can optionally have the Updatebot
instructions for (3).

If a moz.yaml does have the vendoring steps, it's being rewritten to the
new format, described below. If you don't have any moz.yaml files or you
never run ./mach vendor locally and just rely on Updatebot - you can pretty
much ignore the rest of the email.

The simplest vendoring step is "Get the upstream code and plop it in this
directory".  Unfortunately, that doesn't often work because... we make a
browser and it's one of the most complicated peices of software that
exists.  Sometimes you need to apply local patches, edit files, or do more
complicated things.  The moz.yaml vendoring steps have always supported
'update-actions' like copy-file, replace-in-file-regex, and delete-path to
accomplish those things, and the very frequently used "run-script" which
lets you write a shell or python script that does whatever you need it to
do.

The fewer things we put in run-script, the better, because 'run-script' is
opaque to Updatebot - if there's a failure, it doesn't really know how to
recover.  However if the actions are specified more explicitly, we can now
ask AI to try to recover for us, giving it a specific prompt about what we
were trying to do.  This is the driving force behind this change.

The old way of vendoring something more complicated was basically "Update
the library" and then "Apply the local patches" and each step could run
some update-actions afterwards. But this wasn't flexible enough.  The new
way of vendoring something is:

> ./mach vendor path/to/moz.yaml --stage 1

That will run stage 1, which is typically "Update the library" but can now
do additional things, like apply patches or whatever else you want it to do
and crucially: in any order.  --stage 2 is typically "Apply local patches"
but can also now do whatever you want it to do in any order.  You can have
any number of stages, and each stage is a separate commit.

All of the moz.yaml files are being converted to the new format as we
speak, assuming 2096674 sticks, and as a follow-up you can further improve
your moz.yaml if you'd like to get your patches to review in a different
form:
 - Perhaps you'd like each local patch you apply to be its own commit to
review
 - Perhaps you'd like to separate your local patches into two or more
logical groups and review each group separately
 - Perhaps you'd like to only review one single revision that updates the
library _and_ applies the local patches

If you run `./mach vendor` locally, you will now specify either `--stage 1`
and so on; or `--stage all`.  If you do `--stage all`, mach vendor will
commit after each stage for you; and then you can reword the commit
messages as you see fit.

Documentation can be found here for the next ~week:
https://firefox-source-docs-stage.data-static-websites.nonprod.webservices.mozgcp.net/main/d658606a-eea5-11f1-94ac-a69bd5a696f1/docs/mozbuild/vendor/index.html#vendoring-stages

And then once 2096674 sticks, it will be at:
https://firefox-source-docs.mozilla.org/mozbuild/vendor/index.html#vendoring-stages

-tom

-- 
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/CADua4_tkxh2vgN5-PUt5mL%2BtB97XT_mdqs5dBcGpq7ts22WeUw%40mail.gmail.com.

Reply via email to