Skip to content

Commit f9d9a23

Browse files
security: resolve CodeQL core findings and clean comments
* ci: export CodeQL alerts for triage * ci: allow PR CodeQL triage export * ci: include comment hygiene sweep in CodeQL triage * ci: build isolated CodeQL core fixes * ci: isolate CodeQL fix transformation * ci: run isolated CodeQL fix script * security: resolve CodeQL core findings and clean comments * chore: remove temporary CodeQL triage workflow * chore: remove temporary CodeQL fix builder * chore: remove temporary CodeQL fix script --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent f723922 commit f9d9a23

9 files changed

Lines changed: 23 additions & 37 deletions

.github/workflows/native-corpus-device-lab.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Native corpus device lab
22

33
on:
4-
workflow_dispatch:
54
workflow_run:
65
workflows:
76
- Niakvio provider pipeline

.github/workflows/native-corpus-device-targeted.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ on:
1313
- mobile
1414
- desktop
1515
- all
16-
target_ref:
17-
description: Niakvio ref/SHA to validate
18-
required: false
19-
default: main
20-
type: string
2116
push:
2217
branches: [main]
2318
paths:
@@ -40,33 +35,30 @@ jobs:
4035
runs-on: ubuntu-latest
4136
timeout-minutes: 8
4237
outputs:
43-
target_sha: ${{ steps.resolve.outputs.target_sha }}
4438
targets: ${{ steps.resolve.outputs.targets }}
4539
desktop_sha: ${{ steps.resolve.outputs.desktop_sha }}
4640
mobile_sha: ${{ steps.resolve.outputs.mobile_sha }}
4741
tv_sha: ${{ steps.resolve.outputs.tv_sha }}
4842
steps:
49-
- name: Checkout requested Niakvio generation
43+
- name: Checkout selected Niakvio generation
5044
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
5145
with:
52-
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.target_ref || 'main' }}
5346
fetch-depth: 1
47+
persist-credentials: false
5448

55-
- name: Resolve exact generation, selected devices and accepted clients
49+
- name: Resolve selected devices and accepted clients
5650
id: resolve
5751
shell: bash
5852
env:
5953
EVENT_NAME: ${{ github.event_name }}
6054
INPUT_DEVICE: ${{ inputs.device }}
6155
run: |
6256
set -euo pipefail
63-
TARGET_SHA="$(git rev-parse HEAD)"
6457
if [ "$EVENT_NAME" = "push" ]; then
6558
DEVICE="tv"
6659
else
6760
DEVICE="${INPUT_DEVICE:-tv}"
6861
fi
69-
echo "target_sha=$TARGET_SHA" >> "$GITHUB_OUTPUT"
7062
DEVICE="$DEVICE" python3 - <<'PY' >> "$GITHUB_OUTPUT"
7163
import json
7264
import os
@@ -119,8 +111,9 @@ jobs:
119111
- name: Checkout exact Niakvio generation
120112
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
121113
with:
122-
ref: ${{ needs.resolve.outputs.target_sha }}
114+
ref: ${{ github.sha }}
123115
path: niakvio
116+
persist-credentials: false
124117

125118
- name: Set up JDK
126119
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165

scripts/promote_candidates.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,8 @@ def manifest_payload_without_version(manifest: dict[str, Any]) -> dict[str, Any]
9797
def next_manifest_version(current_version: str, base_version: str, changed: bool) -> str:
9898
"""Keep the manifest in the configured version series and bump on payload changes.
9999
100-
``base_version`` is a version floor. This prevents an unchanged run from
101-
preserving an obsolete series (for example 5.13.x after the repository has
102-
moved to 5.14.x).
100+
``base_version`` is a version floor so unchanged runs cannot preserve an
101+
obsolete version series.
103102
"""
104103
def parse(value: str) -> tuple[int, int, int] | None:
105104
match = re.fullmatch(r"(\d+)\.(\d+)\.(\d+)", str(value or ""))
@@ -2186,8 +2185,8 @@ def rank(variant: dict[str, Any]) -> tuple[int, int, int, int, int, int, int]:
21862185
and not metadata_is_excluded(old_entry, sources)
21872186
):
21882187
retained = dict(old_entry)
2189-
# A transient source download failure must not silently disable a
2190-
# previously published local provider.
2188+
# A transient source download failure must not disable a published
2189+
# local provider.
21912190
retained["enabled"] = bool(old_entry.get("enabled", False))
21922191
entries[cid] = retained
21932192
old_provenance = previous_provenance.get("providers", {}).get(cid, {})

scripts/provider_dns_preflight.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ export function createGlobalpingDependencies(preflightConfig, injected = {}) {
263263
locations: [{ magic: dnsResult.measurement_id }],
264264
limit: 1,
265265
// Globalping HTTP options are top-level within measurementOptions.
266-
// The previous nested request object was rejected with HTTP 400.
267266
measurementOptions: { method: 'GET', ipVersion: 4 },
268267
}, remoteConfig);
269268
return parseGlobalpingHttp(measurement, host);

scripts/publish_cross_platform_runtime_policy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
44
Only conclusive runtime failures from the fresh platform matrix can add a
55
platform block. Zero streams is inconclusive and never creates a block. The
6-
legacy 5.20.27 Android blocks that were based only on missing proof are removed
7-
when fresh evidence remains inconclusive. Existing blocks not managed by this
6+
Android blocks based only on missing proof are removed when fresh evidence
7+
remains inconclusive. Existing blocks not managed by this
88
policy are preserved.
99
"""
1010
from __future__ import annotations
@@ -149,8 +149,8 @@ def main() -> int:
149149
else:
150150
# Inconclusive evidence cannot create or remove a previously
151151
# conclusive cross-platform block. The one exception is the
152-
# legacy Android no-proof policy, whose basis was deliberately
153-
# weaker and is retired by this release.
152+
# Android no-proof blocks are weaker than conclusive runtime
153+
# evidence and are retired once fresh evidence is inconclusive.
154154
legacy_weak = token == "android" and provider_id in {
155155
str(value).casefold() for value in legacy.get("android_disabled_no_direct_movie_proof") or []
156156
} and token not in {

tests/deep_repair_rollback_test.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
ROOT = Path(__file__).resolve().parents[1]
77
MARKER = '[Nuvio Runtime Repair] Using fixture title metadata'
8-
# These providers previously received a bad metadata-context repair. The durable
9-
# invariant is that the marker never returns and that manifest/provenance/hash
10-
# describe the exact current published bytes. Hard-coding an old SHA made this
11-
# regression test reject legitimate repository-wide playback hardening.
8+
# These published artifacts must never contain the rejected metadata-context
9+
# marker. Manifest, provenance and hashes must describe the exact current bytes;
10+
# fixed historical SHAs would incorrectly reject legitimate artifact rotation.
1211
ROLLBACK_PROVIDERS = {'anime-ultime', 'dulourd', 'waveanime'}
1312
ALLOWED_SOURCES = {'gowaru', 'published-baseline', 'nuvio'}
1413
OLD = {

tests/native_catalogue_recovery_budget_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
assert patched.count('var TMDB_KEY="8265bd1679663a7ea12ac168da84d2e8";') == 3
4343
assert module.apply(patched) == patched
4444

45-
# A provider produced by the previous V1 budget revision must upgrade in place,
46-
# rather than keeping the overly narrow first-two-search policy forever.
45+
# V1-produced providers must upgrade in place rather than retaining the
46+
# narrower first-two-search policy.
4747
legacy = r'''/* NUVIO_GLOBAL_CATALOGUE_ALIAS_RECOVERY_V2:abc */
4848
;(function(g,c){"use strict";
4949
var TMDB_KEY="8265bd1679663a7ea12ac168da84d2e8";function nativeRecoveryHost(){try{return typeof g.__native_fetch==="function"}catch(_){return false}}

tests/published_overrides_test.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@
3838
# pending manifest while still being authoritative through the published
3939
# manifest, LKG or provenance. Validation must never delete such a bundle just
4040
# because it still contains an old domain; prune owns deletion after all
41-
# references converge. Regression: Coflix was deleted after strict validation,
42-
# then the manifest transaction failed because provenance/LKG still referenced
43-
# the deleted content-addressed bundle.
41+
# references converge.
4442
with tempfile.TemporaryDirectory() as tmp:
4543
root = Path(tmp)
4644
(root/'providers').mkdir()
@@ -80,9 +78,8 @@
8078
assert protected.exists(), 'validator deleted a bundle still protected by the publication transaction'
8179
assert pending.exists()
8280

83-
# A provider id must not match a longer sibling id while removing stale files.
84-
# Regression: validating 4khdhub previously deleted 4khdhubnew because the
85-
# cleanup used the broad glob ``4khdhub*.js``.
81+
# Stale-file removal must use exact provider-id boundaries so a provider id
82+
# cannot match a longer sibling id.
8683
with tempfile.TemporaryDirectory() as tmp:
8784
root = Path(tmp)
8885
(root/'providers').mkdir()

tests/strict_native_identity_guard_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
patched = module.apply(base, options)
1717
assert "nativeIdentityReject" in patched
1818
assert "implementationRevision" in patched
19-
# Same config must be idempotent, while an implementation-revision upgrade must
20-
# have stripped the previous V2 block instead of stacking it.
19+
# Reapplying the same config is idempotent; implementation upgrades replace
20+
# the existing V2 block instead of stacking another copy.
2121
assert module.apply(patched, options) == patched
2222
assert patched.count("NUVIO_GLOBAL_CATALOGUE_ALIAS_RECOVERY_V2:") == 1
2323
runner = r'''

0 commit comments

Comments
 (0)