From 9e5342bfd698aeef4499f647d3c591d7145aa5aa Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar Date: Wed, 11 Mar 2026 10:53:43 +0100 Subject: [PATCH] fix: Gitea labels as body text, demote parse log to debug Gitea API expects label IDs (integers), not names. Append label names to the issue body instead. Also lower "Parsing file" log from info to debug to reduce noise. Co-Authored-By: Claude Opus 4.6 --- compliance-agent/src/trackers/gitea.rs | 16 +++++++++------- compliance-graph/src/parsers/registry.rs | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/compliance-agent/src/trackers/gitea.rs b/compliance-agent/src/trackers/gitea.rs index 1d69a14..4e8cc20 100644 --- a/compliance-agent/src/trackers/gitea.rs +++ b/compliance-agent/src/trackers/gitea.rs @@ -38,15 +38,17 @@ impl IssueTracker for GiteaTracker { ) -> Result { let url = self.api_url(&format!("/repos/{owner}/{repo}/issues")); - let mut payload = serde_json::json!({ - "title": title, - "body": body, - }); + // Gitea expects label IDs (integers), not names. Append label names + // to the body instead since resolving IDs would require extra API calls. + let mut full_body = body.to_string(); if !labels.is_empty() { - // Gitea expects label IDs, but we can pass label names via the API - // For simplicity, we add labels as part of the body if they can't be resolved - payload["labels"] = serde_json::json!(labels); + full_body.push_str("\n\n**Labels:** "); + full_body.push_str(&labels.join(", ")); } + let payload = serde_json::json!({ + "title": title, + "body": full_body, + }); let resp = self .http diff --git a/compliance-graph/src/parsers/registry.rs b/compliance-graph/src/parsers/registry.rs index 7f3dcc7..0d42809 100644 --- a/compliance-graph/src/parsers/registry.rs +++ b/compliance-graph/src/parsers/registry.rs @@ -3,7 +3,7 @@ use std::path::Path; use compliance_core::error::CoreError; use compliance_core::traits::graph_builder::{LanguageParser, ParseOutput}; -use tracing::info; +use tracing::{debug, info}; use super::javascript::JavaScriptParser; use super::python::PythonParser; @@ -65,7 +65,7 @@ impl ParserRegistry { }; let parser = &self.parsers[parser_idx]; - info!( + debug!( file = %file_path.display(), language = parser.language(), "Parsing file"