Skip to content

CXP-756 Attach ChildResourceType to emitted org/OU resource#136

Open
JavierCarnelli-ConductorOne wants to merge 2 commits into
mainfrom
fix/cxp-756
Open

CXP-756 Attach ChildResourceType to emitted org/OU resource#136
JavierCarnelli-ConductorOne wants to merge 2 commits into
mainfrom
fix/cxp-756

Conversation

@JavierCarnelli-ConductorOne

Copy link
Copy Markdown
Contributor

The SDK's syncer schedules child-resource crawls by reading a ChildResourceType annotation off each emitted resource instance, not off the registered ResourceType. organizationResource() and organizationalUnitResource() only declared it on the ResourceType, so the OU crawl never fired: organizational_unit sync count was always 0, and accounts re-parented under an OU ended up with a dangling parent pointing at a resource that was never emitted.

Attach the annotation to each emitted org/OU resource instance, mirroring the working account.go -> permission_set_assignment pattern, and drop the now-dead (and misleading) annotation from the ResourceType definitions. Add regression tests asserting the annotation the syncer actually checks is present on emitted resources.

…ces (CXP-756)

The SDK's syncer schedules child-resource crawls by reading a
ChildResourceType annotation off each emitted resource instance, not off
the registered ResourceType. organizationResource() and
organizationalUnitResource() only declared it on the ResourceType, so the
OU crawl never fired: organizational_unit sync count was always 0, and
accounts re-parented under an OU ended up with a dangling parent pointing
at a resource that was never emitted.

Attach the annotation to each emitted org/OU resource instance, mirroring
the working account.go -> permission_set_assignment pattern, and drop the
now-dead (and misleading) annotation from the ResourceType definitions.
Add regression tests asserting the annotation the syncer actually checks
is present on emitted resources.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jul 17, 2026

Copy link
Copy Markdown

CXP-756

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Connector PR Review: CXP-756 Attach ChildResourceType to emitted org/OU resource

Blocking Issues: 0 Suggestions: 0 Threads Resolved: 0
Criteria: loaded ci-review.md from trusted base 454b454
Review mode: incremental since 947a3d7
View review run: https://github.com/ConductorOne/baton-aws/actions/runs/29608040712

Review Summary
The full PR diff was scanned for security and correctness. The new commit re-adds the ChildResourceType annotation on resourceTypeOrganization and resourceTypeOrganizationalUnit in resource_types.go so capabilities metadata reflects the OU hierarchy, complementing the instance-level annotations in organization.go that actually drive the child crawl. The instance-level annotations, ResourceType-level annotations, and their comments are internally consistent, with organizational_unit referenced in both places; the organizationalUnitResource.List recursion guard is unchanged and correctly bounded; and the change is covered by two focused regression tests. Docs already document these opt-in resource types and their required scopes, so no doc drift. No new issues found.

Security Issues
None found.

Correctness Issues
None found.

Suggestions
None.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blocking issues found.

@mateoHernandez123 mateoHernandez123 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM! 🚀

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blocking issues found.

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.

3 participants