Skip to content

security: staging batch 3 (#272 #342 #341 #262 #269 #325 #326 #335) - #513

Open
gonzalesedwin1123 wants to merge 10 commits into
19.0from
19.0-staging-sec-batch3
Open

security: staging batch 3 (#272 #342 #341 #262 #269 #325 #326 #335)#513
gonzalesedwin1123 wants to merge 10 commits into
19.0from
19.0-staging-sec-batch3

Conversation

@gonzalesedwin1123

@gonzalesedwin1123 gonzalesedwin1123 commented Sep 10, 2026

Copy link
Copy Markdown
Member

Security staging batch 3: seven reviewed security fixes plus one review-driven fix-up, squash-merged one at a time into 19.0-staging-sec-batch3 (cut from 19.0 at e85e79e2, which is still the tip of 19.0, so this PR applies with zero drift and git merge-tree is conflict-free).

⚠ Merge with a MERGE COMMIT, not squash

The ten squash commits below are the reviewed units and the tree-identity audit is keyed on them. Squashing this PR would collapse them and break the post-merge audit. (allow_merge_commit is on for the repo; batch 2's #422 landed the same way.)

Contents (first-parent order, oldest first)

# PR Fix Module(s) → version Reviewed head Squash
1 #272 CEL metric cache keyed strictly by requested params spp_cel_domain → 19.0.2.1.1 b36079d f3b6430
2 #342 recognise me as CEL context identifier (DCI dotted-validation false positive) spp_cel_domain → 19.0.2.1.2 dc36489 9cc91fc
3 #341 deactivate default-credential demo users spp_demo, spp_farmer_registry_demo 5ac5b14 2bc37dareverted by #10 below
4 #262 restrict hazard impact records to hazard/registry roles spp_hazard → 19.0.2.1.1, spp_hazard_programs → 19.0.2.0.1 9b72b8a 4d6010f
5 #269 DCI OAuth token methods non-RPC; token cache field-restricted spp_dci_client → 19.0.2.0.2 58d4fb6 d042f0c
6 #325 reject non-ASCII bearer tokens with 401 instead of 500 spp_dci_server → 19.0.2.0.5 377c834 670fcff
7 #326 purge stale default compliance bearer token on upgrade spp_dci_client_compliance → 19.0.1.0.2 (+migration) ba8131c 14c7fe3
8 #335 enforce configured search limits server-side in search_registrants spp_registry_search → 19.0.2.1.2 7fc9fcc e428de5
9 #514 fix-up for #262: field-level groups= on the stored partner impact indicators and the impact O2M; impact-read check on the affected-registrant action, gated stat button, eligibility method privatised spp_hazard 19.0.2.1.1, spp_hazard_programs 19.0.2.0.1 (same unreleased versions) 9f17740 d482b38
10 #515 revert of #341 (exact inverse of 2bc37da) spp_demo, spp_farmer_registry_demo back to 19.0's 2.1.0 / 2.1.5 7325b5e 3f367f2

Net effect: 8 modules, 69 files. spp_dci_indicators gains tests only (version unchanged at 19.0.1.0.2). spp_demo and spp_farmer_registry_demo are byte-identical to 19.0.

Why #341 is reverted and #514 exists

A merge-turn adversarial review of the staged composition (nine read-only reviewers, record in the internal plans folder batch3-merge-turn-review.md) returned SHIP-WITH-NITS on six PRs and the composition, and NEEDS-CHANGES on two:

Verification on the final head 3f367f24

After merge

Post-merge audit (--remerge-diff empty, staging tree == merge tree) before the branch auto-deletes; archive tag archive/sec-batch3-staging by merge SHA; held-out-PR sweep (#274 stays held until after batch 4); follow-ups from the review filed as issues.

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.51%. Comparing base (b896806) to head (3f367f2).
⚠️ Report is 1 commits behind head on 19.0.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             19.0     #513      +/-   ##
==========================================
- Coverage   76.88%   74.51%   -2.38%     
==========================================
  Files         703      624      -79     
  Lines       45739    43931    -1808     
==========================================
- Hits        35166    32733    -2433     
- Misses      10573    11198     +625     
Flag Coverage Δ
spp_analytics 93.25% <ø> (ø)
spp_api_v2 ?
spp_api_v2_change_request 73.37% <ø> (ø)
spp_api_v2_cycles 71.03% <ø> (ø)
spp_api_v2_data 77.77% <ø> (ø)
spp_api_v2_entitlements 70.23% <ø> (ø)
spp_api_v2_gis 74.60% <ø> (ø)
spp_api_v2_products ?
spp_api_v2_programs 92.22% <ø> (ø)
spp_api_v2_simulation 71.19% <ø> (ø)
spp_approval ?
spp_attendance ?
spp_base_common 91.07% <ø> (ø)
spp_case_base ?
spp_case_cel ?
spp_case_demo 94.82% <ø> (ø)
spp_case_entitlements ?
spp_case_graduation ?
spp_case_programs ?
spp_case_registry ?
spp_case_session ?
spp_cel_domain 63.86% <100.00%> (?)
spp_cel_load_testing ?
spp_consent ?
spp_data_classification ?
spp_dci_client 90.40% <100.00%> (+1.14%) ⬆️
spp_dci_client_compliance 100.00% <100.00%> (+0.74%) ⬆️
spp_dci_demo 94.28% <ø> (ø)
spp_dci_indicators 96.23% <ø> (?)
spp_dci_server 90.26% <100.00%> (+0.01%) ⬆️
spp_demo 73.69% <ø> (?)
spp_demo_phl_luzon 86.71% <ø> (?)
spp_farmer_registry_demo 63.39% <ø> (ø)
spp_grm_demo 81.43% <ø> (?)
spp_hazard 99.20% <ø> (ø)
spp_hazard_programs 98.61% <100.00%> (?)
spp_import_match ?
spp_irrigation ?
spp_mis_demo_v2 70.38% <ø> (ø)
spp_pii_encryption ?
spp_program_geofence ?
spp_programs 67.58% <ø> (ø)
spp_registry 88.94% <ø> (ø)
spp_registry_search 75.53% <100.00%> (?)
spp_security 69.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
spp_cel_domain/models/cel_executor.py 63.57% <100.00%> (ø)
spp_cel_domain/models/cel_variable_resolver.py 78.15% <ø> (ø)
spp_cel_domain/services/cel_parser.py 82.44% <ø> (ø)
spp_dci_client/models/data_source.py 91.17% <100.00%> (+2.61%) ⬆️
spp_dci_client/services/client.py 88.92% <100.00%> (ø)
spp_dci_client_compliance/controllers/trigger.py 100.00% <100.00%> (+0.79%) ⬆️
spp_dci_client_compliance/models/data_source.py 100.00% <100.00%> (ø)
spp_dci_server/middleware/signature.py 91.72% <100.00%> (+0.19%) ⬆️
spp_hazard/models/hazard_incident.py 98.05% <ø> (ø)
spp_hazard/models/registrant.py 100.00% <ø> (ø)
... and 2 more

... and 336 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gonzalesedwin1123

Copy link
Copy Markdown
Member Author

ci-full verdict on e428de54 — no new failures (run 34438602974)

Judged by failing-test-set diff against the 2026-09-06 weekly baseline on plain 19.0 (run 34019594143 @ df808efa), not by job colour: the same three demo jobs are red on both.

Job baseline staging e428de54 diff
SP-MIS Demo 11 failed, 11 errors of 7386 tests 11 failed, 11 errors of 7433 tests test-level failure set identical (2 setUpClass errors: spp_analytics TestAggregationIntegrationDemo, spp_programs TestEntitlementManager in-kind); SQL-error set identical (40); Odoo-error set identical modulo random IDs in messages
GRM Demo 0 failed, 1 error of 3609 0 failed, 1 error of 3632 SQL-error set (31) and Odoo-error set (23) identical
DRIMS Sri Lanka Demo 1 failed, 1 error of 2690 1 failed, 1 error of 2707 SQL-error set (25) and Odoo-error set (15) identical

The test-count increases (+47 / +23 / +17) are this batch's added tests running in those stacks. Zero failures only present on staging.

Note: this PR is not yet ready to merge — the merge-turn adversarial review returned NEEDS-CHANGES on #262 (two HIGH, fix in progress) and #341 (design; recommendation is to revert it out of this batch). A follow-up comment will land here when the staging head changes; the verdict above will be re-run on the new head.

…fected-registrant list (fix-up for #262) (#514)

Reviewed head: 9f17740
…roduction install + drop Production/Stable (#341)" (#515)

Reviewed head: 7325b5e. Exact inverse of 2bc37da; #341 to be redesigned and re-landed in batch 4 with #356.
@gonzalesedwin1123

Copy link
Copy Markdown
Member Author

ci-full verdict on the FINAL head 3f367f24 — no new failures (run 34445289320) — READY TO MERGE

Same method as before: failing-test-set diff against the 2026-09-06 weekly baseline on plain 19.0 (run 34019594143 @ df808efa). The same three demo jobs are red on both sides; nothing is red only on staging.

Job baseline staging 3f367f24 diff
SP-MIS Demo 11 failed, 11 errors of 7386 tests 11 failed, 11 errors of 7434 tests identical test-level failures (the two pre-existing setUpClass errors in spp_analytics and spp_programs in-kind), identical SQL-error and Odoo-error sets
GRM Demo 0 failed, 1 error of 3609 0 failed, 1 error of 3633 identical SQL/Odoo-error sets
DRIMS Sri Lanka Demo 1 failed, 1 error of 2690 1 failed, 1 error of 2710 identical SQL/Odoo-error sets

Test-count deltas (+48 / +24 / +20) are the batch's own added tests, including #514's six.

This PR's own CI on 3f367f24: 52/52 green (Trivy skipped as on every PR). Together with the identity sweep, version chain and -u upgrade gate recorded in the description, all merge gates are satisfied.

Merge with a MERGE COMMIT (not squash).

@gonzalesedwin1123

Copy link
Copy Markdown
Member Author

For the human review — what is already verified, and where a second pair of eyes helps most

Already verified mechanically on 3f367f24 (details in the description and the two ci-full comments): per-PR CI green on the exact merged heads; tree identity (a)/(b)/(c); version chain; -u upgrade gate on a seeded production-style DB; ci-full by failing-test-set diff; this PR's own CI 52/52.

Merge-turn adversarial review (nine read-only staff-engineer passes on the staged composition, one per squash plus one on the whole batch) — condensed:

Commit Verdict Findings kept as follow-ups (none blocking)
#272 metric cache params SHIP-WITH-NITS _svc_evaluate_batch silently degrades if evaluate lacks params; enqueue_refresh_from_domain drops p.params; same bug class pre-existing in read_values() / studio variable service
#342 me identifier SHIP-WITH-NITS no security widening (me already handled by predicate guard + _safe_getattr); translator aliases only r, so me.x fails late with "Compilation error"
#262 impact ACL NEEDS-CHANGES → fixed by #514 stored res.partner.hazard_impact_count / has_active_impact had no field groups= (RPC victim list); program readers could open the impacted-registrant list. A third claim (partner create breaks for users without impact read) was refuted: stored computes run as superuser (compute_sudo), pinned by a test
#269 OAuth token non-RPC SHIP-WITH-NITS spp_dci_client_sr.action_test_connection still lets a registry viewer trigger minting (credential-validity oracle, no disclosure); 13 chars of a live token reach a DEBUG log
#325 non-ASCII bearer → 401 SHIP-WITH-NITS operator-configured non-ASCII token in dci.api_tokens still 500s every route → #516
#326 compliance token purge SHIP-WITH-NITS token-only match would delete a re-keyed oauth2 source that kept a legacy bearer_token; whitespace variants survive; FK ondelete verified safe
#335 search limits SHIP-WITH-NITS cap is governance, not a boundary (ORM search on res.partner still ACL-governed); int(Infinity) → 500; get_recent_registrants(limit) unvalidated
#341 demo users NEEDS-CHANGES → reverted by #515 demo-flag gate wrong both ways; noupdate=0 users file rewrites logins/passwords on -u
composition SHIP-WITH-NITS zero dangling references to #269's renamed methods; no depends changes; generated READMEs byte-identical to the generator's output

Where a human adds the most value:

  1. security(hazard): gate stored registrant impact indicators with field-level groups (fix-up for #262) #514 (d482b383) — the only code that was not part of the originally reviewed PR set. Field-level groups= on three res.partner fields; check_access("read") on action_view_affected_registrants; get_emergency_eligible_registrants()_get_emergency_eligible_registrants() (no overrides exist in this repo or customer repos, but it is an API rename). Tests: 6 new.
  2. Revert "security(demo): deactivate default-credential demo users on production install + drop Production/Stable (#341)" #515 (3f367f24) — verified byte-exact inverse of 2bc37daa; worth a glance that nothing else in the batch depended on security(demo): deactivate default-credential demo users on production install + drop Production/Stable #341.
  3. The judgement calls: accepting the SHIP-WITH-NITS items above as follow-ups rather than in-batch fixes.

Whoever merges: merge commit, not squash — the ten squash commits are the audit trail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant