fep

FEP-7d8c: Documentation: Automation of FEP

Summary

This FEP discusses scripts and woodpecker configuration used to automate parts of the FEP process. The FEP process is described in FEP-a4ed.

As FEP-a4ed, this is a living document, and should be updated as the FEP process evolves.

Vision

Automation has the goal of reducing the burden on facilitators by:

Once one has simplified this job, one can seek broader adoption of the FEP process..

Todos

This is a living document. So let’s have a todo list

The first two items have been on my personal todo list for a long time, and might stay there … so feel free to pick them up.

Automation

Automation for the FEP repository uses the codeberg woodpecker. There are two jobs:

Automation code is written in python and is contained in the script folder.

Scripts and tests

FEP uses python scripts to manage some aspects of it. These should be runnable without installing packages. In order to ensure these scripts stay working, include them in .woodpecker/test.yml

Configuration variables

To be able to do these configuration tasks, you need to be in the admin group. See the first discussion here.

The configuration .woodpecker/readme.yml uses two secrets:

Furthermore, the environment variable CI_REPO_CLONE_SSH_URL is used see woodpecker documentation.

We will now discuss how to obtain these secrets.

The api token

API tokens can be generated on codeberg under user settings -> applications -> select permissions -> issue: Read and Write and giving it a name. They are hexstrings with 40 characters (if I counted correctly), e.g.

33104dd6847e87ef3d6925effdfc852349233034

Deploy key

As already mentioned the deploy key is an ssh key. One can generate these on linux via

ssh-keygen -t ed25519 -f deploy_key

Do not specify a passphrase. Examples:

$ cat deploy_key
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACCQ5XqPCdvHPHsukhPS+RMDpMnOCCLW0csGGoFgijQRiwAAAJDpM7fx6TO3
8QAAAAtzc2gtZWQyNTUxOQAAACCQ5XqPCdvHPHsukhPS+RMDpMnOCCLW0csGGoFgijQRiw
AAAEB2ofBDBwUcZs5FHsaFMvyO95Qrvn8+PO3BchraucMRwJDleo8J28c8ey6SE9L5EwOk
yc4IItbRywYagWCKNBGLAAAADWhlbGdlQHJhaW5ib3c=
-----END OPENSSH PRIVATE KEY-----
$ cat deploy_key.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJDleo8J28c8ey6SE9L5EwOkyc4IItbRywYagWCKNBGL helge@rainbow

The public key deploy_key.pub should be added to the codeberg repo under settings -> deploy keys -> add deploy key and checking the enable write access checkbox.

See here.

Adding the secrets to woodpecker

One can add these secrets on woodpecker, then selecting the settings wheel -> secrets -> add secret. The secrets only need to available for the push action (corresponding to a merged pull request).

The deploy_key needs to be end with a new line when pasting into the woodpecker ui.

Development

The tools are located in the scripts folder, with the scripts/fep_tools folder containing the python package fep_tools. Most of this tooling only uses python, e.g. scripts/new_proposal.py and scripts/create_readme.md, so they can be run from any environment.

Running tests

To run the tests, one needs pytest. We note that the tests run from the base folder. The following commands demonstrate how to setup a virtual environment, install the dependencies, and run the tests.

python -mvenv .venv
pip install ./scripts
pytest

One can leave the venv, by running deactivate.

Building the website

To build the website, first install the dependencies

python -mvenv .venv
pip install ./scripts
./scripts/create_site_pages.py

Then run mkdocs via

mkdocs serve --config-file scripts/mkdocs.yml

References:

Automatic deployment

See website.yml.

Changes

References

CC0 1.0 Universal (CC0 1.0) Public Domain Dedication

To the extent possible under law, the authors of this Fediverse Enhancement Proposal have waived all copyright and related or neighboring rights to this work.