Version: 0.3
Architecture
Pullup consists of two components: webhook and controller.
#
WebhookThe webhook listens to GitHub events.
When the webhook receive a event, it will lookup webhooks by the repositories
array.
- When a pull request is opened or reopened, the webhook will create a new
ResourceSet
based onWebhook
. - When a pull request is updated, the webhook will update the existing
ResourceSet
. - When a pull request is closed or merged, the webhook will delete
ResourceSet
matching the labelswebhook-name
andpull-request-number
.
#
ControllerThe controller monitors changes of Webhook
and ResourceSet
.
#
Webhook- When a
Webhook
is updated, the controller will updatespec.resources
inResourceSet
matching the labelwebhook-name
.
#
ResourceSet- When a
ResourceSet
is created, the controller will find the original resources byapiVersion
,kind
andmetadata.name
.- If the resources exist, the controller will merge the
resources
array into the original resources and create resources using the merged result. - If the resources does not exist, the controller will create resources using the
resources
array directly.
- If the resources exist, the controller will merge the
- When a
ResourceSet
is updated, the controller will also merge the current resource before merging theresources
array.
#
Merge Strategy- Map
- Replace existing keys with new values.
- Copy new keys.
- Array
- If all elements in the array contain
name
key, the array will be merged using thename
key. - Otherwise, replace with new values.
- If all elements in the array contain
Structured Merge and Diff may be implemented in the future.