chore: make deployment workflow manual and add a reminder in pr template #95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In a previous PR, I added a workflow that was meant to run before any release and which purpose is to use the constructs in a simple real-world deployment that we immediately destroy, before actually doing a release, to do a basic sanity check.
The system doesn't work. As basic as it may sound, it's actually not easy to set that up.
I recap. We have a long and costly job (deployment) that we want to run only if a release is about to happen. I contemplated two options to implement this :
Add two steps before the
Maybe Release
step (that does the release) :Check if release is going to happen
, which would produce a boolean output variable calledRELEASE_IS_GOING_TO_HAPPEN
, and a subsequent step calledDeploy if release is going to happen
, that runs a deployment ifRELEASE_IS_GOING_TO_HAPPEN
is true. Unfortunately, there is no, afaik, any supported functionality insemantic-release
to obtain this kind of information. People are grabbing thestdout
ofsemantic-release
and parsing it to know if a release is about to happen, and although it can work, I tried, and : it makes the code complicated, and what if someone bumpssemantic-release
in the future without knowing that it's going to change thestdout
?Use
merge_queues
, which is a github feature that allows one to have merges added to a queue when someone clicks on 'merge' in a PR and then selected checks can happen in the queue. This would work nicely but unfortunately prevents our automated release system from functioning entirely, since the release bot can't push tomain
anymore. Maybe a solution to that is a two-branch system (merge first tostaging
with merge queues and the release bot picks up what's instaging
) but that adds complexity.I shouldn't spend more time on this. So I am going with the sub-optimal third option which is to have a human in the loop : the deployment workflow is to be triggered manually on the console at each PR that contains code changes. I am adding a warning in a pull request template to remind people.