Skip to content

Commit 5be6a1c

Browse files
committed
docs: add new page about our project board and small fixes
1 parent e02ae3a commit 5be6a1c

7 files changed

Lines changed: 112 additions & 16 deletions

File tree

.github/workflows/pr-issues-project.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
# GitHub Actions workflow to automatically push PRs and issues to the DevOps Stack project board.
3-
#
4-
# IMPORTANT: This workflow is called by other workflows in our DevOps Stack repositories and it is centralized here in
5-
# order to be easily maintained across modules. Because of this, please make sure you're not introducing any breaking
6-
# changes when modifying this workflow.
2+
# GitHub Actions workflow to automatically push PRs and issues to the DevOps Stack project board.
3+
#
4+
# IMPORTANT: This workflow is called by other workflows in our DevOps Stack repositories and it is centralized here in
5+
# order to be easily maintained across modules. Because of this, please make sure you're not introducing any breaking
6+
# changes when modifying this workflow.
77

88
name: "pr-issues-project"
99

docs/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
** xref:ROOT:contributing/module_creation_checklist.adoc[Module Creation Checklist]
2020
** xref:ROOT:contributing/documentation.adoc[Documentation]
2121
** xref:ROOT:contributing/release.adoc[Release]
22+
** xref:ROOT:contributing/project_board.adoc[Project Board]
2223
2324
.*Cluster Modules*
2425
* xref:eks:ROOT:README.adoc[Amazon EKS]

docs/modules/ROOT/pages/contributing/general_guidelines.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ This document describes the general guidelines for contributing to the DevOps St
77

88
The DevOps Stack is a collection of modules, each of them having its own release cycle, in order to ease the development and maintenance of each module.
99

10+
TIP: We have created a private GitHub project owned by the https://github.com/orgs/camptocamp/teams/is-devops-stack/[`@camptocamp/is-devops-stack` team] that is available https://github.com/orgs/camptocamp/projects/3/[here]. It is a useful way to follow the progress of the PRs and Issues of all the repositories. For more information on how it is implemented, check the xref:ROOT:contributing/project_board.adoc[Project Board] page.
11+
1012
== Development Workflow
1113

1214
When a new feature or fix is required, the typical workflow is the following:

docs/modules/ROOT/pages/contributing/module_creation_checklist.adoc

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,27 @@ When first creating a module for the DevOps Stack, there are a few steps to foll
99
+
1010
image::guides_tutorials/module_checklist/create_module_repository.png[Create Repository]
1111
12-
2. On the settings of the repository, in the _General_ tab, on the _Pull Requests_ section, disable the _Allow squash commits_ option and enable the _Automatically delete head branches_ option.
12+
2. Go to the settings of the repository and to the _General_ tab:
1313
14-
3. Then go to the _Collaborators and teams_ tab, add the `infrastructure-department` team as _Maintainers_ and the `is-devops-stack` team as _Administrators_.
14+
a. On the _Features_ section, disable the _Wikis_, _Sponsorships_ and _Discussions_, then make sure the _Issues_ and _Projects_ are enabled.
15+
16+
b. On the _Pull Requests_ section, disable the _Allow merge commits_ option and enable the _Automatically delete head branches_ option.
17+
18+
3. Then go to the _Collaborators and teams_ tab, add the `infrastructure-department` team as _Maintainers_ and the https://github.com/orgs/camptocamp/teams/is-devops-stack/[`@camptocamp/is-devops-stack` team] team as _Administrators_.
1519
+
1620
image::guides_tutorials/module_checklist/change_collaborators.png[Change Collaborators]
1721
1822
4. Next go to the _Branches_ tab, and create a new branch protection rule for the `main` branch, with the following settings.
1923
+
2024
image::guides_tutorials/module_checklist/branch_protection_rule.png[Branch Protection Rule]
2125
22-
5. Afterwards, you need to add the Slack app to the repository in order to activate notifications on the https://camptocamp.slack.com/archives/C01DPEV82F6[#is-devops-stack] channel. To do so, go to the channel and do the following:
26+
5. Finally, still on the settings of the repository, under _Secrets and variables_, go to _Actions_ and add the secret `PROJECT_APP_PRIVATE_KEY`, which is needed to automatically add Issues and PRs to our project board. Check with the team where you can find this secret.
27+
28+
6. Go the the _Projects_ tab of the repository and add the https://github.com/orgs/camptocamp/projects/3/[DevOps Stack project] (https://docs.github.com/en/issues/planning-and-tracking-with-projects/managing-your-project/adding-your-project-to-a-repository[documentation]).
29+
30+
7. Request that an administrator of our GitHub organization adds the newly created repository to the app that automatically adds Issues and PRs to our project board (check the xref:ROOT:contributing/project_board.adoc[Project Board] page for more information).
31+
32+
8. Afterwards, you need to add the Slack app to the repository in order to activate notifications on the https://camptocamp.slack.com/archives/C01DPEV82F6[#is-devops-stack] channel. To do so, go to the channel and do the following:
2333
2434
a. Type `/github subscribe camptocamp/<MODULE_NAME>`.
2535
@@ -39,6 +49,6 @@ image::guides_tutorials/module_checklist/slack_github_subscribe.png[Slack GitHub
3949
+
4050
image::guides_tutorials/module_checklist/slack_github_unsubscribe.png[Slack GitHub Unsubscribe]
4151

42-
6. All that is left to do is adding the repository to our team reminder. For that, you can go to the https://github.com/orgs/camptocamp/teams/is-devops-stack/[`is-devops-stack` team], and add the repository to our scheduled reminder on Slack about pending Pull Requests.
52+
9. All that is left to do is adding the repository to our team reminder. For that, you can go to the https://github.com/orgs/camptocamp/teams/is-devops-stack/[`@camptocamp/is-devops-stack` team], and add the repository to our scheduled reminder on Slack about pending Pull Requests.
4353
+
4454
image::guides_tutorials/module_checklist/slack_reminder_team.png[Slack Reminder]

docs/modules/ROOT/pages/contributing/modules.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Quick overview of each file/folder:
4040

4141
. *`.github`* - Contains the GitHub Actions workflows that are used to lint the code, generate the documentation and release the module. *They are stored on the main repository and each module calls the same workflows.*
4242
. *`CHANGELOG.md`* - Contains the changelog of the module. It is automatically updated by the Release Please GitHub Action and *you do not need to create this file manually*.
43-
. *`CODEOWNERS`* - Contains the list of GitHub users that will be automatically assigned as reviewers for pull requests on the module. In our case it is the `@camptocamp/is-devops-stack` team.
43+
. *`CODEOWNERS`* - Contains the list of GitHub users that will be automatically assigned as reviewers for pull requests on the module. In our case it is the https://github.com/orgs/camptocamp/teams/is-devops-stack/[`@camptocamp/is-devops-stack` team].
4444
. *`docs`* - This is a folder that contains a precise substructure needed for the rendering of these documentation pages by Antora. The actual documentation is contained on the `README.adoc` files. You will find these and some other explanations about the docs on the {documentation-page} page.
4545
. *`LICENSE`* - The license of the module. In our case it is the Apache 2.0 license.
4646
. *`README.adoc`* - The documentation of the module. It is written in AsciiDoc and contains the example usage along with some explanations as well as the automatic documentation generated by Terraform Docs.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
= GitHub Project Board
2+
3+
// These URLs are used in the document as-is to generate new URLs, so they should not contain any trailing slash.
4+
:url-main-repo: https://github.com/camptocamp/devops-stack
5+
6+
In order to ease up the burden of the project maintainers, we created an internal Project Board on GitHub. This board is used to track the progress of the PRs and issues. The board is available only to the https://github.com/orgs/camptocamp/teams/is-devops-stack/[`@camptocamp/is-devops-stack` team] and is available https://github.com/orgs/camptocamp/projects/3/[here]. All the repositories of the DevOps Stack are also connected to this project upon creation.
7+
8+
The way this is accomplished is somewhat convoluted, hence the reason for this documentation page.
9+
10+
== DevOps Stack Project
11+
12+
The project itself has been manually created on the https://github.com/orgs/camptocamp/[`@camptocamp`] organization, using the GitHub web interface (https://docs.github.com/en/issues/planning-and-tracking-with-projects/creating-projects/creating-a-project[documentation]). *The project is private (https://docs.github.com/en/issues/planning-and-tracking-with-projects/managing-your-project/managing-visibility-of-your-projects[documentation]) and only accessible to the `@camptocamp/is-devops-stack` team* (https://docs.github.com/en/issues/planning-and-tracking-with-projects/managing-your-project/managing-access-to-your-projects[documentation]).
13+
14+
All the boards and tables have also been created manually. In the settings of the project, there are automation workflows (https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/using-the-built-in-automations[documentation]) that move the Issues and PRs around depending on their status (open, closed, merged, etc.).
15+
16+
== Adding a PR/Issue to the Project
17+
18+
Since there are some limits on how many repositories we can add to a project using the default workflows, we were forced to automate this process using a GitHub workflow, as suggested on the https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/automating-projects-using-actions#example-workflow-authenticating-with-a-github-app[official documentation].
19+
20+
Although the official documentation explicitly calls the API with `gh` commands, we opted to use an official GitHub Action (https://github.com/actions/add-to-project)[`actions/add-to-project`] to accomplish this. Moreover, in order to allow the workflows to modify the project we needed to create a GitHub app that the sole purpose is providing the necessary permissions to the workflows.
21+
22+
=== DevOps Stack Project App
23+
24+
The app is called `DevOps Stack Project` and is available https://github.com/apps/devops-stack-project[here] (note that since the app is private you won't probably be able to see it unless you are an administrator of our organization).
25+
26+
This app was created on our organization by an administrator and is configured with a limited scope of permissions: it can only access the projects of the organization where it is installed as well as the PRs and Issues of repositories on which it is installed (https://docs.github.com/en/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app[official documentation] on how to create a GitHub app).
27+
28+
After the app creation, an administrator was needed to install it on the organization and all the repositories of the DevOps Stack. This was done by going to the app page and clicking on the `Install` button then configuring the proper settings after installation (all this is done on the organization settings, check the https://docs.github.com/en/apps/maintaining-github-apps/installing-github-apps#installing-your-private-github-app-on-your-repository[official documentation]).
29+
30+
IMPORTANT: The reason to not install the app on all the repositories by default was to further limit the scope of the app, although *this adds the burden of installing it on each repository manually every time a new repository of the DevOps Stack is created*.
31+
32+
=== Centralized Workflow
33+
34+
The workflow definition is available in the {url-main-repo}/blob/main/.github/workflows/modules-release-please.yaml[main repository].
35+
36+
[source,yaml]
37+
----
38+
---
39+
# GitHub Actions workflow to automatically push PRs and issues to the DevOps Stack project board.
40+
#
41+
# IMPORTANT: This workflow is called by other workflows in our DevOps Stack repositories and it is centralized here in
42+
# order to be easily maintained across modules. Because of this, please make sure you're not introducing any breaking
43+
# changes when modifying this workflow.
44+
45+
name: "pr-issues-project"
46+
47+
on:
48+
workflow_call:
49+
secrets:
50+
PROJECT_APP_PRIVATE_KEY:
51+
description: "GitHub App private key for the DevOps Stack Project app"
52+
required: true
53+
54+
issues:
55+
types:
56+
- opened
57+
- reopened
58+
59+
pull_request:
60+
types:
61+
- opened
62+
- reopened
63+
64+
jobs:
65+
add-to-project:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Generate authentication token from GitHub App
69+
id: generate_token
70+
uses: tibdex/github-app-token@v1
71+
with:
72+
app_id: 322306
73+
private_key: ${{ secrets.PROJECT_APP_PRIVATE_KEY }}
74+
75+
- name: Add PR or issue to DevOps Stack project board
76+
uses: actions/add-to-project@v0.5.0
77+
with:
78+
project-url: https://github.com/orgs/camptocamp/projects/3/
79+
github-token: ${{ steps.generate_token.outputs.token }}
80+
----
81+
82+
NOTE: It is the step _Generate authentication token from GitHub App_ that uses the GitHub app created above in order to generate a token with the proper permissions that is then passed to the _Add PR or issue to DevOps Stack project board_ step.

docs/modules/ROOT/pages/contributing/release.adoc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,19 @@ The workflow definition available in the {url-main-repo}/blob/main/.github/workf
2727
# order to be easily maintained across modules. Because of this, please make sure you're not introducing any breaking
2828
# changes when modifying this workflow.
2929
30-
name: "Release Modules"
30+
name: "modules-release-please"
3131
3232
on:
3333
workflow_call:
3434
3535
jobs:
3636
release-please:
37-
runs-on: "ubuntu-latest"
37+
runs-on: ubuntu-latest
3838
steps:
39-
- uses: "google-github-actions/release-please-action@v3"
39+
- uses: google-github-actions/release-please-action@v3
4040
with:
41-
release-type: "simple"
41+
release-type: simple
42+
pull-request-title-pattern: "chore: release ${version}"
4243
bump-minor-pre-major: true
4344
extra-files: |
4445
variables.tf
@@ -59,7 +60,7 @@ The caller workflow on every module simply points to this workflow and is set to
5960
[source,yaml]
6061
----
6162
---
62-
name: "Release"
63+
name: "release-please"
6364
6465
on:
6566
push:
@@ -68,7 +69,7 @@ on:
6869
6970
jobs:
7071
release:
71-
uses: camptocamp/devops-stack/.github/workflows/modules-release-please.yaml@master
72+
uses: camptocamp/devops-stack/.github/workflows/modules-release-please.yaml@main
7273
----
7374

7475
NOTE: Our {url-template-repo}/blob/main/.github/workflows/release-please.yaml[module template] already contains this workflow definition, but with a caveat. To avoid creating releases on the template itself, it was deactivated and you need to re-activate it when creating a new module. The comments on the file are self-explanatory.

0 commit comments

Comments
 (0)