Skip to content

Conversation

@StranDutton
Copy link

@StranDutton StranDutton commented Dec 30, 2025

Currently, when verbose logs are enabled, the output is extremely bloated. This was caused by the log statements adding the entire response returned from Azure/Entra instead of only what is necessary. Each action performed by the app has has its verbose log modified to only include a couple of key details id, name, principalId, etc., rather than the entire object.

To test: run AzureHound with Verbose logs enabled and compare the new log output to the previous log output - the new one should be significantly smaller in size.

Note

Demo TBA, will supply log file size comparison

Summary by CodeRabbit

  • Chores
    • Enhanced diagnostic logging across the tool to emit more granular, structured fields for clearer troubleshooting during resource discovery.
    • Fixed typos in several log messages for improved clarity.
    • Updated development environment ignore rules to better handle JetBrains IDE metadata.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 30, 2025

Walkthrough

Refactors logging across many cmd/* list commands to replace full-object dumps with structured field-level logs (e.g., id, name, roleDefinitionId, principalId, scope). Also updates .gitignore to ignore JetBrains plugin metadata (.idea/**/go.imports.xml). No control-flow or API changes.

Changes

Cohort / File(s) Summary
IDE Configuration
\.gitignore
Adds ignore pattern for JetBrains plugin metadata (.idea/**/go.imports.xml).
List commands — logging refactor (Azure resource and role listings)
cmd/list-app-owners.go, cmd/list-app-role-assignments.go, cmd/list-apps.go, cmd/list-automation-account-role-assignments.go, cmd/list-automation-accounts.go, cmd/list-container-registries.go, cmd/list-container-registry-role-assignments.go, cmd/list-device-owners.go, cmd/list-devices.go, cmd/list-function-app-role-assignments.go, cmd/list-function-apps.go, cmd/list-group-members.go, cmd/list-group-owners.go, cmd/list-groups.go, cmd/list-key-vault-role-assignments.go, cmd/list-key-vaults.go, cmd/list-logic-app-role-assignments.go, cmd/list-logic-apps.go, cmd/list-managed-cluster-role-assignments.go, cmd/list-managed-clusters.go, cmd/list-management-group-role-assignments.go, cmd/list-management-groups.go, cmd/list-resource-group-role-assignments.go, cmd/list-resource-groups.go, cmd/list-role-assignments.go, cmd/list-role-eligibility-schedule-instance.go, cmd/list-roles.go, cmd/list-service-principal-owners.go, cmd/list-service-principals.go, cmd/list-storage-account-role-assignments.go, cmd/list-storage-accounts.go, cmd/list-storage-containers.go, cmd/list-subscription-owners.go, cmd/list-subscription-role-assignments.go, cmd/list-subscription-user-access-admins.go, cmd/list-subscriptions.go, cmd/list-tenants.go, cmd/list-users.go, cmd/list-virtual-machine-role-assignments.go, cmd/list-virtual-machines.go, cmd/list-vm-scale-set-role-assignments.go, cmd/list-vm-scale-sets.go, cmd/list-web-app-role-assignments.go, cmd/list-web-apps.go
Replaces logging of entire result structs with structured logs of selected fields (common keys: id, name, roleDefinitionId, principalId, scope, tenantId, etc.). list-role-eligibility-schedule-instance.go also adds imports (os, os/signal, time). Minor log text fixes (typos) in a few files. No changes to control flow, behavior, exported signatures, or data emission logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through logs both wide and deep,

Trimmed bulky dumps to tidy peeks.
IDs and names now softly sing,
Small changes make observability spring.
A tiny ignore keeps IDE crumbs from sight. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'BED-4602: Reduce Verbose Log Output' accurately reflects the main change across the entire changeset, which modifies 40+ list commands to log only key fields instead of entire objects.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions
Copy link

github-actions bot commented Dec 30, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@StranDutton
Copy link
Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Dec 30, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
cmd/list-group-owners.go (1)

109-109: Consider logging owner identifier for better debugging context.

The log currently emits only groupId, which identifies the group but provides no information about which specific owner was found. For consistency with other files in this PR (e.g., list-function-app-role-assignments.go logs id, roleDefinitionId, principalId) and to aid debugging, consider also logging an owner-specific identifier.

🔎 Suggested enhancement
-log.V(2).Info("found group owner", "groupId", groupOwner.GroupId)
+log.V(2).Info("found group owner", "groupId", groupOwner.GroupId, "ownerId", groupOwner.Owner.Id)
cmd/list-group-members.go (1)

119-119: Consider logging member identifier for better debugging context.

Similar to the group owners case, this log emits only groupId without any member-specific identifier. To improve debugging capability and maintain consistency with the logging pattern in other files (which typically log multiple identifying fields), consider adding a member identifier.

🔎 Suggested enhancement
-log.V(2).Info("found group member", "groupId", groupMember.GroupId)
+log.V(2).Info("found group member", "groupId", groupMember.GroupId, "memberId", groupMember.Member.Id)
cmd/list-storage-accounts.go (1)

105-105: Logging change achieves the PR objective.

The change successfully reduces log verbosity by logging only id and name instead of the entire storage account object.

Optional: Consider consistent field access pattern

The code mixes explicit field access (storageAccount.StorageAccount.Id) with promoted field access (storageAccount.Name). For consistency, consider using either both promoted or both explicit:

-log.V(2).Info("found storage account", "id", storageAccount.StorageAccount.Id, "name", storageAccount.Name)
+log.V(2).Info("found storage account", "id", storageAccount.Id, "name", storageAccount.Name)
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 752e8a4 and 86ea416.

📒 Files selected for processing (45)
  • .gitignore
  • cmd/list-app-owners.go
  • cmd/list-app-role-assignments.go
  • cmd/list-apps.go
  • cmd/list-automation-account-role-assignments.go
  • cmd/list-automation-accounts.go
  • cmd/list-container-registries.go
  • cmd/list-container-registry-role-assignments.go
  • cmd/list-device-owners.go
  • cmd/list-devices.go
  • cmd/list-function-app-role-assignments.go
  • cmd/list-function-apps.go
  • cmd/list-group-members.go
  • cmd/list-group-owners.go
  • cmd/list-groups.go
  • cmd/list-key-vault-role-assignments.go
  • cmd/list-key-vaults.go
  • cmd/list-logic-app-role-assignments.go
  • cmd/list-logic-apps.go
  • cmd/list-managed-cluster-role-assignments.go
  • cmd/list-managed-clusters.go
  • cmd/list-management-group-role-assignments.go
  • cmd/list-management-groups.go
  • cmd/list-resource-group-role-assignments.go
  • cmd/list-resource-groups.go
  • cmd/list-role-assignments.go
  • cmd/list-role-eligibility-schedule-instance.go
  • cmd/list-roles.go
  • cmd/list-service-principal-owners.go
  • cmd/list-service-principals.go
  • cmd/list-storage-account-role-assignments.go
  • cmd/list-storage-accounts.go
  • cmd/list-storage-containers.go
  • cmd/list-subscription-owners.go
  • cmd/list-subscription-role-assignments.go
  • cmd/list-subscription-user-access-admins.go
  • cmd/list-subscriptions.go
  • cmd/list-tenants.go
  • cmd/list-users.go
  • cmd/list-virtual-machine-role-assignments.go
  • cmd/list-virtual-machines.go
  • cmd/list-vm-scale-set-role-assignments.go
  • cmd/list-vm-scale-sets.go
  • cmd/list-web-app-role-assignments.go
  • cmd/list-web-apps.go
🧰 Additional context used
🧬 Code graph analysis (8)
cmd/list-tenants.go (2)
constants/misc.go (1)
  • DisplayName (29-29)
client/query/params.go (1)
  • TenantId (41-41)
cmd/list-resource-group-role-assignments.go (1)
models/azure/role_assignment.go (1)
  • RoleAssignment (31-43)
cmd/list-subscription-role-assignments.go (1)
models/azure/role_assignment.go (1)
  • RoleAssignment (31-43)
cmd/list-service-principals.go (1)
constants/misc.go (1)
  • DisplayName (29-29)
cmd/list-key-vault-role-assignments.go (1)
models/azure/role_assignment.go (1)
  • RoleAssignment (31-43)
cmd/list-virtual-machine-role-assignments.go (1)
models/azure/role_assignment.go (1)
  • RoleAssignment (31-43)
cmd/list-management-group-role-assignments.go (1)
models/azure/role_assignment.go (1)
  • RoleAssignment (31-43)
cmd/list-storage-accounts.go (2)
models/azure/storage_account.go (1)
  • StorageAccount (22-34)
models/storage-account.go (1)
  • StorageAccount (22-28)
🔇 Additional comments (43)
.gitignore (1)

133-134: Appropriate addition to gitignore.

The new pattern for .idea/**/go.imports.xml is a valid gitignore entry that correctly targets JetBrains IDE-generated Go imports metadata. The placement within the "Generated files" subsection aligns well with similar patterns in the file.

cmd/list-management-groups.go (1)

74-74: LGTM! Logging improvement reduces verbosity effectively.

The change successfully reduces log output by logging only the management group's ID and name instead of the entire object, which aligns perfectly with the PR objective to minimize verbose log size while maintaining useful diagnostic information.

cmd/list-roles.go (1)

73-73: Effective reduction of verbose log output.

The selective field logging (id, displayName, isEnabled) successfully addresses the PR objective while retaining the most relevant information for debugging and traceability. The field selection is appropriate for role entities and follows the structured logging pattern consistently applied across other list commands in this PR.

cmd/list-subscription-user-access-admins.go (1)

91-91: LGTM! Effective reduction in log verbosity.

The change successfully replaces full-object logging with targeted field logging. The selected fields (id, principalId, scope, roleId) provide sufficient identifiers for debugging while significantly reducing log size, which aligns perfectly with the PR objective.

cmd/list-storage-containers.go (1)

113-113: LGTM! Effective log verbosity reduction.

The change from logging the entire storageContainer object to logging only the key fields (id, name, tenant) successfully achieves the PR objective of reducing verbose log output while retaining sufficient information for debugging and tracing.

cmd/list-devices.go (1)

73-73: LGTM - Log verbosity reduction implemented correctly.

The change successfully reduces verbose log output by logging only the deviceId field instead of the entire device object, which aligns with the PR objectives. The DeviceId field exists on the Device type and is appropriately used as a unique identifier for logging.

cmd/list-role-assignments.go (1)

109-109: The concern about nil pointer dereference is not applicable here.

RoleDefinition is a value type (UnifiedRoleDefinition), not a pointer. In Go, value types always have a zero-value when unmarshaled from JSON with omitempty, and cannot be nil. Accessing .DisplayName on an empty UnifiedRoleDefinition struct is safe and returns an empty string rather than causing a panic. No defensive check is needed.

cmd/list-web-apps.go (1)

111-111: LGTM! Logging change reduces verbosity effectively.

The change from logging the entire webApp object to logging just id and name fields aligns perfectly with the PR objective. These two fields provide sufficient context for debugging while significantly reducing log size.

cmd/list-key-vault-role-assignments.go (1)

109-109: LGTM! Well-structured logging change.

The log statement emits both the role assignment ID and the key vault ID, providing clear context for debugging while reducing log verbosity. The structured field approach is clean and effective.

cmd/list-users.go (1)

87-87: LGTM! Comprehensive and well-balanced logging.

The log statement captures three key fields—id, type, and isEnabled—which provide excellent debugging context while achieving the PR's goal of reducing log size. The field selection is thoughtful and practical.

cmd/list-function-app-role-assignments.go (1)

113-113: LGTM! Typo fix and excellent logging enhancement.

This change accomplishes two improvements:

  1. Fixes the typo: "asignment" → "assignment"
  2. Adds comprehensive structured logging with four key fields (id, roleDefinitionId, principalId, scope)

The detailed field selection provides excellent debugging context while still achieving significant log size reduction compared to logging the entire object.

cmd/list-key-vaults.go (1)

108-108: LGTM! Comprehensive logging with good field selection.

The log statement captures three key fields—id, name, and tenantId—which provide strong debugging context across different dimensions (technical identifier, human-readable name, and organizational scope). Well-balanced approach to verbosity reduction.

cmd/list-groups.go (1)

73-73: LGTM! Clean and effective logging change.

The log statement emits both id and name (DisplayName), providing a good balance between a technical identifier and a human-readable label. This is consistent with similar changes across the codebase and achieves the PR's verbosity reduction goal.

cmd/list-subscription-owners.go (1)

91-91: LGTM! Logging refinement reduces verbosity effectively.

The change from logging the entire subscriptionOwner object to logging specific key fields (principalId, role, subscriptionId) achieves the PR's objective of reducing verbose log output while maintaining essential debugging information.

cmd/list-subscriptions.go (1)

95-95: LGTM! Concise logging for subscription identification.

Logging only the SubscriptionId instead of the entire object significantly reduces log verbosity while providing sufficient information for tracking subscription enumeration.

cmd/list-logic-apps.go (1)

114-114: LGTM! Appropriate field selection for Logic App logging.

The change to log id and name fields instead of the entire logicapp object provides sufficient debugging information while significantly reducing log size.

cmd/list-app-role-assignments.go (1)

105-105: LGTM! Comprehensive logging for role assignments.

The structured logging of id, appRoleId, and name fields provides excellent context for debugging app role assignments while avoiding the verbosity of logging the entire object.

cmd/list-automation-account-role-assignments.go (1)

113-113: LGTM! Essential fields logged for automation account role assignments.

Logging id and roleDefinitionId captures the most important identifiers for automation account role assignments while reducing log verbosity.

cmd/list-tenants.go (1)

84-84: LGTM! Thorough tenant identification in logs.

Logging id, name, and tenantId provides complete context for tenant enumeration while maintaining concise log output.

cmd/list-managed-cluster-role-assignments.go (1)

118-118: LGTM! Comprehensive logging for managed cluster role assignments.

The structured logging of id, roleDefinitionId, and principalId provides excellent debugging context for managed cluster role assignments while significantly reducing log verbosity.

cmd/list-function-apps.go (1)

106-106: LGTM! Concise logging for Function Apps.

Logging id and name fields provides sufficient information for tracking Function App enumeration while reducing log size, consistent with the pattern used across other list commands.

cmd/list-vm-scale-set-role-assignments.go (1)

118-118: LGTM! Logging improvement reduces verbosity.

The change from logging the entire vmScaleSetRoleAssignment object to logging only the key fields (id and roleId) effectively reduces log volume while preserving essential debugging context.

cmd/list-app-owners.go (1)

92-92: LGTM! Cleaner log output.

Logging only the appId instead of the entire appOwner object streamlines the verbose output while maintaining the essential identifier for debugging.

cmd/list-resource-groups.go (1)

105-105: LGTM! Concise and informative logging.

The change to log only id and name fields provides clear resource identification while significantly reducing log size compared to the full object dump.

cmd/list-logic-app-role-assignments.go (1)

118-118: LGTM! Improved log clarity.

Logging the specific id and roleDefinitionId fields instead of the entire role assignment object maintains debugging capability while reducing verbose output.

cmd/list-managed-clusters.go (1)

109-109: LGTM! Streamlined logging.

The change to log only id and name effectively reduces log verbosity while retaining the essential identifiers for managed cluster debugging.

cmd/list-virtual-machine-role-assignments.go (1)

109-109: LGTM! Targeted logging improvement.

Logging only roleId and virtualMachineId provides the necessary context for debugging virtual machine role assignments while significantly reducing log size.

cmd/list-storage-account-role-assignments.go (1)

113-113: LGTM! Comprehensive yet concise logging.

Logging id, roleDefinitionId, and principalId provides sufficient context for storage account role assignment debugging while avoiding the overhead of logging the entire object.

cmd/list-subscription-role-assignments.go (1)

109-109: LGTM! Efficient logging pattern.

Logging only the nested RoleAssignment.Id and RoleAssignment.Name fields effectively reduces log verbosity while preserving the key identifiers for subscription role assignment debugging.

cmd/list-service-principal-owners.go (1)

109-109: LGTM! Logging refinement reduces verbosity effectively.

The change from logging the entire servicePrincipalOwner object to just the ServicePrincipalId field reduces log size while preserving essential traceability for debugging.

cmd/list-vm-scale-sets.go (1)

110-110: LGTM! Structured logging with key identifiers.

Logging id and name instead of the entire VM scale set object significantly reduces log volume while retaining the most relevant identifiers for troubleshooting.

cmd/list-resource-group-role-assignments.go (1)

110-110: LGTM! Granular logging with essential role assignment details.

The structured logging of id, name, and resourceGroupId provides clear traceability for role assignments while dramatically reducing log size compared to serializing the entire object.

cmd/list-service-principals.go (1)

73-73: LGTM! Logging refinement captures key service principal identifiers.

Emitting id, name (DisplayName), and appId provides the essential identifiers for service principals while avoiding the overhead of logging entire response objects.

cmd/list-automation-accounts.go (1)

105-105: LGTM! Concise logging with key automation account identifiers.

Logging id and name instead of the full automation account object reduces log verbosity while maintaining adequate traceability for debugging.

cmd/list-virtual-machines.go (1)

105-105: LGTM! Structured logging with multi-tenant context.

Logging id, name, and tenantId provides clear VM identification across tenants while significantly reducing log output compared to serializing the entire virtual machine object.

cmd/list-container-registry-role-assignments.go (1)

118-118: LGTM! Comprehensive role assignment logging with key fields.

The structured logging captures all essential role assignment attributes (id, principalId, roleDefinitionId, scope) while avoiding the overhead of serializing entire objects—this provides excellent traceability for RBAC debugging.

cmd/list-container-registries.go (1)

110-110: LGTM! Concise logging with key container registry identifiers.

Logging id and name instead of the full container registry object reduces log size while maintaining the essential identifiers needed for troubleshooting.

cmd/list-web-app-role-assignments.go (1)

118-118: LGTM! Logging change reduces verbosity and fixes typo.

The change from logging the entire webAppRoleAssignment struct to just the roleDefinitionId field achieves the PR objective of reducing log output. Additionally, the typo fix ("asignment" → "assignment") improves code quality.

cmd/list-apps.go (1)

73-73: LGTM! Logging change effectively reduces verbosity.

The change from logging the entire application object to just the id and name fields aligns with the PR objective and significantly reduces log output while retaining essential diagnostic information.

cmd/list-device-owners.go (1)

108-108: The current log statement is correct; no changes needed.

The log change successfully reduces verbosity. The Owner field in DeviceOwner is typed as json.RawMessage (raw JSON data), not a structured object with accessible fields like Id. Logging only the deviceId is the appropriate approach here, as extracting owner information would require unmarshaling the JSON, which is not done at this point in the code.

Likely an incorrect or invalid review comment.

cmd/list-role-eligibility-schedule-instance.go (2)

75-75: LGTM! Logging refactor aligns with PR objectives.

The change successfully reduces log verbosity by logging only the essential identifying fields (id, roleDefinitionId, principalId) instead of the entire object. This will significantly reduce log size while maintaining useful debugging information.

The fields chosen are appropriate as they represent the primary identifiers for role eligibility schedule instances and match the fields used in the data structure below (lines 81-83).


22-24: No action needed—these imports are correct. The file is a new addition to the codebase, so all imports are necessarily new. The os, os/signal, and time imports are all used appropriately in the code (signal handling and timing operations).

cmd/list-management-group-role-assignments.go (1)

109-109: Log statement refactored to emit specific fields instead of full objects.

The change replaces object-level logging with granular field-level logging (id, roleId, principalId, scope). All accessed fields are confirmed to exist: RoleAssignment.Id, RoleAssignment.Properties.RoleDefinitionId, RoleAssignment.Properties.PrincipalId, and RoleAssignment.Properties.Scope. The verbosity level V(2) is appropriate for detailed logging.

@StranDutton StranDutton force-pushed the BED-4602-modify-verbose-log-output branch from 86ea416 to ef18db4 Compare December 30, 2025 16:44
@StranDutton StranDutton marked this pull request as ready for review December 30, 2025 16:47
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
cmd/list-subscription-user-access-admins.go (1)

91-91: LGTM! Logging change successfully reduces verbosity.

The modification correctly logs only key fields (id, principalId, scope, roleId) instead of the entire object, achieving the PR's objective. The field selection is appropriate for tracing subscription user access admins.

Optional: Consider line length for readability.

The log statement spans over 240 characters. If preferred, you could split this across multiple lines or extract fields into variables for improved readability, though this is purely a stylistic preference.

🔎 Optional refactor for readability
-log.V(2).Info("found subscription user access admin", "id", subscriptionUserAccessAdmin.UserAccessAdmin.Id, "principalId", subscriptionUserAccessAdmin.UserAccessAdmin.Properties.PrincipalId, "scope", subscriptionUserAccessAdmin.UserAccessAdmin.Properties.Scope, "roleId", subscriptionUserAccessAdmin.UserAccessAdmin.Properties.RoleDefinitionId)
+admin := subscriptionUserAccessAdmin.UserAccessAdmin
+log.V(2).Info("found subscription user access admin",
+	"id", admin.Id,
+	"principalId", admin.Properties.PrincipalId,
+	"scope", admin.Properties.Scope,
+	"roleId", admin.Properties.RoleDefinitionId)
cmd/list-key-vault-role-assignments.go (1)

109-109: Consider adding principalId and roleDefinitionId to the log output.

While the current fields identify the assignment and vault, including principalId (who is assigned) and roleDefinitionId (what role) would provide more actionable context when reviewing logs, especially since the PR description mentions principalId as an example field to include.

🔎 Proposed enhancement
-log.V(2).Info("found key vault role assignment", "id", keyVaultRoleAssignment.RoleAssignment.Id, "keyVaultId", keyVaultRoleAssignment.KeyVaultId)
+log.V(2).Info("found key vault role assignment", "id", keyVaultRoleAssignment.RoleAssignment.Id, "keyVaultId", keyVaultRoleAssignment.KeyVaultId, "principalId", keyVaultRoleAssignment.RoleAssignment.Properties.PrincipalId, "roleDefinitionId", keyVaultRoleAssignment.RoleAssignment.Properties.RoleDefinitionId)
cmd/list-role-eligibility-schedule-instance.go (1)

75-75: LGTM! Logging change successfully reduces verbosity.

The refactored log statement now emits only key identifiers (id, roleDefinitionId, principalId) instead of the full object, which aligns perfectly with the PR objective to reduce log volume while maintaining traceability.

Optionally, consider including DirectoryScopeId for additional context, as it represents the scope of the role assignment and could be valuable for debugging permission-related issues:

💡 Optional enhancement
-				log.V(2).Info("found unified role eligibility instance schedule", "id", item.Ok.Id, "roleDefinitionId", item.Ok.RoleDefinitionId, "principalId", item.Ok.PrincipalId)
+				log.V(2).Info("found unified role eligibility instance schedule", "id", item.Ok.Id, "roleDefinitionId", item.Ok.RoleDefinitionId, "principalId", item.Ok.PrincipalId, "directoryScopeId", item.Ok.DirectoryScopeId)
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 86ea416 and a0a6a3a.

📒 Files selected for processing (45)
  • .gitignore
  • cmd/list-app-owners.go
  • cmd/list-app-role-assignments.go
  • cmd/list-apps.go
  • cmd/list-automation-account-role-assignments.go
  • cmd/list-automation-accounts.go
  • cmd/list-container-registries.go
  • cmd/list-container-registry-role-assignments.go
  • cmd/list-device-owners.go
  • cmd/list-devices.go
  • cmd/list-function-app-role-assignments.go
  • cmd/list-function-apps.go
  • cmd/list-group-members.go
  • cmd/list-group-owners.go
  • cmd/list-groups.go
  • cmd/list-key-vault-role-assignments.go
  • cmd/list-key-vaults.go
  • cmd/list-logic-app-role-assignments.go
  • cmd/list-logic-apps.go
  • cmd/list-managed-cluster-role-assignments.go
  • cmd/list-managed-clusters.go
  • cmd/list-management-group-role-assignments.go
  • cmd/list-management-groups.go
  • cmd/list-resource-group-role-assignments.go
  • cmd/list-resource-groups.go
  • cmd/list-role-assignments.go
  • cmd/list-role-eligibility-schedule-instance.go
  • cmd/list-roles.go
  • cmd/list-service-principal-owners.go
  • cmd/list-service-principals.go
  • cmd/list-storage-account-role-assignments.go
  • cmd/list-storage-accounts.go
  • cmd/list-storage-containers.go
  • cmd/list-subscription-owners.go
  • cmd/list-subscription-role-assignments.go
  • cmd/list-subscription-user-access-admins.go
  • cmd/list-subscriptions.go
  • cmd/list-tenants.go
  • cmd/list-users.go
  • cmd/list-virtual-machine-role-assignments.go
  • cmd/list-virtual-machines.go
  • cmd/list-vm-scale-set-role-assignments.go
  • cmd/list-vm-scale-sets.go
  • cmd/list-web-app-role-assignments.go
  • cmd/list-web-apps.go
✅ Files skipped from review due to trivial changes (1)
  • cmd/list-web-apps.go
🚧 Files skipped from review as they are similar to previous changes (27)
  • cmd/list-devices.go
  • cmd/list-app-owners.go
  • cmd/list-function-apps.go
  • cmd/list-subscription-role-assignments.go
  • cmd/list-storage-account-role-assignments.go
  • cmd/list-resource-group-role-assignments.go
  • cmd/list-service-principals.go
  • cmd/list-group-owners.go
  • cmd/list-managed-cluster-role-assignments.go
  • cmd/list-vm-scale-sets.go
  • cmd/list-web-app-role-assignments.go
  • cmd/list-tenants.go
  • cmd/list-device-owners.go
  • cmd/list-virtual-machine-role-assignments.go
  • cmd/list-storage-accounts.go
  • cmd/list-container-registries.go
  • cmd/list-virtual-machines.go
  • cmd/list-automation-accounts.go
  • cmd/list-service-principal-owners.go
  • cmd/list-managed-clusters.go
  • cmd/list-group-members.go
  • cmd/list-users.go
  • cmd/list-function-app-role-assignments.go
  • cmd/list-groups.go
  • cmd/list-logic-app-role-assignments.go
  • cmd/list-container-registry-role-assignments.go
  • cmd/list-vm-scale-set-role-assignments.go
🧰 Additional context used
🧬 Code graph analysis (3)
cmd/list-key-vault-role-assignments.go (1)
models/azure/role_assignment.go (1)
  • RoleAssignment (31-43)
cmd/list-management-group-role-assignments.go (1)
models/azure/role_assignment.go (1)
  • RoleAssignment (31-43)
cmd/list-apps.go (1)
constants/misc.go (1)
  • DisplayName (29-29)
🔇 Additional comments (15)
.gitignore (1)

133-134: LGTM!

The addition of .idea/**/go.imports.xml is appropriately placed in the JetBrains section and follows the existing glob pattern convention. This prevents JetBrains IDE plugin metadata from being tracked, reducing unnecessary artifacts in version control.

cmd/list-resource-groups.go (1)

105-105: LGTM! Logging improvement aligns with PR objectives.

The change from logging the entire resourceGroup object to logging only the Id and Name fields effectively reduces log verbosity while preserving essential identifying information. This is sufficient for debugging and tracing enumerated resource groups, and the full object still flows through the pipeline for data processing.

cmd/list-management-groups.go (1)

74-74: LGTM! Logging refinement aligns with PR objective.

The change from logging the entire item.Ok object to logging only id and name fields effectively reduces verbose log output while preserving key identifying information needed for debugging.

cmd/list-subscriptions.go (1)

95-95: LGTM! Improved logging granularity.

The change successfully reduces log verbosity by logging only the subscription ID instead of the entire subscription object, while maintaining the same information value for troubleshooting.

cmd/list-apps.go (1)

73-73: LGTM! Enhanced structured logging.

The change provides better structured logging by emitting individual fields (id and name) instead of the entire application object, making logs more readable and significantly smaller.

cmd/list-automation-account-role-assignments.go (1)

113-113: LGTM! More concise role assignment logging.

The structured logging approach captures the essential identifiers (id and roleDefinitionId) without dumping the entire role assignment object, reducing log size while maintaining debugging utility.

cmd/list-app-role-assignments.go (1)

105-105: LGTM! Well-structured app role assignment logging.

The logging now includes three key fields (id, appRoleId, and name) that provide sufficient context for troubleshooting while dramatically reducing log size compared to logging the entire object.

cmd/list-logic-apps.go (1)

114-114: LGTM! Cleaner logic app logging.

The change reduces log verbosity by emitting only the id and name fields instead of the entire logic app object, maintaining essential debugging information while significantly reducing log size.

cmd/list-roles.go (1)

73-73: LGTM! Enhanced role logging with structured fields.

The structured logging now includes three relevant fields (id, displayName, isEnabled) that provide comprehensive context for roles, making logs more useful for troubleshooting while avoiding the overhead of logging entire role objects.

cmd/list-subscription-owners.go (1)

91-91: LGTM! Improved subscription owner logging.

The change provides structured logging with three key fields (principalId, role, and subscriptionId) that capture the essential information about subscription owners, reducing log size while maintaining full debugging capability.

cmd/list-key-vaults.go (1)

108-108: LGTM!

The selective field logging (id, name, tenantId) provides sufficient identifying information while reducing log verbosity as intended.

cmd/list-storage-containers.go (1)

113-113: LGTM! Logging change achieves PR objective.

The change successfully reduces verbose log output by logging only the key identifying fields (id, name, tenant) instead of the entire storageContainer object. This maintains sufficient context for debugging while significantly reducing log size.

cmd/list-management-group-role-assignments.go (1)

109-109: LGTM - Effective reduction of log verbosity!

The change successfully replaces full-object logging with targeted field-level logging, significantly reducing log size while preserving essential debugging information (id, role definition, principal, and scope). All field paths exist on the struct and the code is safe—the logging is only reached when item.Error is nil.

cmd/list-role-eligibility-schedule-instance.go (1)

22-24: These import additions appear to be marked incorrectly in the diff.

The imports os, os/signal, and time at lines 22-24 are marked as additions, but they're already present in the current code and actively used in lines 47, 52, and 56 (via signal.NotifyContext(), os.Interrupt, os.Kill, time.Now(), and time.Since()). Git history shows these imports are not new to this commit. Either these imports were reorganized rather than newly added, or the diff is incorrectly marking them as additions.

cmd/list-role-assignments.go (1)

109-109: The logging statement on line 109 is safe and does not require a nil check. The RoleDefinition field is a value type (UnifiedRoleDefinition, not a pointer), so when the API response does not include the roleDefinition field, it is zero-initialized with an empty string for DisplayName. Accessing item.Ok.RoleDefinition.DisplayName will return an empty string rather than panic.

Likely an incorrect or invalid review comment.

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.

2 participants