From bb7b8eb4399282246b099503785255e1c058d9f6 Mon Sep 17 00:00:00 2001 From: kanak1125 Date: Tue, 31 Mar 2026 11:14:16 +0545 Subject: [PATCH 1/2] feat: automate moving tag on new tag push --- .github/workflows/move-major-tag.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/move-major-tag.yml diff --git a/.github/workflows/move-major-tag.yml b/.github/workflows/move-major-tag.yml new file mode 100644 index 0000000..1b7a02e --- /dev/null +++ b/.github/workflows/move-major-tag.yml @@ -0,0 +1,24 @@ +name: Move v1 tag + +on: + push: + tags: + - 'v1.*' + +permissions: + contents: write + +jobs: + update-major-tag: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Move v1 tag + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + + git tag -f v1 + git push origin v1 --force \ No newline at end of file From 644bee1dc3b972f268de48c96204af34c529c790 Mon Sep 17 00:00:00 2001 From: kanak1125 Date: Tue, 31 Mar 2026 11:32:16 +0545 Subject: [PATCH 2/2] fix: resolve the cargo fmt error --- api/src/handlers/manifest.rs | 4 +--- api/src/services/report_service.rs | 16 ++++++---------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/api/src/handlers/manifest.rs b/api/src/handlers/manifest.rs index c4ac01f..c1f7846 100644 --- a/api/src/handlers/manifest.rs +++ b/api/src/handlers/manifest.rs @@ -89,9 +89,7 @@ pub async fn get_manifest() -> impl IntoResponse { // Read metadata.json for this run if it exists let metadata: Option = std::fs::read_to_string( - report_path - .join(file_name) - .join("metadata.json"), + report_path.join(file_name).join("metadata.json"), ) .ok() .and_then(|s| serde_json::from_str(&s).ok()); diff --git a/api/src/services/report_service.rs b/api/src/services/report_service.rs index 73b0b16..419f2c1 100644 --- a/api/src/services/report_service.rs +++ b/api/src/services/report_service.rs @@ -218,12 +218,7 @@ pub async fn upload_report(mut multipart: Multipart) -> impl IntoResponse { "report_type": report_type, "created_at": created_at_unix }); - if let Err(e) = tokio::fs::write( - report_dir.join("metadata.json"), - metadata.to_string(), - ) - .await - { + if let Err(e) = tokio::fs::write(report_dir.join("metadata.json"), metadata.to_string()).await { eprintln!("Warning: Failed to write metadata.json: {}", e); } @@ -349,11 +344,12 @@ pub async fn upload_report(mut multipart: Multipart) -> impl IntoResponse { // Create/update 'latest' symlink pointing to this run's numeric ID let latest_link = parent_dir.join("latest"); - if tokio::fs::symlink_metadata(&latest_link).await.is_ok() { - if let Err(e) = tokio::fs::remove_file(&latest_link).await { - eprintln!("Warning: Failed to remove old 'latest' symlink: {}", e); - } + if tokio::fs::symlink_metadata(&latest_link).await.is_ok() + && let Err(e) = tokio::fs::remove_file(&latest_link).await + { + eprintln!("Warning: Failed to remove old 'latest' symlink: {}", e); } + if let Err(e) = tokio::fs::symlink(&report_id, &latest_link).await { eprintln!("Warning: Failed to create 'latest' symlink: {}", e); }