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

Add webhook/trigger events #75

Closed
cumuru opened this issue Jun 28, 2018 · 4 comments
Closed

Add webhook/trigger events #75

cumuru opened this issue Jun 28, 2018 · 4 comments
Milestone

Comments

@cumuru
Copy link

cumuru commented Jun 28, 2018

To reduce server load and increase responsiveness I suggest to add two things:

  1. a webhook endpoint for triggering satis updates on single repositories (e.g. for Github)
  2. an event triggered by satisfy that updates packages.json once a new repository is added (or removed or updated)

In depth:
1)

  • An event should fire on every action that modifies the set of repositories. Might trigger a complete rebuild maybe (opinions?)

My goal is to have three ways of updating packages.json:

  • A push webhook that rebuilds a single repo
  • An event that rebuild a single repo or everything
  • A cronjob that runs maybe once a day, just in case any change is missed by the above measures.

See #45.

@cumuru
Copy link
Author

cumuru commented Jun 28, 2018

Some input for implementation:

  • satis consumes (on CLI) a param --repository-url=ssh://[email protected]/pathto/repo.git to update a single repo only
  • working Regex to normalize SSH repo uri (Github):
    preg_replace('/^(\w+@)?([\w\.]+)(:\d+)?:(.*)$/', 'ssh://$1$2$3/$4')
    ($1 = user, $2 = host, $3 = port, $4 = repository path)
  • composer package dealing with Github API (signature validation and payload normalization): https://packagist.org/packages/swop/github-webhook
  • One could iterate over satis.json‘s repositories to whitelist incoming push events.

@ramunasd ramunasd added this to the 3.1 milestone Jun 28, 2018
@ramunasd
Copy link
Collaborator

ramunasd commented Aug 6, 2018

Bitbucket webhook example:
mtomala@a10c1df

A lot of duplicated code, but principe on itself is clear.

@ramunasd
Copy link
Collaborator

ramunasd commented Sep 2, 2018

Currently satis build with repository filter throws exception.
composer/satis#493

ramunasd added a commit that referenced this issue Oct 21, 2018
@ramunasd
Copy link
Collaborator

ramunasd commented Dec 3, 2018

Implemented & tested against real VCS.

@ramunasd ramunasd closed this as completed Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants