Skip to content

feat(comp): add eventual state to comp command; fix ineffective test#319

Merged
jcogilvie merged 6 commits into
mainfrom
comp-eventual
May 18, 2026
Merged

feat(comp): add eventual state to comp command; fix ineffective test#319
jcogilvie merged 6 commits into
mainfrom
comp-eventual

Conversation

@jcogilvie
Copy link
Copy Markdown
Collaborator

@jcogilvie jcogilvie commented May 11, 2026

Description of your changes

Fixes #318

I have:

  • Read and followed Crossplane's contribution process.
  • Run earthly -P +reviewable to ensure this PR is ready for review.
  • Added or updated unit tests.
  • Added or updated e2e tests. (Added and fixed some ITs)
  • Documented this change as needed.
  • Followed the API promotion workflow if this PR introduces, removes, or promotes an API.

Need help with this checklist? See the cheat sheet.

jcogilvie added 3 commits May 11, 2026 18:29
Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
@jcogilvie jcogilvie marked this pull request as ready for review May 12, 2026 16:28
Copilot AI review requested due to automatic review settings May 12, 2026 16:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds --eventual-state support to the comp command so composition impact analysis can simulate iterative reconciliation (surfacing later-stage resources gated by e.g. function-sequencer), and updates/extends integration tests + fixtures to validate the behavior.

Changes:

  • Add --eventual-state flag to crossplane-diff comp and wire it into the shared diff processor options.
  • Expand integration tests to cover staged gating behavior for both xr and comp with/without eventual-state, and add structured JSON assertions for comp output.
  • Add documentation and new test fixtures (compositions, revisions, XRs) to support the new scenarios.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cmd/diff/comp.go Adds --eventual-state flag to comp and passes it into processor options.
cmd/diff/diff_integration_test.go Extends harness and adds paired tests validating eventual-state behavior for xr and comp.
README.md Documents --eventual-state usage and updates flag descriptions.
cmd/diff/testdata/diff/resources/* Adds/updates compositions, revisions, and XR fixtures for gating/eventual-state scenarios.
cmd/diff/testdata/comp/* Adds updated composition fixtures and pre-existing XR fixtures for comp impact tests.
.serena/project.yml Updates Serena project configuration comments and adds additional_workspace_folders.
.requirements/.../REQUIREMENTS.md Adds requirements/plan documentation for the feature (design record).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

expectedStructuredOutput *tu.ExpectedDiff // for XR JSON output assertions
expectedStructuredCompOutput *tu.ExpectedCompDiff // for comp JSON output assertions
}

Comment on lines +314 to +317
if tt.outputFormat == "json" && tt.expectedStructuredCompOutput != nil {
tu.AssertStructuredCompDiff(t, outputStr, tt.expectedStructuredCompOutput)
return
}
Comment on lines +49 to +69
{{- with .observed.resources -}}
{{- with (index . "stage0-resource") -}}
{{- with .resource.status.conditions -}}
{{- range . -}}
{{- if and (eq .type "Ready") (eq .status "True") }}
---
apiVersion: ns.nop.example.org/v1alpha1
kind: XDownstreamResource
metadata:
name: 1-stage1-resource
namespace: {{ $.observed.composite.resource.metadata.namespace }}
annotations:
gotemplating.fn.crossplane.io/composition-resource-name: stage1-resource
spec:
forProvider:
configData: {{ $.observed.composite.resource.spec.coolField }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
@jcogilvie jcogilvie added build-artifacts PRs with this label get artifacts build by CI labels May 12, 2026
Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Copilot AI review requested due to automatic review settings May 18, 2026 19:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Comment thread README.md
Comment on lines +183 to +185
--max-iterations=20 Maximum render iterations for requirements resolution
or eventual-state simulation. Increase for complex
pipelines that need more cycles to converge.
Comment on lines 56 to 60
ignorePaths []string // Paths to ignore in diffs
functionCredentials string // Path to function credentials file (optional)
eventualState bool // For XR tests: enable eventual state simulation (optional)
timeout time.Duration // Custom timeout for this test (0 = use default)
skip bool
Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
@jcogilvie jcogilvie merged commit 3a20cea into main May 18, 2026
12 checks passed
@jcogilvie jcogilvie deleted the comp-eventual branch May 18, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-artifacts PRs with this label get artifacts build by CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Diff output with compo does not show the resources in later state from function-sequencer

2 participants