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

tree: add new config-bot service #3

Merged
merged 2 commits into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config-bot/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM registry.fedoraproject.org/fedora:30

RUN dnf -y install git python3-toml python3-aiohttp && dnf clean all

COPY main /usr/lib/config-bot/main
COPY config.toml /etc/config-bot.toml

CMD /usr/lib/config-bot/main
41 changes: 41 additions & 0 deletions config-bot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# config-bot

config-bot performs automated management tasks on the main
[fedora-coreos-config](https://github.com/coreos/fedora-coreos-config)
repo.

It performs three closely related, but mostly independent
functions. The names below reflect each of those functions.
One can find their corresponding configuration section in
`config.toml` and function names in `main`.

1. `sync-build-lockfiles`: watches for new builds on a set
of streams, and pushes the generated lockfile to their
corresponding branches
2. `promote-lockfiles`: on some configurable interval,
pushes lockfiles from one config branch to another
3. `propagate-files`: watches for pushes to a config branch
and propagates changes to a subset of files to a set of
target branches.

All these are currently timer-based. In the future, they
will use fedora-messaging for triggering.

Similarly, for now all changes are done using `git push`. In
the future, config-bot PR functionality can be added.

## Testing locally

Tweak settings as appropriate in `config.toml`, e.g.:
- point to your fork of `fedora-coreos-config`
- use your own GitHub token
- you can comment out whole sections if you'd like to test a
specific function only; e.g. if you only want to test
`promote-lockfiles`, you can comment out
`sync-build-lockfiles` and `propagate-files`
jlebon marked this conversation as resolved.
Show resolved Hide resolved

Then:

```
./main --config myconfig.toml
```
36 changes: 36 additions & 0 deletions config-bot/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[git]
author.name = 'CoreOS Bot'
author.email = '[email protected]'
github.repo.owner = 'coreos'
github.repo.name = 'fedora-coreos-config'
github.token.username = 'coreosbot'
github.token.path = '/var/run/secrets/coreos.fedoraproject.org/github-token/token'

[sync-build-lockfiles]
builds-base-url = 'https://builds.coreos.fedoraproject.org/prod/streams'
streams = [
'bodhi-updates',
]
trigger.mode = 'periodic'
trigger.period = '15m'
method = 'push'

#[promote-lockfiles]
#source-ref = 'bodhi-updates'
#target-ref = 'testing-devel'
#trigger.mode = 'periodic'
#trigger.period = '24h'
#method = 'push'

[propagate-files]
source-ref = 'testing-devel'
target-refs = [
'bodhi-updates',
]
skip-files = [
'manifest.yaml',
'manifest-lock.*',
]
trigger.mode = 'periodic'
trigger.period = '15m'
method = 'push'
Loading