RunBefore and RunAfter
Created by: malomarrec
Problem
When I run a campaign spec, there are some things I want to do before (setup) and after (cleanup, message passing). One way is to build a wrapper around the CLI (great!). For smaller use cases, having something builtin might be helpful.
For example: Before
- Check that environment variables are set (eg. with token) before running the spec
- Check that other systems are ready (eg. a Jira server is attainable) After
- start a script that links tickets with the PRs I have created
- clean up errors (eg. creating a Jira ticket failed due to permission errors)
Solution
This section is a dump of thoughts, not necessarily the right solution.
- Have
runAfter
andrunBefore
in the campaign spec, that allows you to trigger something else. This could trigger setup scripts locally, and cleanup or messaging script. - Have an eventHook on the sourcegraph instance, that sends the status of the PR, as described here https://github.com/sourcegraph/src-cli/issues/487#issuecomment-791907780