Skip to content

fix: Small changes affecting packaging and cleanup#2641

Open
Syedowais312 wants to merge 3 commits intounikraft:stagingfrom
Syedowais312:cleanup-package-removal
Open

fix: Small changes affecting packaging and cleanup#2641
Syedowais312 wants to merge 3 commits intounikraft:stagingfrom
Syedowais312:cleanup-package-removal

Conversation

@Syedowais312
Copy link

@Syedowais312 Syedowais312 commented Feb 8, 2026

Summary

Clean up leftover runtime artifacts when the KraftKit package is
removed or purged.

Changes

  • Install a cleanup helper via nfpm
  • Invoke cleanup logic from the postrm hook
  • Ensure no leftover artifacts remain after package removal

Testing

  • Built snapshot packages using GoReleaser
  • Installed .deb, verified artifacts
  • Removed and purged package, verified cleanup

closes: #2550

@Syedowais312 Syedowais312 force-pushed the cleanup-package-removal branch from fb76d9d to 5714893 Compare February 8, 2026 21:31
@Syedowais312
Copy link
Author

Hi @nderjung @craciunoiuc,
whenever you get a moment, could you please take a look at this PR?

Copy link
Member

@craciunoiuc craciunoiuc left a comment

Choose a reason for hiding this comment

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

Some comments

Copy link
Member

@nderjung nderjung left a comment

Choose a reason for hiding this comment

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

Please see our contribution guidelines for commit hygiene.

@nderjung nderjung changed the title fix(packaging): Clean up artifacts on package removal fix: Small changes affecting packaging and cleanup Feb 13, 2026
@Syedowais312 Syedowais312 force-pushed the cleanup-package-removal branch 5 times, most recently from 824da23 to 2b2e350 Compare February 17, 2026 08:20
@craciunoiuc craciunoiuc requested a review from Copilot February 17, 2026 08:31
@Syedowais312 Syedowais312 force-pushed the cleanup-package-removal branch from 2b2e350 to f0c3303 Compare February 17, 2026 08:34
Copy link
Member

@craciunoiuc craciunoiuc left a comment

Choose a reason for hiding this comment

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

some more comments my side

Comment on lines +4 to +8
CONFIG="${HOME}/.config/kraftkit/config.yaml"

# Defaults
CACHE_DIR="${HOME}/.cache/kraftkit"
DATA_DIR="${HOME}/.local/share/kraftkit"
Copy link
Member

Choose a reason for hiding this comment

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

Clean up for other users also

Copy link
Author

Choose a reason for hiding this comment

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

Do you want cleanup to apply only to the invoking user, or also root’s home when KraftKit was used via sudo? I want to avoid removing unrelated users’ data

Copy link

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

Adds package-removal cleanup for KraftKit by shipping a helper script via nfpm and wiring it into the Debian postrm hook, aiming to remove user runtime artifacts on uninstall/purge.

Changes:

  • Add scripts/cleanup-artifacts.sh and install it as /usr/libexec/kraftkit/cleanup-artifacts in nfpm packages
  • Add packaging/deb/postrm and register it as the nfpm postremove script
  • Update GoReleaser configs (stable + staging) to include the helper + postremove hook (and adjust build tags/ignore matrix)

Reviewed changes

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

File Description
scripts/cleanup-artifacts.sh Cleanup helper that attempts to derive artifact directories from config and delete them
packaging/deb/postrm Debian post-remove maintainer script invoking cleanup and deleting config on purge
.goreleaser-staging.yaml nfpm packaging updates to ship helper and run postremove hook
.goreleaser-stable.yaml nfpm packaging updates to ship helper and run postremove hook

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

Signed-off-by: syedowais312 <syedowais312sf@gmail.com>
Signed-off-by: syedowais312 <syedowais312sf@gmail.com>
@craciunoiuc
Copy link
Member

Please do a pass and click Resolve conversation for any comments that have been fixed.

Install the cleanup-artifacts helper in the package and
register the preremove and postremove scripts.

Enable container image storage and openpgp plugins.

Signed-off-by: syedowais312 <syedowais312sf@gmail.com>
@Syedowais312 Syedowais312 force-pushed the cleanup-package-removal branch from 8d1acbc to 1a59a58 Compare February 23, 2026 14:08
@Syedowais312
Copy link
Author

Please do a pass and click Resolve conversation for any comments that have been fixed.

Done. I have reviewed the comments and resolved the conversations where the issues have been addressed. The suggested changes that made sense have been applied...
Please let me know if anything else needs adjustment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🧊 Icebox

Development

Successfully merging this pull request may close these issues.

Add remove step to delete artifacts when removing package

4 participants