ci(lesavka): stabilize quality telemetry publishing
This commit is contained in:
parent
dca8b20528
commit
0210d5f54a
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -60,9 +60,9 @@ spec:
|
|||||||
CARGO_TERM_COLOR = 'always'
|
CARGO_TERM_COLOR = 'always'
|
||||||
CARGO_BUILD_JOBS = '2'
|
CARGO_BUILD_JOBS = '2'
|
||||||
CARGO_INCREMENTAL = '0'
|
CARGO_INCREMENTAL = '0'
|
||||||
CARGO_HOME = "${WORKSPACE}/.cargo-home"
|
CARGO_HOME = '/home/jenkins/agent/.cargo-home'
|
||||||
CARGO_TARGET_DIR = "${WORKSPACE}/target"
|
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'
|
DOCKER_BUILDKIT = '1'
|
||||||
LESAVKA_CI_PROFILE = "${params.LESAVKA_CI_PROFILE}"
|
LESAVKA_CI_PROFILE = "${params.LESAVKA_CI_PROFILE}"
|
||||||
QUALITY_GATE_PUSHGATEWAY_URL = "${params.QUALITY_GATE_PUSHGATEWAY_URL}"
|
QUALITY_GATE_PUSHGATEWAY_URL = "${params.QUALITY_GATE_PUSHGATEWAY_URL}"
|
||||||
@ -127,7 +127,7 @@ spec:
|
|||||||
steps {
|
steps {
|
||||||
container('rust-ci') {
|
container('rust-ci') {
|
||||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
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'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,6 +98,16 @@ def repo_relative(path: str) -> str | None:
|
|||||||
except Exception:
|
except Exception:
|
||||||
return None
|
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]:
|
def run_git(*args: str) -> list[str]:
|
||||||
proc = subprocess.run(
|
proc = subprocess.run(
|
||||||
['git', '-C', str(root), *args],
|
['git', '-C', str(root), *args],
|
||||||
@ -110,7 +120,7 @@ def run_git(*args: str) -> list[str]:
|
|||||||
def repo_files() -> list[str]:
|
def repo_files() -> list[str]:
|
||||||
tracked = run_git('ls-files')
|
tracked = run_git('ls-files')
|
||||||
untracked = run_git('ls-files', '--others', '--exclude-standard')
|
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:
|
def is_test_path(rel: str) -> bool:
|
||||||
return 'tests' in pathlib.Path(rel).parts
|
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]:
|
def naming_policy_violations(files: list[str]) -> list[str]:
|
||||||
violations: list[str] = []
|
violations: list[str] = []
|
||||||
for path in files:
|
for path in files:
|
||||||
|
if is_workspace_artifact_path(path):
|
||||||
|
continue
|
||||||
if path.startswith('.git/') or path.startswith('target/'):
|
if path.startswith('.git/') or path.startswith('target/'):
|
||||||
continue
|
continue
|
||||||
stem = pathlib.Path(path).stem.lower()
|
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)
|
counts: dict[str, int] = defaultdict(int)
|
||||||
for file in sorted(root.rglob('*.rs')):
|
for file in sorted(root.rglob('*.rs')):
|
||||||
rel = repo_relative(str(file))
|
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
|
continue
|
||||||
if is_test_path(rel):
|
if is_test_path(rel):
|
||||||
continue
|
continue
|
||||||
@ -319,7 +331,7 @@ def source_loc_counts() -> dict[str, int]:
|
|||||||
counts: dict[str, int] = {}
|
counts: dict[str, int] = {}
|
||||||
for file in sorted(root.rglob('*.rs')):
|
for file in sorted(root.rglob('*.rs')):
|
||||||
rel = repo_relative(str(file))
|
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
|
continue
|
||||||
if is_test_path(rel):
|
if is_test_path(rel):
|
||||||
continue
|
continue
|
||||||
@ -330,7 +342,7 @@ def integration_layout_violations() -> list[str]:
|
|||||||
violations: list[str] = []
|
violations: list[str] = []
|
||||||
for file in sorted(root.rglob('*.rs')):
|
for file in sorted(root.rglob('*.rs')):
|
||||||
rel = repo_relative(str(file))
|
rel = repo_relative(str(file))
|
||||||
if rel is None or rel.startswith('target/'):
|
if rel is None or is_workspace_artifact_path(rel):
|
||||||
continue
|
continue
|
||||||
parts = pathlib.Path(rel).parts
|
parts = pathlib.Path(rel).parts
|
||||||
if len(parts) >= 2 and parts[1] == 'tests':
|
if len(parts) >= 2 and parts[1] == 'tests':
|
||||||
|
|||||||
@ -128,7 +128,11 @@ def run_git(*args: str) -> list[str]:
|
|||||||
def repo_files() -> list[str]:
|
def repo_files() -> list[str]:
|
||||||
tracked = run_git('ls-files')
|
tracked = run_git('ls-files')
|
||||||
untracked = run_git('ls-files', '--others', '--exclude-standard')
|
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:
|
def is_test_path(rel: str) -> bool:
|
||||||
return 'tests' in pathlib.Path(rel).parts
|
return 'tests' in pathlib.Path(rel).parts
|
||||||
@ -222,7 +226,11 @@ def run_git(*args: str) -> list[str]:
|
|||||||
def repo_files() -> list[str]:
|
def repo_files() -> list[str]:
|
||||||
tracked = run_git('ls-files')
|
tracked = run_git('ls-files')
|
||||||
untracked = run_git('ls-files', '--others', '--exclude-standard')
|
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:
|
def is_test_path(rel: str) -> bool:
|
||||||
return 'tests' in pathlib.Path(rel).parts
|
return 'tests' in pathlib.Path(rel).parts
|
||||||
|
|||||||
@ -46,6 +46,10 @@ mod uplink_telemetry;
|
|||||||
#[allow(warnings)]
|
#[allow(warnings)]
|
||||||
mod live_media_control;
|
mod live_media_control;
|
||||||
|
|
||||||
|
#[path = "../../../../client/src/video_support.rs"]
|
||||||
|
#[allow(warnings)]
|
||||||
|
mod video_support;
|
||||||
|
|
||||||
mod app_support {
|
mod app_support {
|
||||||
use super::handshake::PeerCaps;
|
use super::handshake::PeerCaps;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user