From 2280bee6e2faa14b6f061bd956ca0985bf2ad855 Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Wed, 2 Jul 2025 15:13:31 -0700 Subject: [PATCH 1/2] JSON output was missing committer name and email --- CHANGELOG.md | 2 ++ Cargo.toml | 4 ++-- src/reporter.rs | 4 ++++ tests/smoke_update.rs | 5 +++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7710fa..026c26d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. +## [1.19.0] +- JSON output was missing committer name and email ## [1.18.1] - Restored --version cli argument diff --git a/Cargo.toml b/Cargo.toml index 98fb1fd..779f8a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ publish = false [package] name = "kingfisher" -version = "1.18.1" +version = "1.19.0" edition.workspace = true rust-version.workspace = true license.workspace = true @@ -159,7 +159,7 @@ rand = "0.9.1" percent-encoding = "2.3.1" trust-dns-resolver = { version = "0.23.2", default-features = false, features = ["tokio-runtime"] } atty = "0.2.14" -self_update = { version = "0.42.0", default-features = false, features = ["rustls"] } +self_update = { version = "0.42.0", default-features = false, features = ["rustls", "archive-tar", "archive-zip", "compression-flate2"] } semver = "1.0.26" [dependencies.tikv-jemallocator] diff --git a/src/reporter.rs b/src/reporter.rs index a720c9e..93583fa 100644 --- a/src/reporter.rs +++ b/src/reporter.rs @@ -80,6 +80,10 @@ impl DetailsReporter { "id": cmd.commit_id.to_string(), "url": format!("{}/commit/{}", repo_url, cmd.commit_id), "date": atime, + "committer": { + "name": String::from_utf8_lossy(&cmd.committer_name), + "email": String::from_utf8_lossy(&cmd.committer_email), + }, // "author": { // "name": String::from_utf8_lossy(&cmd.author_name), // "email": String::from_utf8_lossy(&cmd.author_email), diff --git a/tests/smoke_update.rs b/tests/smoke_update.rs index 8224d42..929eea7 100644 --- a/tests/smoke_update.rs +++ b/tests/smoke_update.rs @@ -5,6 +5,11 @@ use wiremock::{ Mock, MockServer, ResponseTemplate, }; +use flate2::{write::GzEncoder, Compression}; +use tar::Builder; +use tempfile::tempdir; +use std::fs::{self, File}; + #[tokio::test] async fn no_update_when_flag_set() { let args = GlobalArgs { no_update_check: true, ..Default::default() }; From b13bdacb2f5b0d26722e3c2e6d9e4f2378feb93e Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Wed, 2 Jul 2025 15:20:50 -0700 Subject: [PATCH 2/2] Fixed Gitlab rule which was incorrectly identifying certain tokens as valid --- CHANGELOG.md | 1 + data/rules/gitlab.yml | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 026c26d..dde30d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## [1.19.0] - JSON output was missing committer name and email +- Fixed Gitlab rule which was incorrectly identifying certain tokens as valid ## [1.18.1] - Restored --version cli argument diff --git a/data/rules/gitlab.yml b/data/rules/gitlab.yml index d7c3ca2..c7475d6 100644 --- a/data/rules/gitlab.yml +++ b/data/rules/gitlab.yml @@ -71,6 +71,11 @@ rules: - report_response: true - type: StatusMatch status: 200 + - type: WordMatch + words: + - '"token is missing"' + - '"403 Forbidden"' + negative: true url: https://gitlab.com/api/v4/runners/verify - name: GitLab Pipeline Trigger Token @@ -104,4 +109,9 @@ rules: - type: StatusMatch status: - 200 + - type: WordMatch + words: + - '"token is missing"' + - '"403 Forbidden"' + negative: true url: https://gitlab.com/api/v4/ci/pipeline_triggers/{{ TOKEN }} \ No newline at end of file