Skip to content
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

Deprecate series in bundles #17348

Merged

Conversation

jack-w-shaw
Copy link
Member

@jack-w-shaw jack-w-shaw commented May 7, 2024

Show a deprecation warning when deploying a bundle with series

We are deprecating series in favour of base in general. In Juju 4.0 we will error out if a bundle provides a base. This change in in preparation for this later breaking change

Checklist

  • Code style: imports ordered, good names, simple structure, etc
  • Comments saying why design decisions were made
  • Go unit tests, with comments saying what you're testing
  • Integration tests, with comments saying what you're testing
  • doc.go added or updated in changed packages

QA steps

Deploy some bundles

$ cat ./bundle.yaml
series: focal
applications:
  ubuntu:
    charm: ubuntu
    num_units: 1
    to:
    - "0"
machines:
  "0":

$ juju deploy ./bundle.yaml
WARNING series in being deprecated in favour of bases. For more information about the transition to bases see https://discourse.charmhub.io/t/transition-from-series-to-base-in-juju-4-0/14127
...
$ cat bundle.yaml 
applications:
  ubuntu:
    series: focal
    charm: ubuntu
    num_units: 1
    to:
    - "0"
machines:
  "0":
    base: ubuntu@20.04

$ juju deploy ./bundle.yaml
WARNING series in being deprecated in favour of bases. For more information about the transition to bases see https://discourse.charmhub.io/t/transition-from-series-to-base-in-juju-4-0/14127
...
$ cat bundle.yaml 
applications:
  ubuntu:
    base: ubuntu@20.04
    charm: ubuntu
    num_units: 1
    to:
    - "0"
machines:
  "0":
    series: focal

$ juju deploy ./bundle.yaml
WARNING series in being deprecated in favour of bases. For more information about the transition to bases see https://discourse.charmhub.io/t/transition-from-series-to-base-in-juju-4-0/14127
...
$ cat ./bundle.yaml
series: focal
default-base: ubuntu@20.04
applications:
  ubuntu:
    charm: ubuntu
    num_units: 1
    to:
    - "0"
machines:
  "0":

$ juju deploy ./bundle.yaml
WARNING series in being deprecated in favour of bases. For more information about the transition to bases see https://discourse.charmhub.io/t/transition-from-series-to-base-in-juju-4-0/14127
...
default-base: ubuntu@20.04
applications:
  ubuntu:
    charm: ubuntu
    num_units: 1
    to:
    - "0"
machines:
  "0":

$ juju deploy ./bundle.yaml
...
$ juju deploy charmed-kubernetes
Located bundle "charmed-kubernetes" in charm-hub, revision 1243
WARNING series in being deprecated in favour of bases. For more information about the transition to bases see https://discourse.charmhub.io/t/transition-from-series-to-base-in-juju-4-0/14127
...

Links

Jira card: JUJU-5596

@jack-w-shaw jack-w-shaw changed the title Deprectae series in bundles Deprecate series in bundles May 7, 2024
@jack-w-shaw jack-w-shaw force-pushed the JUJU-5996_deprecate_bundles_with_series branch from 23a7e82 to 262269c Compare May 7, 2024 12:49
Copy link
Member

@SimonRichardson SimonRichardson left a comment

Choose a reason for hiding this comment

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

I'm not a fan of doing this in 3.1, as we've already released this. We should be doing things with "The Principle of Least Surprise". If the user deployed a bundle yesterday with no warning and if the user got an automatic snap refresh and deployed the same bundle today, they get a warning, that's concerning.

I think this should have been in 3.5

@SimonRichardson
Copy link
Member

Also if we do land this, we shouldn't use that text. As it's not only bundles that this issue concerns.

WARNING series is being deprecated in favor of base. See ... for more information about the transition to bases.

@jack-w-shaw
Copy link
Member Author

I'm not a fan of doing this in 3.1, as we've already released this. We should be doing things with "The Principle of Least Surprise". If the user deployed a bundle yesterday with no warning and if the user got an automatic snap refresh and deployed the same bundle today, they get a warning, that's concerning.

I think this should have been in 3.5

Not sure if I agree this principle applies for a deprecation warning. The reason I picked 3.1 is to socialise this warning to as many people as possible. If someone has only been using 3.1 and they're 'surprised' by this warning after a snap refresh, that's probably a good thing

Especially given the warning specifically mentions the version this functionality will be released. A user running 3.1 who suddenly sees this will quite quickly realise it won't affect them until a later major version

@jack-w-shaw
Copy link
Member Author

Also if we do land this, we shouldn't use that text. As it's not only bundles that this issue concerns.

WARNING series is being deprecated in favor of base. See ... for more information about the transition to bases.

Yes I should probably create a discourse post highlighting all the differences

@SimonRichardson
Copy link
Member

Especially given the warning specifically mentions the version this functionality will be released. A user running 3.1 who suddenly sees this will quite quickly realise it won't affect them until a later major version

Also, it will warn them every single time, as the person who deploys might not be the author of the charm. Something to consider.

@hmlanigan hmlanigan self-requested a review May 7, 2024 16:02
@hpidcock hpidcock added the 3.1 label May 8, 2024
Show a deprecation warning when deploying a bundle with series
@jack-w-shaw jack-w-shaw force-pushed the JUJU-5996_deprecate_bundles_with_series branch from 262269c to c9aaaad Compare May 8, 2024 14:47
@jack-w-shaw
Copy link
Member Author

/merge

@jujubot jujubot merged commit 8d753a3 into juju:3.1 May 23, 2024
19 of 22 checks passed
@jack-w-shaw jack-w-shaw mentioned this pull request May 23, 2024
jujubot added a commit that referenced this pull request May 23, 2024
#17413

Merges:
- #17348

Conflicts:
- cmd/juju/application/bundle/bundle.go
- cmd/juju/application/bundle/bundle_test.go
- cmd/juju/application/deployer/bundle.go

Conflicts took some minor restructuring to resolve
@Aflynn50 Aflynn50 mentioned this pull request May 31, 2024
jujubot added a commit that referenced this pull request May 31, 2024
#17458

Merge from 3.4 to 3.5 with no conflicts.

This merge includes the following PRs:
- #17440 from jack-w-shaw
- #17453 from hpidcock
- #17444 from Aflynn50
- #17448 from hpidcock
- #17446 from wallyworld
- #17422 from SimonRichardson
- #17436 from hpidcock
 - #17348 from jack-w-shaw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants