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

Binary package rename (SC-1623) #2887

Merged
merged 12 commits into from
Feb 7, 2024
Merged

Binary package rename (SC-1623) #2887

merged 12 commits into from
Feb 7, 2024

Conversation

orndorffgrant
Copy link
Collaborator

@orndorffgrant orndorffgrant commented Dec 11, 2023

Why is this needed?

This PR renames the binary packages created from ubuntu-advantage-tools as agreed. The new package names are "ubuntu-pro-client" and "ubuntu-pro-image-auto-attach".

This PR is packaging heavy and deserves extra scrutiny there.

This PR also adjusts our tests to use the new packages.

A subsequent PR will also include a manual test script for testing the transition

Test Steps

Test adding this ppa and upgrading: ppa:orndorffgrant/proclient-rename-test

A test that can only be done with debs and not with a proper apt source of the full ubuntu-advantage-tools set of binaries:

  1. launch a lxd container
  2. copy over just ubuntu-pro-client.deb
  3. apt install ubuntu-pro-client.deb
    That should fail saying that ubuntu-advantage-tools >=31 is also required

Checklist

  • I have updated or added any unit tests accordingly
  • I have updated or added any integration tests accordingly
  • Changes here need to be documented, and this was done in:

Does this PR require extra reviews?

  • Yes
  • No

Copy link

Jira: SC-1623

GitHub Issues: No GitHub issues are fixed by this PR. (No commits have Fixes: #### references)

Launchpad Bugs: No Launchpad bugs are fixed by this PR. (No commits have LP: #### references)

Documentation: The changes in this PR do not require documentation changes.

👍 this comment to confirm that this is correct.

Copy link

github-actions bot commented Dec 12, 2023

🌎 This PR changes translatable messages. 🌏

Please select which scenarios apply. For further explanation, please read our policy on message changes.

  • New messages are being added.
    • We will ask translators to take a look and add translations if they have time, but it will not block this PR.
  • Existing messages are being changed.
    • ⚠️ Please add a comment with justification of why messages are being altered.
    • If the changes are trivial (e.g. a typo fix), then translations must be preserved.
    • If the changes are substantial, then we will ask translators to take a look and update translations if they have time, but it will not block this PR.
  • Existing messages are being deleted.
    • No special action needed.

@orndorffgrant
Copy link
Collaborator Author

orndorffgrant commented Dec 12, 2023

  • Existing messages are being changed.

    • ⚠️ Please add a comment with justification of why messages are being altered.
    • If the changes are trivial (e.g. a typo fix), then translations must be preserved.
    • If the changes are substantial, then we will ask translators to take a look and update translations if they have time, but it will not block this PR.

Only the package name inside a message is being updated. Any translated messages that include it will be updated in this PR.

@orndorffgrant orndorffgrant force-pushed the binary-package-rename branch 4 times, most recently from 9539e30 to 0f5d0a8 Compare December 13, 2023 20:24
debian/control Outdated
@@ -32,6 +32,15 @@ Vcs-Browser: https://github.com/canonical/ubuntu-pro-client
Rules-Requires-Root: no

Package: ubuntu-advantage-tools
Depends: ubuntu-pro-client, ${misc:Depends}
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably don't need ${misc:Depends} here (but it's also not harmful in any way).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed it but then lintian gives debhelper-but-no-misc-depends as a warning so I'll add it back

debian/control Outdated

Package: ubuntu-pro-client-l10n
Architecture: any
Depends: ${misc:Depends}, ubuntu-advantage-tools (>=30~)
Depends: ${misc:Depends}, ubuntu-pro-client (>=31~)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be able to automate these versioned dependencies by using ${binary:Version}, see the deb-substvars(5) manpage.

Copy link
Contributor

@lucasmoura lucasmoura left a comment

Choose a reason for hiding this comment

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

As @paride mentioned, we still need to explore ${binary:Version}, but besides that point, I can confirm that this setup works and we don't detach when upgrading to the new binary package

Copy link
Member

@renanrodrigo renanrodrigo left a comment

Choose a reason for hiding this comment

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

LGTM overall, works on the local tests I did.
However, as I would not have the expertise for a final approval, I am binding this to Paride+SRU aproval of course :D

@orndorffgrant orndorffgrant force-pushed the binary-package-rename branch 3 times, most recently from b7af0f7 to e0e1fff Compare January 8, 2024 18:40
@orndorffgrant orndorffgrant marked this pull request as ready for review January 8, 2024 19:11
@orndorffgrant orndorffgrant mentioned this pull request Jan 9, 2024
6 tasks
@orndorffgrant orndorffgrant force-pushed the binary-package-rename branch 2 times, most recently from ec64a2c to 23e58f7 Compare January 10, 2024 16:16
@orndorffgrant orndorffgrant mentioned this pull request Jan 12, 2024
5 tasks
@orndorffgrant
Copy link
Collaborator Author

@paride @basak We are officially using this method for the binary package rename. Please review it here in this PR. When we are happy with it, I'll merge and add it on top of the release PR (#2913).

Also, please note that there is a product desire to totally remove the ubuntu-advantage-tools transition package in 26.04 onwards. Please take that future change into account when reviewing.

Copy link
Contributor

@paride paride left a comment

Choose a reason for hiding this comment

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

On d/control:

The identical descriptions for the transitional packages make lintian slightly unhappy:

I: ubuntu-advantage-tools source: duplicate-long-description ubuntu-advantage-pro ubuntu-advantage-tools [debian/control]
I: ubuntu-advantage-tools source: duplicate-short-description ubuntu-advantage-pro ubuntu-advantage-tools [debian/control]

Consider overriding that lintian tag, or using slightly different descriptions (e.g. naming the package: transitional dummy package for <package>).

On lintian

This one way I run lintian. From the unpackage source tree (the proposed branch in this case), I build the package creating a .changes file that contains both the binary packages and source package, e.g.

DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -sa -us -uc

That nocheck is to skip tests, useful to make iterations quicker. Then I run lintian like this:

lintian -EvIL +pedantic

to get all possible warnings. It will automatically find the relevant ../*.changes file and check it both the binary packages and source package it refers.

Let's make sure that this branch does not introduce new warnings; or if it does and we are OK with those, let's override them.

debian/control Outdated
Architecture: all
Priority: optional
Section: oldlibs
Description: transitional package
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: the best practice is to use the "transitional dummy package" string, see https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.en.html#best-practices-for-debian-control.

debian/control Outdated
@@ -35,6 +35,15 @@ Vcs-Browser: https://github.com/canonical/ubuntu-pro-client
Rules-Requires-Root: no

Package: ubuntu-advantage-tools
Depends: ubuntu-pro-client (= ${binary:Version}), ${misc:Depends}
Copy link
Contributor

Choose a reason for hiding this comment

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

This Depends together with Architecture: all (which is correct for a transitional package) causes the following lintian error:

E: ubuntu-advantage-tools source: not-binnmuable-all-depends-any ubuntu-advantage-tools -> ubuntu-pro-client

(Run lintian-explain-tags not-binnmuable-all-depends-any for more info on it.) Now, this is not an issue on Ubuntu, because in Ubuntu we don't name binNMUs, however I think we should still avoid in in any case.

The easiest way in my opinion is to drop the versioned dependency altogether, we don't need to worry about an ubuntu-pro-client package being "old" because we're just introducing it. It will be the "real" package to have versioned dependencies as needed.

debian/control Outdated
Breaks: ubuntu-advantage-tools (<<31~)
Replaces: ubuntu-advantage-tools (<<31~)
# IMPORTANT: ubuntu-pro-client does not "Provide" ubuntu-advantage-tools
# TODO fill this in with rationale after testing.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine not to have a Provides for the replaced package if not needed, but if you have an explanation on why we don't want it (so we avoid adding it in the future), +1 for adding a comment on it under the ubuntu-pro-client binary package stanza.

@paride
Copy link
Contributor

paride commented Jan 18, 2024

@orndorffgrant added a few review comments, but it should be all small stuff, the general approach looks good.

@orndorffgrant
Copy link
Collaborator Author

Thank you @paride! I believe I have addressed all of your comments in the latest commits

Copy link
Contributor

@paride paride left a comment

Choose a reason for hiding this comment

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

Thanks for addressing all the review comments, this LGTM!

Copy link
Contributor

@basak basak left a comment

Choose a reason for hiding this comment

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

As discussed, this is very complex and so I fear that it will go wrong for some edge case. We will need to rely on good testing, and I understand that's already been discussed and there's a good plan for this. I have not been able to spot any significant issues. A couple of very minor comments are inline.

debian/rules Outdated
@@ -39,50 +58,54 @@ endif
endif

override_dh_gencontrol:
echo extra:Depends=$(APT_PKG_DEPS) $(DISTRO_INFO_DEPS) >> debian/ubuntu-advantage-tools.substvars
echo extra:Depends=$(APT_PKG_DEPS) $(DISTRO_INFO_DEPS) $(SELF_DEPS) >> debian/ubuntu-pro-client.substvars
Copy link
Contributor

Choose a reason for hiding this comment

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

We've got > in $(SELF_DEPS) so does the echo need to be quoted? Presumably you've tested it and it works as-is so this is just a style thing, but it is making me twitchy :-)

Eg. I think this should work?

echo "extra:Depends=$(APT_PKG_DEPS) $(DISTRO_INFO_DEPS) $(SELF_DEPS)" >> debian/ubuntu-pro-client.substvars

Ah - I think this line might have been removed in a future commit anyway? But still I think we're still writing > to substvars so quoting is a good idea unless I've missed something.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep the end result of this PR is currently no change to that part of the line, but it should have quotes. I'll go ahead and add them in a new commit on top.

debian/control Outdated
# On those releases, ubuntu-minimal (and ubuntu-cloud-minimal) Depends on
# ubuntu-advantage-tools, which prevents it from being removed without also
# removing ubuntu-minimal or ubuntu-cloud-minimal. We consider that to be a
# sufficient # warning to users that removing ubuntu-advantage-tools is not
Copy link
Contributor

Choose a reason for hiding this comment

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

(Very very minor) wrap error

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Whoops! I'll fix it

orndorffgrant and others added 11 commits February 6, 2024 14:59
We're renaming the following packages using transitional packages to
align the package names with the product naming:

 * ubuntu-advantage-tools -> ubuntu-pro-client
 * ubuntu-advantage-pro -> ubuntu-pro-image-auto-attach

Because old versions of ubuntu-advantage-tools will break ESM upon
removal, and ubuntu-pro-client "Breaks" ubuntu-advantage-tools <<31~,
we need to force existing instances to upgrade to ubuntu-advantage-tools
31 (the transitional package) in order to install the new
ubuntu-pro-client package.

Enforcing that is accomplished via a Depends: ubuntu-advantage-tools on
existing Ubuntu releases. Future Ubuntu releases (Noble onward) will not have
this Depends.

Because of that, all previous package migrations (from versions
older than 31) are left in ubuntu-advantage-tools.{preinst,postinst,postrm}.
All future package migrations will happen in ubuntu-pro-client.{preinst,postinst,postrm}.
By removing "Provides: ubuntu-advantage-tools", we lower the chances of
ubuntu-advantage-tools <31 being removed during an install of
ubuntu-pro-client, becuase ubuntu-minimal (and ubuntu-cloud-minimal)
Depend on ubuntu-advantage-tools. This removes the need for
ubuntu-pro-client Depends: ubuntu-advantage-tools.
Add integration test that install the ubuntu-advantage-tools
transition package and checks that it also install the
new ubuntu-pro-client package.

We are also performing the same check for the ubuntu-advantage-pro
package
@orndorffgrant orndorffgrant merged commit 9e7d4a3 into main Feb 7, 2024
25 checks passed
@orndorffgrant orndorffgrant deleted the binary-package-rename branch February 7, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants