Skip to content

Commit 3a7fa13

Browse files
authored
About this repo documentation (h5bp#2784)
1 parent 082bac8 commit 3a7fa13

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed

docs/about-this-repo.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# About This Repo
2+
3+
This document outlines the configuration of this repo as well as the basic
4+
process we use to manage the project. As Github has matured as a platform
5+
and HTML5 Boilerplate has matured as a project there are a lot of lessons
6+
to be learned from the way we run the show here.
7+
8+
## GitHub configuration
9+
10+
This section will go through the way we configure the repo in GitHub.
11+
Open source projects get the full power of the platform and as a project
12+
we like to experiment with new GitHub features. Our current configuration
13+
might help you figure out some things you want to do in your own projects.
14+
15+
### General Configuration
16+
17+
This section outlines the basic configuration options we use.
18+
19+
* We have a stub of a Wiki still, so we have wikis turned on. The most
20+
interesting page that remains is a history of the project written several
21+
years ago.
22+
* We use the Issues feature heavily. We don't yet have Issue Templates set
23+
up, but we do have adding them as an issue, so we'll take advantage of them
24+
at some point.
25+
* Discussions are enabled, but they haven't been very useful so far.
26+
27+
### Pull Requests
28+
29+
The most visible portion of our configuration is the way we handle pull
30+
requests. At the most basic level, we require pull requests to add code
31+
to the repo and require a review to merge code. In addition we run several
32+
code quality checks on every pull request to make sure we're not introducing
33+
anything we don't want into the codebase.
34+
35+
We take advantage of the "draft" feature for PRs. This way we have visibility
36+
throughout the life of the PR.
37+
38+
Let's take a look at how we configure our `main` branch.
39+
40+
#### `main`
41+
42+
`main` is the default branch and is our only protected branch. We use feature
43+
branches to add features and/or fix issues in the codebase. Other project
44+
configurations might require a long-running, similarly protected, `development`
45+
branch but for us the single protected `main` branch is enough for our
46+
purposes.
47+
48+
49+
Our branch protection rules are as follows:
50+
51+
* We require a pull request (PR) with one approving reviewer to merge code
52+
* In addition to the PR and approving reviewer, we require three status checks
53+
to pass before code can be merged
54+
* Build with Node 16
55+
* Build with Node 14
56+
* LGTM analysis: JavaScript
57+
* We *allow* force pushes for project admins. While force pushes can create
58+
some head scratching moments for people who have cloned the repo and update
59+
before and after the force push, the ability to clean up the `HEAD` of a
60+
public branch like this in an emergency is useful.
61+
62+
#### GitHub Actions and Other Checks That Run on `main`
63+
64+
* We run a simple *build status* check. This is the most basic test you can run
65+
and is absolutely vital. If you can't build your project you're in trouble.
66+
Currently we're testing against Node 14 and 16.
67+
* We take advantage of our access to *CodeQL analysis* Free for research and
68+
open source don't you know :) We don't have a ton of surface area to cover,
69+
but it's nice to have this powerful code scanning tool available to us.
70+
* We run a *dependency review* scan to see if any newly added dependencies add
71+
known security flaws. This is important for even us, but for a project that
72+
uses a larger number of third party dependencies, this sort of check is vital.
73+
* Since we're fan of the "belt and suspenders" approach to security, we also
74+
run a *LGTM.com* scan as well as the CodeQL scans. This tool, built on top of
75+
CodeQl can shake out different issues so it's nice to have the pair.
76+
* We push any changes to `main` to our [HTML5\-Boilerplate Template Repo](https://github.com/h5bp/html5-boilerplate-template)
77+
78+
Since we've talked about some of our Actions, let's look at the full configuration
79+
of our `.github` folder.
80+
81+
### .github Folder
82+
83+
* workflows
84+
* `build-dist.yaml` is currently broken. We can't push to `main` without a
85+
code review, so this task is blocked. What I would like, (are you there,
86+
GitHub, it's me, Rob) is to allow Actions to bypass branch protection
87+
rules. I think we'll have to basically write a mini-bot that opens a PR
88+
whenever there are changes to `main` and then pushes to the same branch
89+
until the PR is closed. In some ways that will be better as it will be less
90+
noisy in terms of bot pushes to main.
91+
* `codeql-analysis.yml` controls our CodeQL action. We use the defaults. If
92+
you're building something with more JAvaScript footprint, you can tweak
93+
the settings for this job.
94+
* `dependency-review.yml` does what it says on the tin- it tests newly
95+
introduced dependencies for vulnerabilities.
96+
* `publish.yaml` is the action that publishes all the various versions of
97+
the project. When we create a new tag and push it to GitHub, this script
98+
publishes our npm package and creates a GitHub release and attaches a zip
99+
file of our `dist` folder.
100+
* `push-to-template.yaml` pushes the `HEAD` of `main` to our template repo
101+
* `spellcheck.yml` automatically checks markdown files for typos with cSpell.
102+
* `test.yaml` runs our test suite.
103+
* `CODE_OF_CONDUCT.md` is our Code of Conduct, based on
104+
[Contributor Covenant.](https://www.contributor-covenant.org/)
105+
* `CONTRIBUTING.md` contains our contribution guidelines.
106+
* `ISSUE_TEMPLATE.md`is our new issue boilerplate.
107+
* `PULL_REQUEST_TEMPLATE.md`is our new PR boilerplate.
108+
* `SUPPORT.md`points people to different (non-HTML5-Boilerplate) support
109+
resources
110+
* `dependabot.yml`is our Dependabot configuration. We do `npm`, monthly on
111+
two separate `package.json` files, one in `src` and one in project root.
112+
113+
---
114+
115+
That covers most of the interesting GitHub features and functionality that we
116+
use. We're going to continue to keep this document up to date as we change
117+
things or new GitHub features.

0 commit comments

Comments
 (0)