Skip to content

Conversation

@jirwin
Copy link
Contributor

@jirwin jirwin commented Dec 19, 2025

This adds support for a new sync task that only fetches the resources of a given resource type, as well as discovering any required parent resource types. It explicitly does not sync entitlements or grants.

The sync should be created as a partial/incremental sync.

The primary use case is to quickly fetch an updated resource list when we are waiting for some resource to appear so we can continue on provisioning it access.

I've tested this on the cli with a few connectors, but need to do some rounds of API testing before this is ready to be merged.

- Implemented resource-typed sync task handler in `resource_typed_sync.go`.
- Added support for `SyncResourceTypedType` in task type checks.
- Introduced `localResourceTypedSyncer` for managing resource-typed sync tasks.
- Updated existing task processing logic to accommodate new task type.
- Introduced `WithResourceTypedSync` option for configuring resource-typed sync in the connector runner.
- Added `SyncResourceTypedTask` message to the protocol buffer definition for handling resource-typed sync tasks.
- Implemented validation for `SyncResourceTypedTask` and integrated it into the task processing logic.
- Updated syncer to handle resource-typed sync operations, including syncing entitlements and grants for specific resource types.
- Enhanced CLI commands to accept `sync-resource-type` parameter for initiating resource-typed syncs.
- Updated comments in `state.go` to clarify the purpose of `SyncResourceTypedOp` and `SetupResourceTypedSyncOp`.
- Improved documentation for `resourceTypedSyncID` in `syncer.go` to explain its role in resource-typed incremental sync.
- Added clarification in the `resourceTypeHasChildType` function regarding the retrieval of sample resources and their annotations.
- Renamed `resourceTypedSyncID` to `partialSyncResourceTypeID` across multiple files to reflect the new functionality.
- Updated related functions and CLI commands to use `WithPartialSyncResourceType` for configuring partial syncs.
- Introduced `localPartialSyncResourceType` to handle partial sync tasks, ensuring only resources are synced without entitlements and grants.
- Removed the deprecated `resourceTypedSyncer` implementation to streamline the codebase.
@coderabbitai
Copy link

coderabbitai bot commented Dec 19, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jirwin/resource-type-partial-sync

Comment @coderabbitai help to get the list of available commands and usage tips.

- Added `PartialSyncResourceTypeId` field to `Task_SyncFullTask` for triggering partial syncs of specific resource types.
- Updated getter and setter methods for `PartialSyncResourceTypeId`.
- Modified `fullSyncTaskHandler` to handle partial sync resource type from task or CLI.
- Removed deprecated `resourceTypedSync` implementation to streamline the codebase.
- Updated protocol buffer definitions and validation logic accordingly.
- Replaced `SyncResourceTypedType` with `PartialSyncType` in task type checks to align with new partial sync implementation.
- Removed `partialSyncResourceTypeID` from `fullSyncTaskHandler` and `c1ApiTaskManager` to streamline the codebase.
- Added `partialSyncTaskHandler` to manage partial sync tasks, supporting both targeted resources and resource type modes.
- Introduced `localPartialSync` to handle partial sync operations, ensuring only resources are synced without entitlements and grants.
- Deleted deprecated `partial_sync_resource_type.go` and added new `partial_sync.go` for local partial sync management.
- Removed `partialSyncResourceTypeID` from various components, including the connector runner and CLI commands, to streamline the codebase.
- Replaced `SyncResourceTypedTask` with `SyncPartialTask` in protocol buffers and task processing logic, supporting both targeted resources and resource type modes.
- Updated validation logic and methods to accommodate the new `SyncPartialTask`, ensuring proper handling of partial sync operations.
- Enhanced documentation and comments to clarify the purpose and functionality of the new partial sync implementation.
ActionStatusTask action_status = 118;
CreateSyncDiffTask create_sync_diff = 119;
CompactSyncs compact_syncs = 120;
SyncPartialTask sync_partial = 121;
Copy link
Contributor

@ggreer ggreer Dec 29, 2025

Choose a reason for hiding this comment

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

We should just add attributes to the SyncFullTask so that we don't have to choose a different sync type based on what we want to sync. eg: Right now if you want to sync resources only (not grants or entitlements) that's a SyncFullTask.

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