Compare commits

..

1 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
435d1634f3 chore(pre-commit): autoupdate
updates:
- [github.com/crate-ci/typos: v1.39.2 → v1](https://github.com/crate-ci/typos/compare/v1.39.2...v1)
2025-11-17 19:36:45 +00:00
24 changed files with 52 additions and 200 deletions

View File

@@ -2,7 +2,7 @@
name: Bug report
about: Topgrade is misbehaving
title: ''
type: Bug
labels: 'C-bug'
assignees: ''
---

View File

@@ -2,7 +2,7 @@
name: General feature request
about: Suggest a general feature, or feature within an already existing step
title: ''
type: Feature
labels: C-feature request
assignees: ''
---

View File

@@ -2,8 +2,7 @@
name: New step request
about: Suggest a new step/package manager to update
title: ''
type: Feature
labels: request step
labels: C-feature request, request step
assignees: ''
---

View File

@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

View File

@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

View File

@@ -24,7 +24,7 @@ jobs:
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
@@ -32,6 +32,6 @@ jobs:
uses: microsoft/DevSkim-Action@4b5047945a44163b94642a1cecc0d93a3f428cc6 # v1.0.16
- name: Upload DevSkim scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
uses: github/codeql-action/upload-sarif@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3
with:
sarif_file: devskim-results.sarif

View File

@@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
@@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
@@ -135,7 +135,7 @@ jobs:
matrix_target: ${{ matrix.target }}
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

View File

@@ -33,7 +33,7 @@ jobs:
env:
tag: ${{ github.event.client_payload.tag }}
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
@@ -169,7 +169,7 @@ jobs:
matrix_target: ${{ matrix.target }}
tag: ${{ github.event.client_payload.tag }}
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

View File

@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

View File

@@ -17,7 +17,7 @@ jobs:
id-token: write # For trusted publishing
steps:
- name: Checkout repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
persist-credentials: false
@@ -53,7 +53,7 @@ jobs:
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
persist-credentials: false

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Bump formulae
uses: dawidd6/action-homebrew-bump-formula@c5ddc585e75f0f750a8b4f610688b4bec9e80915 # v6
uses: dawidd6/action-homebrew-bump-formula@3428a0601bba3173ec0bdcc945be23fa27aa4c31 # v5
with:
# Custom GitHub access token with only the 'public_repo' scope enabled
token: ${{secrets.HOMEBREW_ACCESS_TOKEN}}

View File

@@ -15,7 +15,7 @@ jobs:
matrix:
target: [x86_64, x86, aarch64]
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
@@ -37,7 +37,7 @@ jobs:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
@@ -58,7 +58,7 @@ jobs:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
@@ -76,7 +76,7 @@ jobs:
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

View File

@@ -36,7 +36,7 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
@@ -71,6 +71,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
uses: github/codeql-action/upload-sarif@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3
with:
sarif_file: results.sarif

View File

@@ -16,7 +16,7 @@ repos:
- id: trailing-whitespace
- repo: https://github.com/crate-ci/typos
rev: v1.39.2
rev: v1
hooks:
- id: typos

View File

@@ -7,40 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [16.4.2](https://github.com/topgrade-rs/topgrade/compare/v16.4.1...v16.4.2) - 2025-11-20
### Other
- *(deps)* update dawidd6/action-homebrew-bump-formula action to v6 ([#1543](https://github.com/topgrade-rs/topgrade/pull/1543))
## [16.4.1](https://github.com/topgrade-rs/topgrade/compare/v16.4.0...v16.4.1) - 2025-11-20
### Other
- refactor run_containers error handling ([#1541](https://github.com/topgrade-rs/topgrade/pull/1541))
## [16.4.0](https://github.com/topgrade-rs/topgrade/compare/v16.3.0...v16.4.0) - 2025-11-20
### Added
- *(os)* add Origami Linux support ([#1530](https://github.com/topgrade-rs/topgrade/pull/1530))
- *(containers)* add option to run `system prune` ([#1523](https://github.com/topgrade-rs/topgrade/pull/1523))
### Fixed
- *(deps)* restore custom commands order ([#1535](https://github.com/topgrade-rs/topgrade/pull/1535))
### Other
- *(deps)* update clap, clap_builder, clap_complete ([#1540](https://github.com/topgrade-rs/topgrade/pull/1540))
- *(deps)* update github/codeql-action action to v4.31.4 ([#1531](https://github.com/topgrade-rs/topgrade/pull/1531))
- *(config)* add custom commands order test ([#1536](https://github.com/topgrade-rs/topgrade/pull/1536))
- make Config methods more consistent by utilizing `#[derive(Default)]` ([#1534](https://github.com/topgrade-rs/topgrade/pull/1534))
- *(issue templates)* use issue types ([#1533](https://github.com/topgrade-rs/topgrade/pull/1533))
- *(deps)* lock file maintenance ([#1505](https://github.com/topgrade-rs/topgrade/pull/1505))
- *(deps)* update actions/checkout digest to 93cb6ef ([#1526](https://github.com/topgrade-rs/topgrade/pull/1526))
- *(deps)* update actions/checkout action to v5.0.1 ([#1527](https://github.com/topgrade-rs/topgrade/pull/1527))
## [16.3.0](https://github.com/topgrade-rs/topgrade/compare/v16.2.1...v16.3.0) - 2025-11-16
### Added

14
Cargo.lock generated
View File

@@ -385,9 +385,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.53"
version = "4.5.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8"
checksum = "4c26d721170e0295f191a69bd9a1f93efcdb0aff38684b61ab5750468972e5f5"
dependencies = [
"clap_builder",
"clap_derive",
@@ -395,9 +395,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.53"
version = "4.5.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00"
checksum = "75835f0c7bf681bfd05abe44e965760fea999a5286c6eb2d59883634fd02011a"
dependencies = [
"anstream",
"anstyle",
@@ -407,9 +407,9 @@ dependencies = [
[[package]]
name = "clap_complete"
version = "4.5.61"
version = "4.5.60"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39615915e2ece2550c0149addac32fb5bd312c657f43845bb9088cb9c8a7c992"
checksum = "8e602857739c5a4291dfa33b5a298aeac9006185229a700e5810a3ef7272d971"
dependencies = [
"clap",
]
@@ -2964,7 +2964,7 @@ checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2"
[[package]]
name = "topgrade"
version = "16.4.2"
version = "16.3.0"
dependencies = [
"base64ct",
"chrono",

View File

@@ -6,7 +6,7 @@ keywords = ["upgrade", "update"]
license = "GPL-3.0-or-later"
repository = "https://github.com/topgrade-rs/topgrade"
rust-version = "1.84.1"
version = "16.4.2"
version = "16.3.0"
authors = ["Roey Darwish Dror <roey.ghost@gmail.com>", "Thomas Schönauer <t.schoenauer@hgs-wt.at>"]
exclude = ["doc/screenshot.gif", "BREAKINGCHANGES_dev.md"]
edition = "2021"
@@ -17,7 +17,7 @@ readme = "README.md"
home = "=0.5.11"
etcetera = "=0.10.0"
serde = { version = "~1.0", features = ["derive"] }
toml = { version = "=0.9.8", features = ["preserve_order"] }
toml = "=0.9.8"
which_crate = { version = "~8.0", package = "which" }
shellexpand = "~3.1"
clap = { version = "~4.5", features = ["cargo", "derive"] }

View File

@@ -342,10 +342,6 @@
# Specify the runtime to use for containers (default: "docker", allowed values: "docker", "podman")
# runtime = "podman"
# Run 'docker system prune' to clean up unused containers, networks, and build cache
# (default: false)
# system_prune = false
[lensfun]
# If disabled, Topgrade invokes `lensfunupdatedata` without root privilege,
# then the update will be only available to you. Otherwise, `sudo` is required,

View File

@@ -60,7 +60,6 @@ pub struct Containers {
#[merge(strategy = crate::utils::merge_strategies::vec_prepend_opt)]
ignored_containers: Option<Vec<String>>,
runtime: Option<ContainerRuntime>,
system_prune: Option<bool>,
}
#[derive(Deserialize, Default, Debug, Merge)]
@@ -204,10 +203,9 @@ pub struct Brew {
fetch_head: Option<bool>,
}
#[derive(Debug, Deserialize, Clone, Copy, Default)]
#[derive(Debug, Deserialize, Clone, Copy)]
#[serde(rename_all = "snake_case")]
pub enum ArchPackageManager {
#[default]
Autodetect,
Aura,
GarudaUpdate,
@@ -219,10 +217,9 @@ pub enum ArchPackageManager {
Yay,
}
#[derive(Clone, Copy, Debug, Deserialize, Default)]
#[derive(Clone, Copy, Debug, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ContainerRuntime {
#[default] // defaults to a popular choice
Docker,
Podman,
}
@@ -360,11 +357,10 @@ pub struct Misc {
show_distribution_summary: Option<bool>,
}
#[derive(Clone, Copy, Debug, Deserialize, ValueEnum, Default)]
#[derive(Clone, Copy, Debug, Deserialize, ValueEnum)]
#[clap(rename_all = "snake_case")]
#[serde(rename_all = "snake_case")]
pub enum TmuxSessionMode {
#[default]
AttachIfNotInSession,
AttachAlways,
}
@@ -959,16 +955,7 @@ impl Config {
.containers
.as_ref()
.and_then(|containers| containers.runtime)
.unwrap_or_default()
}
/// Whether to run system prune for containers.
pub fn containers_system_prune(&self) -> bool {
self.config_file
.containers
.as_ref()
.and_then(|containers| containers.system_prune)
.unwrap_or(false)
.unwrap_or(ContainerRuntime::Docker) // defaults to a popular choice
}
/// Tell whether the specified step should run.
@@ -1040,7 +1027,7 @@ impl Config {
.misc
.as_ref()
.and_then(|misc| misc.tmux_session_mode)
.unwrap_or_default()
.unwrap_or(TmuxSessionMode::AttachIfNotInSession)
}
/// Tell whether we should perform cleanup steps.
@@ -1294,7 +1281,7 @@ impl Config {
.vim
.as_ref()
.and_then(|c| c.force_plug_update)
.unwrap_or(false)
.unwrap_or_default()
}
/// Whether to send a desktop notification at the beginning of every step
@@ -1367,7 +1354,7 @@ impl Config {
.linux
.as_ref()
.and_then(|s| s.arch_package_manager)
.unwrap_or_default()
.unwrap_or(ArchPackageManager::Autodetect)
}
/// Extra yay arguments
@@ -1892,24 +1879,4 @@ mod test {
config.opt = CommandLineArgs::parse_from(["topgrade", "--remote-host-limit", "other_hostname"]);
assert!(!config.should_execute_remote(Ok("hostname".to_string()), "user@remote_hostname"));
}
/// Ensure that custom commands are stored in insertion order.
#[test]
fn test_custom_commands_order() {
let toml_str = r#"
[commands]
z = "cmd_z"
y = "cmd_y"
x = "cmd_x"
"#;
let order: Vec<_> = toml::from_str::<ConfigFile>(toml_str)
.expect("toml parse error")
.commands
.expect("commands field missing")
.keys()
.cloned()
.collect();
assert_eq!(order, vec!["z", "y", "x"]);
}
}

View File

@@ -11,7 +11,7 @@ use tracing::{debug, error, warn};
use wildmatch::WildMatch;
use crate::command::CommandExt;
use crate::error::{SkipStep, TopgradeError};
use crate::error::{self, SkipStep, TopgradeError};
use crate::terminal::print_separator;
use crate::{execution_context::ExecutionContext, utils::require};
use rust_i18n::t;
@@ -185,6 +185,7 @@ pub fn run_containers(ctx: &ExecutionContext) -> Result<()> {
));
}
let mut success = true;
let containers =
list_containers(&crt, ctx.config().containers_ignored_tags()).context("Failed to list Docker containers")?;
debug!("Containers to inspect: {:?}", containers);
@@ -219,21 +220,22 @@ pub fn run_containers(ctx: &ExecutionContext) -> Result<()> {
continue;
}
return Err(e);
success = false;
}
}
if ctx.config().containers_system_prune() {
// Run system prune to clean up unused containers, networks, and build cache
ctx.execute(&crt)
.args(["system", "prune", "--force"])
.status_checked()?
// Only run `image prune` if we don't run `system prune`
} else if ctx.config().cleanup() {
if ctx.config().cleanup() {
// Remove dangling images
debug!("Removing dangling images");
ctx.execute(&crt).args(["image", "prune", "-f"]).status_checked()?
if let Err(e) = ctx.execute(&crt).args(["image", "prune", "-f"]).status_checked() {
error!("Removing dangling images failed: {}", e);
success = false;
}
}
if success {
Ok(())
} else {
Err(eyre!(error::StepFailed))
}
}

View File

@@ -78,8 +78,6 @@ impl Distribution {
Some("neon") => Distribution::KDENeon,
Some("openmandriva") => Distribution::OpenMandriva,
Some("pclinuxos") => Distribution::PCLinuxOS,
Some(id) if id.starts_with("origami") => Distribution::FedoraImmutable,
_ => {
if let Some(name) = name {
if name.contains("Vanilla") {
@@ -1343,11 +1341,4 @@ mod tests {
fn test_cachyos() {
test_template(include_str!("os_release/cachyos"), Distribution::Arch);
}
#[test]
fn test_origami() {
test_template(include_str!("os_release/origami"), Distribution::FedoraImmutable);
test_template(include_str!("os_release/origami-nvidia"), Distribution::FedoraImmutable);
test_template(include_str!("os_release/origami-test"), Distribution::FedoraImmutable);
}
}

View File

@@ -1,23 +0,0 @@
NAME="Origami Linux"
VERSION="43.20251117.0 (COSMIC Atomic)"
RELEASE_TYPE="stable"
ID="origami-linux"
VERSION_ID="43"
VERSION_CODENAME=""
PRETTY_NAME="Origami 折り紙"
ANSI_COLOR="0;38;2;60;110;180"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:fedoraproject:fedora:43"
DEFAULT_HOSTNAME="origami"
HOME_URL="https://origami.wf/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f43/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://gitlab.com/groups/origami-linux/-/issues"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION="43"
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION="43"
SUPPORT_END="2026-12-02"
VARIANT="COSMIC Atomic"
VARIANT_ID="cosmic-atomic"
OSTREE_VERSION="43.20251117.0"

View File

@@ -1,23 +0,0 @@
NAME="Origami Linux Nvidia"
VERSION="43.20251117.0 (COSMIC Atomic)"
RELEASE_TYPE="stable"
ID="origami-linux-nvidia"
VERSION_ID="43"
VERSION_CODENAME=""
PRETTY_NAME="Origami 折り紙"
ANSI_COLOR="0;38;2;60;110;180"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:fedoraproject:fedora:43"
DEFAULT_HOSTNAME="origami"
HOME_URL="https://origami.wf/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f43/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://gitlab.com/groups/origami-linux/-/issues"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION="43"
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION="43"
SUPPORT_END="2026-12-02"
VARIANT="COSMIC Atomic"
VARIANT_ID="cosmic-atomic"
OSTREE_VERSION="43.20251117.0"

View File

@@ -1,23 +0,0 @@
NAME="Origami Linux Test"
VERSION="43.20251117.0 (COSMIC Atomic)"
RELEASE_TYPE="stable"
ID="origami-linux-test"
VERSION_ID="43"
VERSION_CODENAME=""
PRETTY_NAME="Origami 折り紙"
ANSI_COLOR="0;38;2;60;110;180"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:fedoraproject:fedora:43"
DEFAULT_HOSTNAME="origami"
HOME_URL="https://origami.wf/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f43/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://gitlab.com/groups/origami-linux/-/issues"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION="43"
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION="43"
SUPPORT_END="2026-12-02"
VARIANT="COSMIC Atomic"
VARIANT_ID="cosmic-atomic"
OSTREE_VERSION="43.20251117.0"