Skip to content

Conversation

@echarles
Copy link
Member

No description provided.

@echarles echarles self-assigned this Dec 15, 2025
Copilot AI review requested due to automatic review settings December 15, 2025 06:42
Copy link
Member Author

@echarles echarles left a comment

Choose a reason for hiding this comment

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

LGTM

@echarles echarles merged commit 7f028fb into main Dec 15, 2025
9 of 15 checks passed
@netlify
Copy link

netlify bot commented Dec 15, 2025

Deploy Preview for datalayer-core failed. Why did it fail? →

Name Link
🔨 Latest commit a0dfc71
🔍 Latest deploy log https://app.netlify.com/projects/datalayer-core/deploys/693fadca0a38260008b450d0

Copy link

Copilot AI left a comment

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 whoami command in the Datalayer CLI to support detailed user information display through a new --details flag. The change provides users with more comprehensive information about their authenticated profile when needed.

Key Changes

  • Added a --details boolean flag to both whoami and whoami_root commands
  • Implemented detailed user information display including full name, UIDs, roles, avatar, timestamps, connected IAM providers, and credits customer information
  • Updated whoami_root wrapper function to pass the new details parameter to the underlying whoami function

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

first_name = user.get("first_name_t", "")
last_name = user.get("last_name_t", "")
if first_name or last_name:
console.print(f"📝 Name: {first_name} {last_name}".strip())
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

The strip() method is being called on the entire formatted string, which will only remove whitespace from the beginning and end of the entire string. This doesn't handle the case where both first_name and last_name are empty strings, which would result in "📝 Name: " being printed. The strip() should be applied to the concatenated name before the f-string formatting, or the entire print statement should be skipped if the concatenated name is empty after stripping.

Copilot uses AI. Check for mistakes.

# Avatar
if user.get("avatar_url_s"):
console.print(f"🖼️ Avatar: {user.get('avatar_url_s')}")
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

There are two spaces after the emoji (🖼️ Avatar) which appears to be inconsistent with other emoji usage in the same function where there is only one space (e.g., "📝 Name:", "🆔 UID:", "🔑 ID:").

Suggested change
console.print(f"🖼️ Avatar: {user.get('avatar_url_s')}")
console.print(f"🖼️ Avatar: {user.get('avatar_url_s')}")

Copilot uses AI. Check for mistakes.
Comment on lines +340 to +344
details: bool = typer.Option(
False,
"--details",
help="Show detailed user information",
),
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

The new --details flag functionality lacks test coverage. The existing test for whoami only checks for "Profile" in the output, but doesn't test the new detailed information display. Consider adding a test case that uses the --details flag to ensure the new functionality works correctly and displays all the detailed fields (name, UID, roles, avatar, timestamps, connected accounts, etc.).

Copilot uses AI. Check for mistakes.
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