Conversation
| "github.com/google/go-cmp/cmp" | ||
| ) | ||
|
|
||
| func Test_Cache_Object_Drift(t *testing.T) { |
There was a problem hiding this comment.
I moved the Drift method as property of the release artifact / cache object to have it reusable. Those tests here just moved package. We had them already in a different place.
| package logging | ||
|
|
||
| // Active defines this worker handler to always be executed. | ||
| func (l *Logging) Active() bool { | ||
| return true | ||
| } |
There was a problem hiding this comment.
I created a dedicated operator function for logging some information. That code separation makes everything cleaner and easier to work with.
| package status | ||
|
|
||
| // Active defines this worker handler to always be executed. | ||
| // Active defines this worker handler to only be executed within the testing | ||
| // environment, because we do not allow preview deployments to be injected in | ||
| // e.g. staging nor production. | ||
| func (s *Status) Active() bool { | ||
| return true | ||
| return s.env.Environment == "testing" | ||
| } |
There was a problem hiding this comment.
This new operator function for the preview status only runs in the testing environment, which is the same behaviour like the preview operator function.
| // deployment status. | ||
| // | ||
| {o.infrastructure, o.status}, | ||
| {o.infrastructure, o.logging, o.status}, |
There was a problem hiding this comment.
Here we wire up the operator chain.
|
|
||
| { | ||
| pre.Labels.Hash = hash.New(bra) | ||
| pre.Labels.Pull = pul |
There was a problem hiding this comment.
Here we get the pull request number for later use. The internal labels struct is our way of communicating state across the reconciliation loop.
| if y.RolloutState == types.DeploymentRolloutStateCompleted { | ||
| return aws.ToString(y.TaskDefinition) | ||
| } |
There was a problem hiding this comment.
Here we fix the current state lookup in the sense that we now only acknowledge the new current state if it comes from a successful deployment.
The result is that we keep the Updating state in the status updates until the new deployment finishes. And so the issue comments in our pull requests will more accurately reflect the status of the preview deployments.
| marker = "<!-- kayron:preview:status -->" | ||
| ) | ||
|
|
||
| func (s *Status) preview() error { |
There was a problem hiding this comment.
Here is where most of the status update reconciliation is happening.
Towards https://linear.app/splits/issue/PE-4789/enable-deployment-status-updates-for-preview-deployments.
We can see this working in 0xSplits/splits-lite#44.