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

feat: terminology added #184

Merged
merged 12 commits into from
Oct 18, 2023
28 changes: 21 additions & 7 deletions docs/maintainers/setting-up-a-new-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ For the purpose of this tutorial, our target demo repository will be called `ope

The steps described here mirror [open-sauced/check-engines](https://github.com/open-sauced/check-engines).

The octoherd scripts assume you have exported a programatic token similar to:
The octoherd scripts assume you have exported a programmatic token similar to:

```shell
export GH_TOKEN="ghp_Q8TZZT9ypgqw3EeABoCWPcwZBHpjZJ9hI42n"
```

## Creating a new repo

Don't spend too much time thinking of a name or a catchy description, just set license to MIT and rocket jump!
Don't spend too much time thinking of a name or a catchy description, just set the license to MIT and rocket jump!

![create a new repository](../../static/img/contributing-maintainers-create-repository.png)

Expand Down Expand Up @@ -59,16 +59,30 @@ Then go back to your repository and delete:
- πŸ‘€ needs-triage (green background one)
- other potential duplicates if the above race condition is different

> In this context, `race condition` refers to a situation where multiple labels are being deleted simultaneously. This can cause issues if the order in which the labels are deleted affects the final outcome. Therefore, it's important to ensure that the deletion of labels is properly synchronized and controlled to avoid any race conditions.

In other words, if two of the directories (e.g., `πŸ‘€ needs-triage` and `documentation` are deleted at the same, it is possible that the third directory(`potential duplicates`) will not be deleted.
To avoid the `race condition`, the code must delete the directories in a specific order. For example, it could delete the `documentation directory` first, then the `πŸ‘€ needs-triage` directory, and then the other `potential duplicates` directory.

Here is an example of how to delete the directories in a specific order:
```bash
rm -rf documentation
rm -rf πŸ‘€-needs-triage
rm -rf other-potential-duplicates
```
This code will ensure that all three directories are deleted, even if the code is interrupted while it is running.
Lymah123 marked this conversation as resolved.
Show resolved Hide resolved


## Syncing branch protections with opensauced.pizza

This topic is more complex but in a sense tap the main branch and enable
everything except "Restrict who can dismiss pull request reviews" and "Restrict who can push to matching branches" in the first section.

![maximum merge protections](../../static/img/contributing-maintainers-merge-protections.png)

The "Rules applied to everyone including administrators" is more on an unused override.
The "Rules applied to everyone including administrators" is more of an unused override.

Most of the time this process is super manual but in the limited cases where we need this run:
Most of the time, this process is super manual, but in the limited cases where we need this run:

```shell
npx @octoherd/script-sync-branch-protections \
Expand All @@ -85,14 +99,14 @@ Pull requests require [triage](https://github.com/open-sauced/open-sauced/blob/m

Most `node` projects will require [release automation](https://github.com/open-sauced/open-sauced/blob/main/.github/workflows/release.yml) powered by [@open-sauced/semantic-release-conventional-config](https://github.com/open-sauced/semantic-release-conventional-config).

Other [development workflows](https://github.com/open-sauced/open-sauced/tree/main/.github/workflows) are less common and opinionated towards decentralised collaboration. Use these as example backbones for your new repository.
Other [development workflows](https://github.com/open-sauced/open-sauced/tree/main/.github/workflows) are less common and opinionated towards decentralized collaboration. Use these as examples of backbones for your new repository.

## Setting up environments and secrets

As you may have noticed in the previous step or in the actions visualisations, the release workflows enable named environments.
As you may have noticed in the previous step or in the action visualizations, the release workflows enable named environments.

These have to be manually set up, along with their secrets and branch protections.

![create environment](../../static/img/contributing-maintainers-env.png)

If using `npm` or `ghcr` it is likely you will add a couple variables here.
If using `npm` or `ghcr`, it is likely you will add a couple of variables here.