ci(lesavka): stabilize quality telemetry publishing

This commit is contained in:
Brad Stein 2026-05-17 14:04:35 -03:00
parent dca8b20528
commit 0210d5f54a
4 changed files with 33 additions and 9 deletions

6
Jenkinsfile vendored
View File

@ -60,9 +60,9 @@ spec:
CARGO_TERM_COLOR = 'always'
CARGO_BUILD_JOBS = '2'
CARGO_INCREMENTAL = '0'
CARGO_HOME = "${WORKSPACE}/.cargo-home"
CARGO_HOME = '/home/jenkins/agent/.cargo-home'
CARGO_TARGET_DIR = "${WORKSPACE}/target"
PATH = "${WORKSPACE}/.cargo-home/bin:/usr/local/cargo/bin:${PATH}"
PATH = "/home/jenkins/agent/.cargo-home/bin:/usr/local/cargo/bin:${PATH}"
DOCKER_BUILDKIT = '1'
LESAVKA_CI_PROFILE = "${params.LESAVKA_CI_PROFILE}"
QUALITY_GATE_PUSHGATEWAY_URL = "${params.QUALITY_GATE_PUSHGATEWAY_URL}"
@ -127,7 +127,7 @@ spec:
steps {
container('rust-ci') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh 'scripts/ci/hygiene_gate.sh'
sh 'QUALITY_GATE_PUSHGATEWAY_URL="${QUALITY_GATE_PUSHGATEWAY_URL}" scripts/ci/hygiene_gate.sh'
}
}
}

View File

@ -98,6 +98,16 @@ def repo_relative(path: str) -> str | None:
except Exception:
return None
def is_workspace_artifact_path(rel: str) -> bool:
parts = pathlib.PurePosixPath(rel).parts
return bool(parts) and parts[0] in {
'.cargo-home',
'.git',
'artifacts',
'target',
'tmp',
}
def run_git(*args: str) -> list[str]:
proc = subprocess.run(
['git', '-C', str(root), *args],
@ -110,7 +120,7 @@ def run_git(*args: str) -> list[str]:
def repo_files() -> list[str]:
tracked = run_git('ls-files')
untracked = run_git('ls-files', '--others', '--exclude-standard')
return sorted(set(tracked + untracked))
return sorted(path for path in set(tracked + untracked) if not is_workspace_artifact_path(path))
def is_test_path(rel: str) -> bool:
return 'tests' in pathlib.Path(rel).parts
@ -161,6 +171,8 @@ def repo_policy_violations(files: list[str]) -> list[str]:
def naming_policy_violations(files: list[str]) -> list[str]:
violations: list[str] = []
for path in files:
if is_workspace_artifact_path(path):
continue
if path.startswith('.git/') or path.startswith('target/'):
continue
stem = pathlib.Path(path).stem.lower()
@ -303,7 +315,7 @@ def doc_debt_counts(path: pathlib.Path) -> dict[str, int]:
counts: dict[str, int] = defaultdict(int)
for file in sorted(root.rglob('*.rs')):
rel = repo_relative(str(file))
if rel is None or '/src/' not in rel or '/target/' in rel:
if rel is None or is_workspace_artifact_path(rel) or '/src/' not in rel:
continue
if is_test_path(rel):
continue
@ -319,7 +331,7 @@ def source_loc_counts() -> dict[str, int]:
counts: dict[str, int] = {}
for file in sorted(root.rglob('*.rs')):
rel = repo_relative(str(file))
if rel is None or '/src/' not in rel or '/target/' in rel:
if rel is None or is_workspace_artifact_path(rel) or '/src/' not in rel:
continue
if is_test_path(rel):
continue
@ -330,7 +342,7 @@ def integration_layout_violations() -> list[str]:
violations: list[str] = []
for file in sorted(root.rglob('*.rs')):
rel = repo_relative(str(file))
if rel is None or rel.startswith('target/'):
if rel is None or is_workspace_artifact_path(rel):
continue
parts = pathlib.Path(rel).parts
if len(parts) >= 2 and parts[1] == 'tests':

View File

@ -128,7 +128,11 @@ def run_git(*args: str) -> list[str]:
def repo_files() -> list[str]:
tracked = run_git('ls-files')
untracked = run_git('ls-files', '--others', '--exclude-standard')
return sorted(set(tracked + untracked))
ignored_roots = {'.cargo-home', '.git', 'artifacts', 'target', 'tmp'}
return sorted(
rel for rel in set(tracked + untracked)
if pathlib.PurePosixPath(rel).parts[:1] and pathlib.PurePosixPath(rel).parts[0] not in ignored_roots
)
def is_test_path(rel: str) -> bool:
return 'tests' in pathlib.Path(rel).parts
@ -222,7 +226,11 @@ def run_git(*args: str) -> list[str]:
def repo_files() -> list[str]:
tracked = run_git('ls-files')
untracked = run_git('ls-files', '--others', '--exclude-standard')
return sorted(set(tracked + untracked))
ignored_roots = {'.cargo-home', '.git', 'artifacts', 'target', 'tmp'}
return sorted(
rel for rel in set(tracked + untracked)
if pathlib.PurePosixPath(rel).parts[:1] and pathlib.PurePosixPath(rel).parts[0] not in ignored_roots
)
def is_test_path(rel: str) -> bool:
return 'tests' in pathlib.Path(rel).parts

View File

@ -46,6 +46,10 @@ mod uplink_telemetry;
#[allow(warnings)]
mod live_media_control;
#[path = "../../../../client/src/video_support.rs"]
#[allow(warnings)]
mod video_support;
mod app_support {
use super::handshake::PeerCaps;
use std::time::Duration;