Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Add a section on CI to the GitHub documentation #85376

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 17 additions & 5 deletions llvm/docs/Contributing.rst
Expand Up @@ -124,12 +124,24 @@ For developers to commit changes from Git
-----------------------------------------

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

LLVM currently has a linear-history policy, which means that merge commits are
not allowed. The `llvm-project` repo on github is configured to reject pushes
that include merges, so the `git rebase` step above is required.
When pushing directly from the command-line to the ``main`` branch, you will need
to rebase your change. LLVM has a linear-history policy, which means
that merge commits are not allowed and the ``main`` branch is configured to reject
pushes that include merges.

GitHub will display a message that looks like this:

.. code-block:: console

remote: Bypassed rule violations for refs/heads/main:
remote:
remote: - Required status check “buildkite/github-pull-requests” is expected.

This can seem scary, but this is just an artifact of the GitHub setup: it is
intended as a warning for people merging pull-requests with failing CI. We can't
disable it for people pushing on the command-line.

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

Expand Down
22 changes: 22 additions & 0 deletions llvm/docs/GitHub.rst
Expand Up @@ -176,6 +176,28 @@ request will understand that you're rebasing just your patches, and display
this result correctly with a note that a force push did occur.


Pre-merge Continuous Integration (CI)
-------------------------------------

Multiple checks will be applied on a pull-request, either for linting/formatting
or some build and tests. None of these are perfect and you will encounter
false positive, infrastructure failures (unstable or unavailable worker), or
you will be unlucky and based your change on a broken revision of the main branch.

None of the checks are strictly mandatory: these are tools to help us build a
better codebase and be more productive (by avoiding issues found post-merge and
possible reverts). As a developer you're empowered to exercise your judgement
about bypassing any of the checks when merging code.

The infrastructure can print messages that make it seem like these are mandatory,
but this is just an artifact of GitHub infrastructure and not a policy of the
project.

However, please make sure you do not force-merge any changes that have clear
test failures directly linked to your changes. Our policy is still to keep the
``main`` branch in a good condition, and introducing failures to be fixed later
violates that policy.

joker-eph marked this conversation as resolved.
Show resolved Hide resolved
Problems After Landing Your Change
==================================

Expand Down