mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-16 20:25:02 +00:00
* ci: cancel superseded Workspace pull-request runs The Workspace workflow (the native, MSRV and WASM legs) had no concurrency group, so every push to a lockfile or dependency pull request started a second full set of runs while the first set kept going, up to three runners each. Give pull requests one group per pull request, so a newer push cancels the older run, and give every other run a group of its own, so a main push, a release tag or a manual run is neither cancelled nor replaced while queued. github.ref is refs/pull/<n>/merge for a pull request, so two forks with the same branch name stay separate. The pattern is the one merged in #772 for the 23 crate workflows, which left this reusable-workflow caller out. The gate commands, jobs, inputs, matrices, timeouts, triggers and permissions are untouched. scripts/test-workspace-concurrency.py checks the policy itself: the two fields and their documented expression shapes, one group per pull request and one per other run, cancellation on a pull request only, and no job-level concurrency. It reads the workflow without wiring anything into CI. * test(workspace-concurrency): reject a scalar concurrency value `read_concurrency` matched any line starting with `concurrency:` and read the indented lines under it as fields. Under `concurrency: |` — a block scalar, not a mapping — the workflow would have passed every policy check with the reader alone, while the `PyYAML` cross-check that catches it is skipped when PyYAML is absent. `concurrency: some-string` was rejected only by accident, through the empty field set. Require the header itself to be `concurrency:` (an inline comment allowed), and test both scalar shapes. CodeRabbit found this on the pull request. * sonar: analyse the Workspace concurrency guard as a test scripts/test-workspace-concurrency.py is a unittest module: each case reads a workflow and asserts on the policy. Listing it in sonar.test.inclusions keeps it analysed as test code — linted, indexed and reported — instead of counting it as production code that needs coverage, which is what failed the quality gate at 0.0% Coverage on New Code. The exact path is appended to the three existing Rust patterns, so no other script, and nothing else in the repository, is reclassified. No coverage exclusion, quality threshold, workflow or build change. * ci: run the Workspace concurrency guard in the gate scripts/test-workspace-concurrency.py guarded the policy only when someone remembered to run it, so a reworded concurrency block could land with 16 green checks. The gate's `command` step now runs it before the cargo steps; `command` covers the Linux and macOS legs, and it is one python3 call that needs nothing installed and fails in a second, ahead of an hour of building. The Windows leg keeps its existing `windows-command`: the script passes on a CRLF copy of the workflow, but this change does not put an untested step on Windows.
48 lines
3.3 KiB
Properties
48 lines
3.3 KiB
Properties
sonar.projectKey=storytold_craft-libs
|
|
sonar.organization=storytold
|
|
|
|
# Sources and tests both start at the root, as in lightcraft: sonar.tests alone stops the scanner
|
|
# defaulting sources to the repository, which left every analysis with only 3 test files indexed.
|
|
# Test files are the ones the coverage job leaves out of lcov (tests/ directories, tests.rs and
|
|
# *_tests.rs), which includes the browser fault-injection fixtures in crates/platform/tests.
|
|
sonar.sources=.
|
|
sonar.tests=.
|
|
# scripts/test-workspace-concurrency.py is a unit-test module for the Workspace workflow's
|
|
# cancellation policy: its unittest cases read a workflow and assert on it, so it is test
|
|
# code, analysed as a test and still linted, indexed and reported, not counted as production
|
|
# code that needs coverage. Its name is listed exactly, so no other script is classified.
|
|
sonar.test.inclusions=**/tests/**,**/tests.rs,**/*_tests.rs,scripts/test-workspace-concurrency.py
|
|
|
|
# Codec constant tables are transcribed from the format specifications; their repeated rows are
|
|
# data, not copy-pasted logic.
|
|
sonar.cpd.exclusions=**/*tables.rs
|
|
|
|
# S4790 (weak hash): the ICC specification defines the profile ID as the MD5 of the profile, so
|
|
# no other algorithm produces an ID other software accepts. It identifies, it does not protect.
|
|
#
|
|
# The encrypted packages below are the same case: each format derives its keys from MD5 or SHA-1,
|
|
# so substituting a stronger hash stops the files the module reads and writes from opening.
|
|
sonar.issue.ignore.multicriteria=icc_profile_id,xls_filepass_hash,pdf_standard_security_hash,odf_package_hash,gha-lockfile
|
|
sonar.issue.ignore.multicriteria.icc_profile_id.ruleKey=rust:S4790
|
|
sonar.issue.ignore.multicriteria.icc_profile_id.resourceKey=crates/cms/src/write.rs
|
|
# xls: [MS-OFFCRYPTO] 2.3.6.1-2.3.6.2, where RC4 1.1 takes its key and verifier from MD5, and
|
|
# 2.3.5.1-2.3.5.2, where RC4 CryptoAPI takes them from SHA-1.
|
|
sonar.issue.ignore.multicriteria.xls_filepass_hash.ruleKey=rust:S4790
|
|
sonar.issue.ignore.multicriteria.xls_filepass_hash.resourceKey=crates/xls/src/crypt.rs
|
|
# pdf: ISO 32000-1 7.6.3.3, Algorithms 2-7. Revisions 2-4 derive the file key and the /O and /U
|
|
# values from MD5; revisions 5 and 6 use SHA-256 and SHA-512 (Algorithm 2.B).
|
|
sonar.issue.ignore.multicriteria.pdf_standard_security_hash.ruleKey=rust:S4790
|
|
sonar.issue.ignore.multicriteria.pdf_standard_security_hash.resourceKey=crates/pdf/src/crypt.rs
|
|
# odf: OpenDocument 4.16.6 and 4.16.3, a start key and a file checksum made with SHA-1, each used
|
|
# only where the package's manifest names it.
|
|
sonar.issue.ignore.multicriteria.odf_package_hash.ruleKey=rust:S4790
|
|
sonar.issue.ignore.multicriteria.odf_package_hash.resourceKey=crates/odf/src/crypt.rs
|
|
|
|
# githubactions:S7637 asks for every action to be pinned to a commit SHA. A workflow covered by
|
|
# .github/workflows/actions.lock runs the commit the lockfile records, so its tag refs are pinned
|
|
# and the lockfile covers the actions those actions use too. Sonar does not read lockfiles yet, so
|
|
# the rule flags the tag refs anyway:
|
|
# https://community.sonarsource.com/t/githubactions-s7637-false-positives-for-actions-pinned-through-native-actions-lock/190814
|
|
sonar.issue.ignore.multicriteria.gha-lockfile.ruleKey=githubactions:S7637
|
|
sonar.issue.ignore.multicriteria.gha-lockfile.resourceKey=.github/workflows/**
|