Suggest juju1 upon first use of juju2 if there is an existing JUJU_HOME dir

Bug #1564622 reported by Cheryl Jennings
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Nate Finch

Bug Description

Users with existing juju 1.x environments may be surprised when doing a dist upgrade if juju2 is the default in update-alternatives and they can no longer talk to their 1.x environments.

Juju2 can be updated to look for a JUJU_HOME dir upon first use (when creating JUJU_DATA), or when it can't find any information in JUJU_DATA to suggest that users can use update-alternatives to use juju1 to talk to existing environments.

Revision history for this message
Adam Stokes (adam-stokes) wrote :

Update alternatives was removed in beta3, we should point users directly to the juju-1 location

Revision history for this message
Cheryl Jennings (cherylj) wrote :

Copying from dup'ed bug for additional background and suggested wording:

When a Juju 1.X user is dist-upgrading to xenial and uses Juju 2.0 for the first time, Juju should help the user along with the change in 1.X -> 2.X by providing a one time message hint that Juju 1 is still available at a new location for them to continue using.

An example user flow:

    do-release-upgrade
    .... lots of things

    juju switch
    Welcome to Juju 2.0. You can continue using juju-1.25.5 with the command juju-1 e.g. `juju-1 switch`

It should detect this situation if the user has existing juju 1.X config but no juju 2.X config. It should also only be run on the first occasion so that we don't spam the user over and over.

Nate Finch (natefinch)
Changed in juju-core:
assignee: nobody → Nate Finch (natefinch)
Revision history for this message
Richard Harding (rharding) wrote :

Nate brings up the good point that the command could be a legit Juju 2 command. We're concerned with the case of migrating, but maybe that Juju 1 data is stale and they're wanting to use Juju 2.0. If the user actually types 'juju list-controllers' it doesn't make sense to tell them to run 'juju-1 list-controllers'.

I think the better option is to hint at the juju1, but allow the user to continue the command as is. Example:

    Welcome to Juju 2.0. If you meant to use Juju 1.25 (can we promise/check/make this correct?)
     you can continue using juju-1.25.5 with the command juju-1 e.g. `juju-1 switch`.

    Continue with 'juju $command here' with Juju 2.0? (Y/n)

This would only occur the first time the user ran a command and go away there-after.

Revision history for this message
Nate Finch (natefinch) wrote :

We can always run `juju-1 version` to find the local version of the binary.

I wonder if we want to give more of an introduction to Juju 2. Something along the lines of:

Welcome to Juju 2.0. The 'juju' command now refers to the 2.0 version of Juju. If you wish to interact with a Juju 1.x environment, please use the existing Juju <1.x.x> command juju-1, as the Juju 2.0 command cannot interact with Juju 1.x environments.

Note that many commands have changed in Juju 2.0. Please see https://jujucharms.com/SomeValidURL for more information, or type 'juju help'.

Would you like to run the 'juju <whatever>' command you entered with juju 2.0? Y/n?

Revision history for this message
Richard Harding (rharding) wrote : Re: [Bug 1564622] Re: Suggest juju1 upon first use of juju2 if there is an existing JUJU_HOME dir

I think that gets to be a bit much. I'd rather keep it simple if we can.

On Mon, Apr 11, 2016, 5:15 PM Nate Finch <email address hidden> wrote:

> We can always run `juju-1 version` to find the local version of the
> binary.
>
> I wonder if we want to give more of an introduction to Juju 2.
> Something along the lines of:
>
> Welcome to Juju 2.0. The 'juju' command now refers to the 2.0 version
> of Juju. If you wish to interact with a Juju 1.x environment, please use
> the existing Juju <1.x.x> command juju-1, as the Juju 2.0 command cannot
> interact with Juju 1.x environments.
>
> Note that many commands have changed in Juju 2.0. Please see
> https://jujucharms.com/SomeValidURL for more information, or type 'juju
> help'.
>
> Would you like to run the 'juju <whatever>' command you entered with
> juju 2.0? Y/n?
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1565991).
> https://bugs.launchpad.net/bugs/1564622
>
> Title:
> Suggest juju1 upon first use of juju2 if there is an existing
> JUJU_HOME dir
>
> Status in juju-core:
> Triaged
>
> Bug description:
> Users with existing juju 1.x environments may be surprised when doing
> a dist upgrade if juju2 is the default in update-alternatives and they
> can no longer talk to their 1.x environments.
>
> Juju2 can be updated to look for a JUJU_HOME dir upon first use (when
> creating JUJU_DATA), or when it can't find any information in
> JUJU_DATA to suggest that users can use update-alternatives to use
> juju1 to talk to existing environments.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju-core/+bug/1564622/+subscriptions
>

Changed in juju-core:
milestone: 2.0-beta4 → 2.0-rc1
Revision history for this message
Nate Finch (natefinch) wrote :

BTW, I think the prompt is probably going to mess up a lot of people, since anyone who wants to deploy juju and then run a script might get stuck at that prompt. I think it might be sufficient to simply write the warning, since there's no actual harm you can do by running a 2.0 command by accident if you haven't even set up credentials yet.

Revision history for this message
Nate Finch (natefinch) wrote :
Changed in juju-core:
status: Triaged → In Progress
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta5 → 2.0-rc1
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-rc1 → 2.0-beta5
Martin Packman (gz)
Changed in juju-core:
status: In Progress → Fix Released
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta5 → none
milestone: none → 2.0-beta5
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.