Skip to content

Support some commands offline #1237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Support some commands offline #1237

wants to merge 1 commit into from

Conversation

lionello
Copy link
Member

@lionello lionello commented Jun 8, 2025

Description

When offline (on a plane), we should allow commands that don't require login, like defang compose config.

Linked Issues

See #1111

Checklist

  • I have performed a self-review of my code
  • I have added appropriate tests
  • I have updated the Defang CLI docs and/or README to reflect my changes, if necessary

@@ -379,6 +376,11 @@ var RootCmd = &cobra.Command{
return nil
}

// Check whether Connect failed with a networking error
Copy link
Collaborator

@commit111 commit111 Jun 9, 2025

Choose a reason for hiding this comment

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

This relocation of the check may cause commands which require a Fabric/network connection but are not marked with authNeeded annotation to exit way later and show the raw network connection error instead of our nice, user-friendly error when there is no internet.

An example would be defang generate, which requires internet but not necessarily authNeeded. So when a user runs this without internet, they may see the unable to resolve host error or something similar as opposed to unable to connect to Defang server when the call to Fabric occurs later on.

According to @edwardrf, a solution would be to avoid mixing up/overloading the meaning of the when auth is needed versus when Fabric/network is needed, perhaps by adding another flag called fabricNeeded or networkNeeded

@commit111 commit111 self-requested a review June 9, 2025 17:50
Copy link
Collaborator

@commit111 commit111 left a comment

Choose a reason for hiding this comment

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

I’ve left a comment, but feel free to decide whether you want to make any changes or not

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