Skip to content

feat: add custom depth validation and improve project group mapping#6141

Merged
seungyeoneeee merged 4 commits into
cloudforet-io:trusted-account-auto-syncfrom
seungyeoneeee:feature/trusted-account-async-fix
Nov 6, 2025
Merged

feat: add custom depth validation and improve project group mapping#6141
seungyeoneeee merged 4 commits into
cloudforet-io:trusted-account-auto-syncfrom
seungyeoneeee:feature/trusted-account-async-fix

Conversation

@seungyeoneeee

Copy link
Copy Markdown
Contributor

Skip Review (optional)

  • Minor changes that don't affect the functionality (e.g. style, chore, ci, test, docs)
  • Previously reviewed in feature branch, further review is not mandatory
  • Self-merge allowed for solo developers or urgent changes

Description (optional)

  • custom depth per each CSP
image

Things to Talk About (optional)

Signed-off-by: 이승연 <sylee1274@mz.co.kr>
Signed-off-by: 이승연 <sylee1274@mz.co.kr>
Signed-off-by: 이승연 <sylee1274@mz.co.kr>
@seungyeoneeee seungyeoneeee requested a review from Copilot November 6, 2025 01:50
@vercel

vercel Bot commented Nov 6, 2025

Copy link
Copy Markdown

@seungyeoneeee is attempting to deploy a commit to the cloudforet Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Nov 6, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
console Ignored Ignored Preview Nov 6, 2025 2:20am
web-storybook Ignored Ignored Nov 6, 2025 2:20am

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

Pull Request Overview

This PR enhances the Custom Depth feature for service account auto-sync by adding provider-specific maximum depth limits. The changes update validation logic and error messages to enforce these limits.

  • Added CUSTOM_DEPTH_MAX_DEPTH constant with provider-specific max depth values (AWS: 2000, Google Cloud: 11, Azure: 8)
  • Updated validation logic to enforce both minimum (>0) and maximum depth constraints
  • Updated internationalization strings across English, Japanese, and Korean to reflect the new max depth validation

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
apps/web/src/services/asset-inventory/types/service-account-page-type.ts Added CUSTOM_DEPTH_MAX_DEPTH constant defining max depth per provider
apps/web/src/services/asset-inventory/components/ServiceAccountAutoSyncMappingMethod.vue Updated validation logic and UI to enforce max depth limits using the new constant
packages/language-pack/en.json Updated English strings for custom depth description and validation messages to include max depth
packages/language-pack/ja.json Updated Japanese strings for custom depth description and validation messages to include max depth
packages/language-pack/ko.json Updated Korean strings for custom depth description and validation messages to include max depth
apps/web/src/schema/identity/trusted-account/model.ts Removed deprecated skip_project_group field from sync_options
apps/web/src/schema/identity/trusted-account/api-verbs/update.ts Updated sync_options structure to use new mapping type fields instead of deprecated skip_project_group
apps/web/src/schema/identity/trusted-account/api-verbs/create.ts Fixed typo in field name (workspace_mappint_typeworkspace_mapping_type) and updated sync_options structure

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

<span class="font-bold text-gray-600">{{ CUSTOM_DEPTH }}</span>
<span>{{ $t('IDENTITY.SERVICE_ACCOUNT.AUTO_SYNC.CUSTOM_DEPTH_DESCRIPTION') }}</span>
<span>{{ $t('IDENTITY.SERVICE_ACCOUNT.AUTO_SYNC.CUSTOM_DEPTH_DESCRIPTION',
{ csp_max_depth: CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider] }) }}</span>

Copilot AI Nov 6, 2025

Copy link

Choose a reason for hiding this comment

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

Potential runtime error: CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider] may be undefined if the provider is not 'aws', 'google_cloud', or 'azure'. This would result in displaying 'undefined' in the UI. Consider providing a fallback value or validating that the provider exists in CUSTOM_DEPTH_MAX_DEPTH before accessing it.

Copilot uses AI. Check for mistakes.
<p-field-group :invalid="state.customDepth !== null && state.customDepth < 1"
:invalid-text="$t('IDENTITY.SERVICE_ACCOUNT.AUTO_SYNC.CUSTOM_DEPTH_INVALID')"
<p-field-group :invalid="state.customDepth !== null && (state.customDepth < 1
|| state.customDepth > CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider])"

Copilot AI Nov 6, 2025

Copy link

Choose a reason for hiding this comment

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

Potential runtime error: CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider] may be undefined if the provider is not in the mapping. This would cause the comparison to always be false and validation to fail silently. Use optional chaining or provide a default value: CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider] ?? Infinity.

Copilot uses AI. Check for mistakes.
<p-field-group :invalid="state.customDepth !== null && (state.customDepth < 1
|| state.customDepth > CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider])"
:invalid-text="$t('IDENTITY.SERVICE_ACCOUNT.AUTO_SYNC.CUSTOM_DEPTH_INVALID', {
csp_max_depth: CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider]

Copilot AI Nov 6, 2025

Copy link

Choose a reason for hiding this comment

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

Potential runtime error: CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider] may be undefined if the provider is not in the mapping. This would result in displaying 'undefined' in the validation error message. Consider adding a fallback value or validation.

Copilot uses AI. Check for mistakes.
type="number"
min="1"
:invalid="state.customDepth !== null && state.customDepth < 1"
:max="CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider]"

Copilot AI Nov 6, 2025

Copy link

Choose a reason for hiding this comment

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

Potential runtime error: CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider] may be undefined for providers not in the mapping, which could result in no max constraint on the input. Consider using a fallback value.

Copilot uses AI. Check for mistakes.
min="1"
:invalid="state.customDepth !== null && state.customDepth < 1"
:max="CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider]"
:invalid="state.customDepth !== null && (state.customDepth < 1 || state.customDepth > CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider])"

Copilot AI Nov 6, 2025

Copy link

Choose a reason for hiding this comment

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

Potential runtime error: CUSTOM_DEPTH_MAX_DEPTH[serviceAccountPageState.selectedProvider] may be undefined if the provider is not in the mapping. This would cause the comparison to always be false and validation to fail silently. Use optional chaining or provide a default value.

Copilot uses AI. Check for mistakes.
Comment thread apps/web/src/schema/identity/trusted-account/api-verbs/create.ts

@yuda110 yuda110 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!!!

Signed-off-by: 이승연 <sylee1274@mz.co.kr>
@seungyeoneeee seungyeoneeee merged commit 06188d6 into cloudforet-io:trusted-account-auto-sync Nov 6, 2025
3 of 4 checks passed
@seungyeoneeee seungyeoneeee deleted the feature/trusted-account-async-fix branch November 10, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants