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

Add Bors configuration and documentation #686

Merged
merged 3 commits into from
Sep 13, 2018
Merged

Add Bors configuration and documentation #686

merged 3 commits into from
Sep 13, 2018

Conversation

andyleejordan
Copy link
Member

No description provided.

@andyleejordan
Copy link
Member Author

bors try

@oe-bors
Copy link

oe-bors bot commented Sep 12, 2018

try

Configuration problem

bors.toml: syntax error

@andyleejordan
Copy link
Member Author

bors try

johnkord
johnkord previously approved these changes Sep 12, 2018
Copy link
Contributor

@johnkord johnkord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oe-bors
Copy link

oe-bors bot commented Sep 12, 2018

try

Build succeeded

@andyleejordan
Copy link
Member Author

bors try

@andyleejordan
Copy link
Member Author

It would appear that the "short form" referenced here for setting the committer is seen as "invalid syntax," but the "long form" worked.

Open question for @CodeMonkeyLeet and @johnkord: The default user/email is oe-bors[bot] and the no-reply email GitHub creates for it. The plus to this is (a) it's the default and (b) it links the commits to the actual bot/app account. I was able to change it to an arbitrary name (though I reused oe-bors[bot]) and set the email to oeciteam@microsoft.com; but by changing the email it links the commits to our OE CI Team GitHub service account. This may be desirable. Your choice!

@andyleejordan
Copy link
Member Author

bors try just testing how it makes that commit

@oe-bors
Copy link

oe-bors bot commented Sep 12, 2018

try

Not awaiting review

@andyleejordan
Copy link
Member Author

bors try foo

@oe-bors
Copy link

oe-bors bot commented Sep 12, 2018

try

Not awaiting review

@andyleejordan
Copy link
Member Author

bors try foo

@oe-bors
Copy link

oe-bors bot commented Sep 12, 2018

try

Not awaiting review

@andyleejordan
Copy link
Member Author

bors try

@oe-bors
Copy link

oe-bors bot commented Sep 12, 2018

try

Not awaiting review

@andyleejordan
Copy link
Member Author

bors try

@oe-bors
Copy link

oe-bors bot commented Sep 13, 2018

try

Not awaiting review

@andyleejordan
Copy link
Member Author

Did I break it? Closing and re-opening...

@andyleejordan
Copy link
Member Author

bors try

@oe-bors
Copy link

oe-bors bot commented Sep 13, 2018

try

Not awaiting review

@andyleejordan
Copy link
Member Author

Sorry for the spam; deleted the trying branch, trying again.

bors try

@andyleejordan
Copy link
Member Author

Woohoo webhook worked.

Sad thing is all this worked in my fork since I was setting it up "fresh" but transferring it turned out to be more work than I expected.

@oe-bors
Copy link

oe-bors bot commented Sep 13, 2018

try

Build succeeded

This commit updates the "DOs" and "Merging Pull Requests" for the new
Bors workflow. It also adds a rule to ensure commit authorship is
correct, as this appears to be an ongoing problem. Some other
formatting inconsistencies were fixed.
@andyleejordan
Copy link
Member Author

@johnkord @CodeMonkeyLeet are you guys happy with the configuration (especially the Bors bot name and email)?

@andyleejordan
Copy link
Member Author

bors try

@andyleejordan
Copy link
Member Author

@johnkord Ah so apparently that's expected; I thought it linked to the bot if it was the default, but I tried in the bors-ng repo too, and it does not link appropriately. That puts me in the custom name/email camp to link to the service account.

@oe-bors
Copy link

oe-bors bot commented Sep 13, 2018

try

Build succeeded

@@ -65,12 +65,12 @@ Please do:
* **DO** tag any users that should know about and/or review the change.
* **DO** ensure each commit successfully builds on all platforms and passes all
unit tests.
* **DO** rebase and squash unnecessary commits before opening the PR, so that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really necessary? If PRs get squash merged anyway what's the point? When a PR is created I normally don't look at the commits but just at the changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PRs won't get squashed any more. If you want to squash it, do it manually. It is totally up to the author how they want to represent their work.

This isn't to pick on anyone (I didn't even look at the authorship), but history like this is not very useful:

6778b20fc clang break
cd153edbe clang build errors
c8f11599c Clang build breaks
b05bd8cc5 clang break
4aaccb61c fix clang build break
3114f89d7 fix clang build break
6e781d01f fix clang error

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@letmaik You okay with that?

@andyleejordan
Copy link
Member Author

Draft of instruction email to be sent after this is merged:

The Bors bot is now ready to go online. What this means for you is that existing pull requests should either rebase on top of master, or merge master into your branch. Moving forward, in order to merge a finished PR (and to trigger CI for a PR), the commands bors r+ and bors try will instead be used. The usage is simple: just add a comment to your PR with bors try, and the bot will build and test your branch and report the results back. Similarly, instead of clicking "the big green button" to merge a PR, just add a comment bors r+, and the bot will merge your branch to master (but only after it passes the automatic build and test gate).

More information on the Bors bot command reference is here: https://bors.tech/documentation/

To ensure your branch can use Bors, check that you have the file bors.toml in the root of your repo.

Copy link
Contributor

@CodeMonkeyLeet CodeMonkeyLeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly doc comments suggestions

_only_ approved mechanism of merging code to `master`. When a PR is ready to be
merged, a maintainer will comment on it with `bors r+`. Bors will automatically
apply the PR's commits to a staging branch, run the test suite, and if
everything passes, pushes the commits (and a merge commit) to `master`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify the sentence structure, probably clearer to enumerate:

Bors will automatically:
1. Apply the commits from the PR to a staging branch based on `master`.
1. Trigger the code integration (CI) system to build and test the staging branch.
1. Push the commits and a merge commit to `master` only if everything passes.

apply the PR's commits to a staging branch, run the test suite, and if
everything passes, pushes the commits (and a merge commit) to `master`.

At first glance this may appear to be no different then allowing the CI system
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar: "different from" (or if you accept colloquial usage, "different than")

everything passes, pushes the commits (and a merge commit) to `master`.

At first glance this may appear to be no different then allowing the CI system
to test the PR, and then merging with "the big green button." However, allowing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest simplifying the paragraph to:

We require the use of Bors because it prevents a race condition that can result from manual merges: two conflicting PRs may both pass CI testing independently while neither is in master, only to break the branch once both are merged. Bors synchronizes the CI testing of PRs and ensures that passing PRs are immediately merged, so that the state of master always reflects the state tested and passed by CI.


| Syntax | Description
|--------|------------
| bors r+ | Run the test suite, and push to master if it passes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove the comma, it's not a serial (oxford) comma since the "and" is a conjunction. Word flags it.

|--------|------------
| bors r+ | Run the test suite, and push to master if it passes.
| bors r- | Cancel a pending r+.
| bors try | Run the test suite without pushing (trigger CI).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider simplifying to just "Run the CI tests but do not merge on success."

| bors try | Run the test suite without pushing (trigger CI).
| bors delegate+ | Allow the pull request author to r+.
| bors delegate=[list] | Allow the listed users to r+.
| bors ping | Will respond if Bors is up.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency in use of direct, active voice: "Check if Bors is responsive. It will comment with pong if it is."

@@ -153,10 +186,10 @@ You can read more about [Contribution License Agreements (CLA)](
http://en.wikipedia.org/wiki/Contributor_License_Agreement) on Wikipedia.

You don't have to do this up-front. You can simply clone, fork, and submit your
pull-request as usual. When your pull-request is created, it is classified by a
Pull Request as usual. When your Pull Request is created, it is classified by a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should standardize on how GitHub refers to these as simply "pull request" (it's also referred to as such elsewhere in this doc), unhyphenated and uncapitalized (it's not treated as a proper noun).

:
Messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)),
and use the present tense and imperative mood when describing your changes. This
is akin to the commit "giving a command" to the code base, and is used by the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is a little confusing. It sounds like it should be combined with the previous clause you added … did you mean:

Write your descriptions as imperatives in the active voice, as if you are telling Git what you want it to do to the code base.

@@ -143,6 +163,19 @@ Also do your best to factor commits appropriately, not too large with unrelated
things in the same commit, and not too small with the same small change applied
_n_ times in _n_ different commits.

Please ensure the correct name and email are set in the commit. See [initial
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest presenting direct information before links in general:

Ensure that the correct author name and email are set for the commit. For example, before commiting, ensure that Git is configured with your user name and email:
...
For more details, see [initial setup for Git](https://git-scm.com/...

```

We _will not_ accept commits with incorrect authorship. To fix the authorship of
commits in a feature branch, use `git rebase`, choose to `edit` the offending
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multi-line instructions are probably best captured as lists:

If you have existing commits with incorrect author information, you can fix them as follows:

  1. git rebase your working branch
  2. Choose to edit the commits with incorrect authorship
    1. For each edit, git commit --amend --reset-author

@andyleejordan
Copy link
Member Author

Thanks @CodeMonkeyLeet. I also pushed the table's changes upstream bors-ng/bors-ng.github.io#54 😄

Copy link
Contributor

@CodeMonkeyLeet CodeMonkeyLeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@CodeMonkeyLeet CodeMonkeyLeet added the engineering Issue is related to tools and processes necessary for maintaining the Open Enclave repo label Sep 13, 2018
@CodeMonkeyLeet CodeMonkeyLeet added this to the 2018.09 milestone Sep 13, 2018
@andyleejordan
Copy link
Member Author

bors r+

oe-bors bot pushed a commit that referenced this pull request Sep 13, 2018
686: Add Bors configuration and documentation r=andschwa a=andschwa



Co-authored-by: Andrew Schwartzmeyer <andrew@schwartzmeyer.com>
@oe-bors
Copy link

oe-bors bot commented Sep 13, 2018

Build succeeded

@oe-bors oe-bors bot merged commit 95a227d into master Sep 13, 2018
@oe-bors oe-bors bot deleted the bors branch September 13, 2018 20:54
@andyleejordan
Copy link
Member Author

Woo-hoo everything worked according to plan.

@letmaik
Copy link
Contributor

letmaik commented Sep 13, 2018

image

Is this really what people want? What about squash merging?

@andyleejordan
Copy link
Member Author

@letmaik Yes... that is to say, as the author of the PR, it's what I wanted: three clean commits for (1) the bors.toml (2) the initial doc update and (3) the review feedback (I'm 50/50 on this one, I prefer to squash review feedback into the relevant commit, but Simon likes separate commits for feedback, and it's reasonable for discerning what the author presented and what the end result was).

If a PR has half a dozen commits that should be squashed, it's a trivial ask that the dev do git rebase -i to squash them. To not do so instead means the author expects the reviewer to recognize their commits are bad, and to choose to use GitHub-squash instead. Applying GitHub-squash as the default means that most authors' work will be thrown away.

That said, here's the relevant issue if you want to help implement it bors-ng/bors-ng#194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engineering Issue is related to tools and processes necessary for maintaining the Open Enclave repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants