Skip to content

Commit 117da67

Browse files
committed
[Doc] Add a section on CI to the GitHub documentation
1 parent dbb2fd5 commit 117da67

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

llvm/docs/Contributing.rst

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,24 @@ For developers to commit changes from Git
124124
-----------------------------------------
125125

126126
Once a patch is reviewed, you can select the "Squash and merge" button in the
127-
GitHub web interface. You might need to rebase your change before pushing
128-
it to the repo.
127+
GitHub web interface.
129128

130-
LLVM currently has a linear-history policy, which means that merge commits are
131-
not allowed. The `llvm-project` repo on github is configured to reject pushes
132-
that include merges, so the `git rebase` step above is required.
129+
When pushing directly from the command-line to the `main`` branch, you will need
130+
to rebase your change. LLVM has a linear-history policy, which means
131+
that merge commits are not allowed and the `main` branch is configured to reject
132+
pushes that include merges.
133+
134+
GitHub will display a message that looks like:
135+
136+
.. code-block:: console
137+
138+
remote: Bypassed rule violations for refs/heads/main:
139+
remote:
140+
remote: - Required status check “buildkite/github-pull-requests” is expected.
141+
142+
This can seem scary, but you likely did nothing wrong: it is intended as a warning
143+
for people merging pull-requests with failing CI. We can't disable it for people
144+
pushing on the command-line.
133145

134146
Please ask for help if you're having trouble with your particular git workflow.
135147

llvm/docs/GitHub.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,24 @@ request will understand that you're rebasing just your patches, and display
176176
this result correctly with a note that a force push did occur.
177177

178178

179+
Pre-merge Continuous Integration (CI)
180+
-------------------------------------
181+
182+
Multiple checks will be applied on a pull-request, either for linting/formatting
183+
or some build and tests. None of these are perfect and you will encounter
184+
false positive, infrastructure failures (unstable or unavailable worker), or
185+
you will be unlucky and based your change on a broken revision of the main branch.
186+
187+
None of the checks are strictly mandatory: these are tools to help us build a
188+
better codebase and be more productive (by avoiding issues found post-merge and
189+
possible reverts). As a developer you're empowered to exercise your judgement
190+
about bypassing any of the checks when merging code.
191+
192+
The infrastructure can print messages that make it seem like these are mandatory,
193+
but this is just an artifact of GitHub infrastructure and not a policy of the
194+
project.
195+
196+
179197
Problems After Landing Your Change
180198
==================================
181199

0 commit comments

Comments
 (0)