Skip to content

Conversation

@arielshaqed
Copy link
Contributor

Closes #9658 .

- OpenAPI support
- Login tokens abstraction
- Controller hookup to login tokens abstraction

(This feature is unimplemented in base lakeFS, and only a trivial login
tokens abstraction exists here.)
This is typically only called by the browser -- but it's still handled as
OpenAPI in the controller.
Use the same RetryClient type as the rest of lakeFS, only with a different
retry policy - one that retries status code 404.  This involves refactoring
getClient... so do that.
releaseToken is _not_ part of the UI, and there is no implicit redirection
there from middleware.  Instead, redirect there from the controller.
Copy link
Contributor

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 implements interactive configuration of the lakeFS server URL on first lakectl login, addressing issue #9658. When the server endpoint URL is not configured, users are now prompted to enter it interactively, and the configuration is automatically saved.

Key changes:

  • Removed the default server endpoint URL (http://127.0.0.1:8000) from configuration initialization
  • Added interactive prompt with URL validation to collect server URL from users during first login
  • Automatically saves the provided server URL to the configuration file

Reviewed Changes

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

File Description
cmd/lakectl/cmd/root.go Removed default server endpoint URL to enable interactive configuration
cmd/lakectl/cmd/login.go Added URL validation, interactive prompt, and configuration saving logic for server endpoint

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

return "", err
}
if serverURL.Path == "" {
serverURL.Path += "/api/v1"
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The condition checks if Path is empty, but then uses += to append. When Path is empty, += will still work correctly, but this should use = instead of += for clarity and correctness. If Path were empty, \"\" + \"/api/v1\" equals \"/api/v1\", but the use of += suggests appending to an existing value, which is misleading.

Suggested change
serverURL.Path += "/api/v1"
serverURL.Path = "/api/v1"

Copilot uses AI. Check for mistakes.
if serverURL.Path == "" {
serverURL.Path += "/api/v1"
}
return serverURL.String(), err
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The function returns err which is always nil at this point (from the previous url.Parse call that succeeded due to the comment on line 73). This should return nil explicitly instead of err to avoid confusion and potential future bugs if the code changes.

Suggested change
return serverURL.String(), err
return serverURL.String(), nil

Copilot uses AI. Check for mistakes.
@arielshaqed arielshaqed force-pushed the feature/1194-lakectl-login-swagger branch from bdb4f20 to 58a254b Compare November 16, 2025 11:43
Copy link
Contributor

@Isan-Rivkin Isan-Rivkin left a comment

Choose a reason for hiding this comment

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

Will continue this review after the base PR's are ready again

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