Skip to content

Optimize role principal data in schedule-instance exports - #1600

Open
Naga Praneeth Chukka (praneeth-0000) wants to merge 3 commits into
devfrom
optimize-schedule-instances
Open

Naga Praneeth Chukka (praneeth-0000) wants to merge 3 commits into
devfrom
optimize-schedule-instances

Conversation

@praneeth-0000

@praneeth-0000 Naga Praneeth Chukka (praneeth-0000) commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Reduce schedule-instance payload size by expanding principals with only their IDs.
  • Resolve and cache the minimal principal details needed for role processing across export pages.
  • Handle users, groups, service principals, agent subtypes, and unresolved principals.
  • Reduce the principal fields retained in the role assignment and eligibility schedule-instance models.
  • Add regression coverage for enrichment, caching, and lookup failures.

Overall result

Export Dev data JSON Branch data JSON Size reduction
Role assignment schedule instances 568,483 B 44,551 B 92.2%
Role eligibility schedule instances 1,060,932 B 32,001 B 97.0%

Copilot AI 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.

🟡 Changes recommended

Failed batch-member lookups are cached as completed, preventing enrichment retries on later pages.

1 open finding
What changed in this PR

Reduces schedule-instance export payloads while retaining principal details needed for role processing.

Changes:

  • Requests ID-only principals and enriches them through a shared per-export cache.
  • Trims both schedule-instance models to minimal principal fields.
  • Adds regression coverage for enrichment, caching, and lookup failures.
File Description
src/​powershell/​private/​export/​Resolve-ZtRoleAssignmentPrincipal.ps1 Adds principal resolution and caching.
src/​powershell/​private/​export/​Export-ZtGraphEntity.ps1 Enriches principals before exporting each page.
src/​powershell/​assets/​export-tenant.config.psd1 Enables ID-only expansion and enrichment.
src/​powershell/​assets/​export-model/​RoleEligibilityScheduleInstance-model.json Removes unused principal fields.
src/​powershell/​assets/​export-model/​RoleAssignmentScheduleInstance-model.json Removes unused principal fields.
code-tests/​commands/​Export-ZtGraphEntity.Tests.ps1 Covers principal enrichment and cache behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/powershell/private/export/Resolve-ZtRoleAssignmentPrincipal.ps1 Outdated
Copilot AI balanced review requested due to automatic review settings October 16, 2026 08:49

Copilot AI 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.

🟡 Changes recommended

Later-page lookup recovery leaves earlier saved assignments unresolved, potentially excluding them from downstream role processing.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced

Comment thread src/powershell/private/export/Export-ZtGraphEntity.ps1
Copilot AI balanced review requested due to automatic review settings October 16, 2026 09:55

Copilot AI 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.

🔵 Needs a closer look

Graph response handling and cross-page reconciliation need runtime validation; the regression tests were not executed.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review PR is ready for review and merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants