Skip to content

Conversation

@xh3b4sd
Copy link
Contributor

@xh3b4sd xh3b4sd commented Sep 23, 2025

@xh3b4sd xh3b4sd self-assigned this Sep 23, 2025
"github.com/google/go-cmp/cmp"
)

func Test_Cache_Object_Drift(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +1 to +6
package logging

// Active defines this worker handler to always be executed.
func (l *Logging) Active() bool {
return true
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a dedicated operator function for logging some information. That code separation makes everything cleaner and easier to work with.

Comment on lines 1 to 8
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"
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we wire up the operator chain.


{
pre.Labels.Hash = hash.New(bra)
pre.Labels.Pull = pul
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we get the pull request number for later use. The internal labels struct is our way of communicating state across the reconciliation loop.

Comment on lines +219 to +221
if y.RolloutState == types.DeploymentRolloutStateCompleted {
return aws.ToString(y.TaskDefinition)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is where most of the status update reconciliation is happening.

@xh3b4sd xh3b4sd marked this pull request as ready for review September 24, 2025 12:02
@xh3b4sd xh3b4sd merged commit 697a2af into main Sep 24, 2025
3 checks passed
@xh3b4sd xh3b4sd deleted the status branch September 24, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant