Skip to content

Commit 0e16e95

Browse files
ddunlcopybara-github
authored andcommitted
update documentation to discuss Copybara quirks
PiperOrigin-RevId: 519751862
1 parent 0301c1a commit 0e16e95

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,6 @@ sheparding your PR will communicate any internal test failures and describe
4747
what needs to be fixed.
4848

4949
We are actively working on increasing the number of tests run on Github!
50+
51+
### Copybara quirks
52+
There are some oddities you may see while contributing, please see [this file](docs/copybara.md).

docs/copybara.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copybara quirks
2+
3+
The purpose of this document is to describe oddities you might see while
4+
contributing due to the tool that manages copying source back and forth from
5+
Google's internal repository. This tool is called [Copybara](https://github.com/google/copybara).
6+
7+
## Internal source of truth
8+
9+
Because the source of truth for the code in this repository is Google's internal
10+
repo, Copybara does transformations to the code whenever the code is imported
11+
and exported. This means that sometimes seemingly normal changes can break
12+
internally in surprising ways.
13+
14+
## PR merge status and diff inconsistencies
15+
16+
Since the source of truth is internal, PRs are not merged directly, they are
17+
imported to the Google internal repo where they undergo additional testing,
18+
and then that internal change is submitted, and attributed to the PR author.
19+
Because of the transformations that Copybara applies, there's no guarantee that
20+
the diff will be identical (for example, Copybara applies formatting on import).
21+
22+
For this reason, Copybara won't mark the PR as merged, it will close the PR and
23+
separately apply a commit that should map very closely to the PR.
24+
25+
## Dependency on TSL by copy
26+
27+
As implemented currently, to prevent any temporary broken commits, XLA
28+
depends on TSL not by downloading a copy by using Bazel's `http_archive`, but by
29+
having Copybara copy TSL into XLA's `third_party` directory.

0 commit comments

Comments
 (0)