Skip to content

Commit

Permalink
[𝘀𝗽𝗿] initial version
Browse files Browse the repository at this point in the history
Created using spr 1.3.4
  • Loading branch information
kwk committed Sep 7, 2023
2 parents 0d454d6 + 0967fa9 commit e5093f6
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 170 deletions.
25 changes: 25 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is the list of buildbot-app authors for copyright purposes.
#
# This does not necessarily list everyone who has contributed code.
# To see the full list of contributors, see the revision history in source
# control.

# Names should be added to this file with this pattern:
#
# For individuals:
# Name <email address>
#
# For organizations:
# Organization <fnmatch pattern>
#
# See python fnmatch module documentation for more information.
#
# Please keep the list sorted.
#

# BEGIN individuals section.
Christian Schmidt <ChrisSchmi@users.noreply.github.com>
Konrad Kleine <kkleine@redhat.com>
# Please DO NOT APPEND here. See comments at the top of the file.
# END individuals section.

36 changes: 21 additions & 15 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ endif::[]
// endif::[]

// toc::[]
[NOTE]
====
THIS REPOSITORY IS NO LONGER ACTIVELY MAINTAINED.
====

Let’s build a GitHub App that lets you control your buildbot through
`/buildbot` comments on GitHub Pull Requests.

Expand Down Expand Up @@ -70,7 +75,7 @@ Internally a command comment will be converted into this structure:

*Command structure (cmd/buildbot-app/command/command.go)*

[source,go]
[source%linesnum,go]
----
// A Command represents all information about a /buildbot command
type Command struct {
Expand All @@ -93,7 +98,7 @@ There’s a regular expression that a string comment must match (see

*Regular Rexpression (cmd/buildbot-app/command/command.go)*

[source,go]
[source%linesnum,go]
----
const (
// BuildbotCommand is the command that triggers the buildbot workflow in a
Expand Down Expand Up @@ -156,7 +161,7 @@ The code for creating the comment is straight-forward:

*Thank You! (cmd/buildbot-app/on_issue_comment_event.go)*

[source,go]
[source%linesnum,go]
----
// This comment will be used all over the place
thankYouComment := fmt.Sprintf(
Expand Down Expand Up @@ -226,7 +231,7 @@ GitHub before we check if is mergable:
*Get PR and check mergability
(cmd/buildbot-app/on_issue_comment_event.go)*

[source,go]
[source%linesnum,go]
----
commentUser := *event.Comment.User.Login
repoOwner := *event.Repo.Owner.Login
Expand All @@ -246,7 +251,7 @@ mergable:
*Test: Get PR and check mergability
(cmd/buildbot-app/on_issue_comment_event_test.go)*

[source,go]
[source%linesnum,go]
----
func TestOnIssueCommentEventAny(t *testing.T) {
t.Run("pr not mergable", func(t *testing.T) {
Expand Down Expand Up @@ -281,7 +286,7 @@ various places:

*Server interface (cmd/buildbot-app/server.go)*

[source,go]
[source%linesnum,go]
----
// Server specifies the interface that we need to implement from the AppServer
// object in order to provide a decent mock in tests.
Expand Down Expand Up @@ -311,8 +316,8 @@ containers.
[source,console]
----
$ git clone https://github.com/kwk/buildbot-app.git && cd buildbot-app
$ sudo dnf install -y direnv golang podman podman-compose buildbot pandic asciidoctor
$ gem install asciidoctor-lists
$ sudo dnf install -y direnv golang podman podman-compose buildbot pandoc asciidoctor
$ gem install asciidoctor-lists pygments.rb
$ go install github.com/cespare/reflex@latest
$ cat <<EOF >> ~/.bashrc
export PATH=\${PATH}:~/go/bin
Expand All @@ -328,7 +333,8 @@ $ make app
* Install tools we need/use for development locally. If this was a
deployment site the only requirement is buildbot so that the github app
can make a call to `buildbot try`.
* Install extension to create list of figures etc.
* Install extension to create list of figures etc. and install pygments
for source code highlighting.
* Install hot-reload tool.
* Make tools above available upon next source of `.bashrc`.
* Reload `.bashrc` to have `direnv` and `reflex` working in your current
Expand Down Expand Up @@ -405,17 +411,17 @@ https://docs.buildbot.net/latest/manual/configuration/services/index.html
[[_list_of_code_snippets]]
== List of code snippets

link:#5cb629ee-43a2-46e5-a87a-b9ec85353ef1[Listing 1. ]Command structure
link:#c4a1c29e-fd83-4d01-bca9-a3909da0e96d[Listing 1.] Command structure
(cmd/buildbot-app/command/command.go) +
link:#ad332974-235e-4d79-83b4-39fb4ce307c8[Listing 2. ]Regular
link:#71baebf6-1a66-4dd7-b84b-634a97c4f602[Listing 2.] Regular
Rexpression (cmd/buildbot-app/command/command.go) +
link:#5c7e7c3d-a7a1-4a3c-a029-c62f07e486ad[Listing 3. ]Thank You!
link:#fe6a67e3-9c1c-403c-bea5-bb68120ece01[Listing 3.] Thank You!
(cmd/buildbot-app/on_issue_comment_event.go) +
link:#60e9f0e7-8474-4802-8a07-4a7ef1585327[Listing 4. ]Get PR and check
link:#10dcba1d-a533-4942-8551-7b191170c6cf[Listing 4.] Get PR and check
mergability (cmd/buildbot-app/on_issue_comment_event.go) +
link:#ca2f0a2f-7c1a-42cd-8964-ff0a4bb5a7a7[Listing 5. ]Test: Get PR and
link:#d2590205-91dc-48b2-917b-b35e5809299d[Listing 5.] Test: Get PR and
check mergability (cmd/buildbot-app/on_issue_comment_event_test.go) +
link:#40fcfc54-064a-49d0-96bc-c8328034c8ec[Listing 6. ]Server interface
link:#2a3da2b6-0182-48ea-86cb-e1722be29c61[Listing 6.] Server interface
(cmd/buildbot-app/server.go) +

[[_todo]]
Expand Down
11 changes: 8 additions & 3 deletions docs/README.in.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
include::preamble.adoc[]

[.lead]
[NOTE]
======
THIS REPOSITORY IS NO LONGER ACTIVELY MAINTAINED.
======

Let's build a GitHub App that lets you control your buildbot through `/buildbot` comments on GitHub Pull Requests.

image::docs/media/logo/logo-round-small.png[]
Expand Down Expand Up @@ -138,8 +143,8 @@ I'm using a Fedora Linux 37 on my local machine and for most of the containers.
[source,console]
----
$ git clone https://github.com/kwk/buildbot-app.git && cd buildbot-app # <1>
$ sudo dnf install -y direnv golang podman podman-compose buildbot pandic asciidoctor # <2>
$ gem install asciidoctor-lists # <3>
$ sudo dnf install -y direnv golang podman podman-compose buildbot pandoc asciidoctor # <2>
$ gem install asciidoctor-lists pygments.rb # <3>
$ go install github.com/cespare/reflex@latest # <4>
$ cat <<EOF >> ~/.bashrc # <5>
export PATH=\${PATH}:~/go/bin
Expand All @@ -152,7 +157,7 @@ $ make app # <9>
----
<1> Clone the repo.
<2> Install tools we need/use for development locally. If this was a deployment site the only requirement is buildbot so that the github app can make a call to `buildbot try`.
<3> Install extension to create list of figures etc.
<3> Install extension to create list of figures etc. and install pygments for source code highlighting.
<4> Install hot-reload tool.
<5> Make tools above available upon next source of `.bashrc`.
<6> Reload `.bashrc` to have `direnv` and `reflex` working in your current shell.
Expand Down
Loading

0 comments on commit e5093f6

Please sign in to comment.