Skip to content

Commit

Permalink
Use gzip (.gz) instead of bzip2 (.bz2) to compress logs (#1408)
Browse files Browse the repository at this point in the history
## Problem

Quoting #1378:

GitHub does not allow attaching `bzip2` files. In order to make error
reporting easier, `agama logs store` should use a different format
(e.g., `.gz` and `.tgz` are supported). Otherwise, you need to
uncompress and compress the logs again before submitting them.

## Solution

Use `gzip` and `.gz` instead.


## Testing

- [x] *Tested manually*
  • Loading branch information
mvidner authored Jun 28, 2024
2 parents e8ea0ef + 0b7ccea commit accf894
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
/*.pot
*.mo
*.bz2
# Do NOT ignore .github: for git this is a no-op
# but it helps ripgrep (rg) which would otherwise ignore dotfiles and dotdirs
!/.github/
2 changes: 1 addition & 1 deletion rust/agama-cli/src/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const DEFAULT_PATHS: [&str; 14] = [
const DEFAULT_RESULT: &str = "/tmp/agama-logs";
// what compression is used by default:
// (<compression as distinguished by tar>, <an extension for resulting archive>)
const DEFAULT_COMPRESSION: (&str, &str) = ("bzip2", "tar.bz2");
const DEFAULT_COMPRESSION: (&str, &str) = ("gzip", "tar.gz");
const TMP_DIR_PREFIX: &str = "agama-logs.";

/// A wrapper around println which shows (or not) the text depending on the boolean variable
Expand Down
2 changes: 1 addition & 1 deletion rust/agama-server/src/manager/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,6 @@ async fn generate_logs() -> Result<String, Error> {
.status()
.map_err(|e| ServiceError::CannotGenerateLogs(e.to_string()))?;

let full_path = format!("{path}.tar.bz2");
let full_path = format!("{path}.tar.gz");
Ok(full_path)
}
7 changes: 7 additions & 0 deletions rust/package/agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jun 28 06:56:02 UTC 2024 - Martin Vidner <[email protected]>

- Use gzip (.gz) instead of bzip2 (.bz2) to compress logs
so that they can be attached to GitHub issues
(gh#openSUSE/agama#1378)

-------------------------------------------------------------------
Thu Jun 27 13:22:51 UTC 2024 - Imobach Gonzalez Sosa <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion rust/package/agama.spec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ BuildRequires: pkgconfig(pam)
Requires: jsonnet
Requires: lshw
# required by "agama logs store"
Requires: bzip2
Requires: gzip
Requires: tar
# required for translating the keyboards descriptions
BuildRequires: xkeyboard-config-lang
Expand Down
2 changes: 1 addition & 1 deletion setup-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ which cargo || $SUDO zypper --non-interactive install cargo

# Packages required by Rust code (see ./rust/package/agama.spec)
$SUDO zypper --non-interactive install \
bzip2 \
clang-devel \
gzip \
jsonnet \
lshw \
pam-devel \
Expand Down
7 changes: 7 additions & 0 deletions web/package/agama-web-ui.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jun 28 06:56:02 UTC 2024 - Martin Vidner <[email protected]>

- Use gzip (.gz) instead of bzip2 (.bz2) to compress logs
so that they can be attached to GitHub issues
(gh#openSUSE/agama#1378)

-------------------------------------------------------------------
Thu Jun 27 13:23:08 UTC 2024 - Imobach Gonzalez Sosa <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/core/LogsButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Alert, Button } from "@patternfly/react-core";
import { Popup } from "~/components/core";
import { _ } from "~/i18n";

const FILENAME = "agama-installation-logs.tar.bzip2";
const FILENAME = "agama-installation-logs.tar.gz";

/**
* Button for collecting and downloading YaST logs
Expand Down

0 comments on commit accf894

Please sign in to comment.