Skip to content

Commit

Permalink
Small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoverbear committed Feb 16, 2024
1 parent f9573f0 commit daa7d45
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down Expand Up @@ -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
Expand Down
13 changes: 8 additions & 5 deletions src/release_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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");
Expand All @@ -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,
Expand Down

0 comments on commit daa7d45

Please sign in to comment.