From daa7d45e100afa3e4a56f8908898a17896eb5027 Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Fri, 16 Feb 2024 14:26:29 -0800 Subject: [PATCH] Small tweaks --- src/cli/mod.rs | 8 ++++---- src/release_metadata.rs | 13 ++++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 0ca6be9..41a6533 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -303,7 +303,7 @@ impl FlakeHubPushCli { let is_github_actions = self.github_token.0.is_some() || std::env::var("GITHUB_ACTION").ok().is_some(); if is_github_actions { - tracing::debug!("Running inside Github Actions, enriching from environment"); + tracing::debug!("Running inside Github Actions, will enrich with GitHub API data and push with authorized Github bearer token"); self.populate_missing_from_github() } @@ -473,10 +473,10 @@ impl FlakeHubPushCli { if github_graphql_data_result.spdx_identifier != spdx_expression.as_ref().map(|v| v.to_string()) { - tracing::debug!( - "Inferred SPDX identifier from GitHub API was `{}` while `{}` was passed via argument", + tracing::warn!( + "SPDX identifier `{}` was passed via argument, but GitHub's API suggests it may be `{}`", + spdx_expression.as_ref().map(|v| v.to_string()).unwrap_or_else(|| "None".to_string()), github_graphql_data_result.spdx_identifier.unwrap_or_else(|| "None".to_string()), - spdx_expression.as_ref().map(|v| v.to_string()).unwrap_or_else(|| "None".to_string()) ) } spdx_expression diff --git a/src/release_metadata.rs b/src/release_metadata.rs index 5478a48..9725762 100644 --- a/src/release_metadata.rs +++ b/src/release_metadata.rs @@ -84,7 +84,7 @@ impl ReleaseMetadata { flake_store_path = %flake_store_path.display(), subdir = %subdir.display(), description = tracing::field::Empty, - readme_path = tracing::field::Empty, + readme = tracing::field::Empty, %revision, %commit_count, spdx_identifier = tracing::field::Empty, @@ -124,9 +124,12 @@ impl ReleaseMetadata { None }; - let readme_path = get_readme(flake_store_path).await?; - if let Some(readme_path) = &readme_path { - span.record("readme_path", tracing::field::display(readme_path)); + let readme = get_readme(flake_store_path).await?; + if readme.is_some() { + span.record( + "readme", + tracing::field::display(flake_store_path.join("README.md").display()), + ); } tracing::trace!("Collected ReleaseMetadata information"); @@ -135,7 +138,7 @@ impl ReleaseMetadata { description, repo: upload_name.to_string(), raw_flake_metadata: flake_metadata.clone(), - readme: readme_path, + readme, revision, commit_count, visibility,