The Fuchsia project contains many separate repositories. To make cross-repository changes easier, Fuchsia's Gerrit host supports declaring dependencies between changes in different repositories. Dependencies are respected during presubmit testing and change submission.
To declare a CL's dependency on another CL, include a Depends-on
footer in the commit message. A CL can have multiple dependencies, spanning different repositories and Gerrit hosts.
Format:
[foo] Do something Depends-on: Idc82d1483b4be8480aaa87bb48af8d03cfa45858 Change-Id: Ibbf13ab7de7e4444a2dc1f52f3cad97e76c7721d
{% dynamic if user.is_googler %}
To make a change in turquoise-internal-review.googlesource.com depend on a change in fuchsia-review.googlesource.com:
Depends-on: fuchsia:I9916ccaa4b95b6e9babdee33014fa6bd3d478f2e
To make a change in fuchsia-review.googlesource.com depend on a change in turquoise-internal-review.googlesource.com:
Depends-on: turquoise-internal:I9916ccaa4b95b6e9babdee33014fa6bd3d478f2e
{% dynamic endif %}
The spelling Depends-On
(with the “o” capitalized) is also accepted.
Depends-on
footer must be a Gerrit change ID. Only change IDs are accepted; integer change numbers are not.turquoise-internal:I9916ccaa4b95b6e9babdee33014fa6bd3d478f2e
).Depends-on
footers must be in the last paragraph of the commit message, with no blank lines between Depends-on
and the Change-Id
footer.Depends-on
footer is case-sensitive, and will only be recognized if capitalized as Depends-on
or Depends-On
.Depends-on
footer references a non-existent CL, a comment will be added to the CL.Depends-on
footer will not be submittable until all of its dependencies are submitted, at which point the “CL Deps Checker” robot will vote Dependencies-Satisfied +1 which will make the CL submittable.Depends-on
footer is also handled recursively, so that transitive dependencies are respected.Depends-on
footers, they will land in the correct order with no manual intervention necessary.Note: Circular dependencies are not supported for most repositories.
Note: Submission of circular dependencies has many edge cases, so circular dependencies should only be used for changes that need to be landed atomically. If the desired result can be accomplished in the same number of CLs using a one-way dependency, please use a one-way dependency.
{% dynamic if user.is_googler %}
Circular dependencies are only allowed between fuchsia.git and vendor/google.
{% dynamic endif %}
To use circular dependencies:
Depends-on
footers referencing each other.The CL Deps Checker robot will take care of the rest, doing a presubmit dry run on both CLs and approving them both simultaneously if the dry runs pass.
Then auto-submit will submit the CLs, and the roller into integration.git will roll the CLs in a single commit.