• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mindersec / minder / 36903780615
64%

Build:
DEFAULT BRANCH: main
Ran 01 Oct 2026 06:13PM UTC
Jobs 1
Files 363
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Oct 2026 06:01PM UTC coverage: 62.29% (+0.03%) from 62.261%
36903780615

push

github

web-flow
Fix #6727: switch RuleType encode/decode to protojson (#6809)

* Fix #6727: switch RuleType encode/decode to protojson

RuleType was the only resource type using encoding/json for both
marshal and unmarshal in pkg/fileconvert, unlike DataSource and
Profile which already use protojson. This meant any enum-typed field
without a hand-written MarshalJSON/UnmarshalJSON failed to round-trip
by name (confirmed: provider_traits was changed to repeated string in
#6702 specifically to work around this).

RuleType's two existing enum fields (Severity.Value,
RuleTypeReleasePhase) already have custom JSON hooks that convert to/
from short names ("beta", "info") via the (name) proto extension,
but protojson never calls encoding/json's Marshaler/Unmarshaler
interface. Switching outright would have silently changed their
output to full proto enum names, breaking the golden files
(export_by_name.yaml.golden, export_by_id.yaml.golden) and any
existing rule type YAML.

Fix: marshal via protojson, then post-process the two enum fields back
to their short-name form; on read, pre-process short names to full
proto names before handing off to protojson.Unmarshal. Both the short
form and the full proto name are now accepted on read -- a deliberate,
backward-compatible widening.

Two additional fixes found along the way:
- protojson.UnmarshalOptions{DiscardUnknown: true} instead of plain
  Unmarshal -- the rego decoder leaves a custom key in the map that
  encoding/json silently ignored but plain protojson.Unmarshal
  rejected, breaking every .rego rule type.
- Both snake_case (release_phase) and camelCase (releasePhase) keys
  are checked for the short-name translation, since protojson accepts
  either. cmd/cli/app/ruletype/fixture/rule_type_sample.yaml uses
  releasePhase: beta, which was silently read back as UNSPECIFIED on
  upstream before this fix -- now reads correctly.

Golden files unchanged. Existing MarshalJSON/UnmarshalJSON on
Severity_Value/RuleTypeReleasePhase ar... (continued)

41 of 51 new or added lines in 1 file covered. (80.39%)

22053 of 35404 relevant lines covered (62.29%)

40.66 hits per line

Uncovered Changes

Lines Coverage ∆ File
10
81.82
1.64% pkg/fileconvert/encodedecode.go
Jobs
ID Job ID Ran Files Coverage
1 36903780615.1 01 Oct 2026 06:13PM UTC 363
62.29
GitHub Action Run
Source Files on build 36903780615
  • Tree
  • List 363
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36903780615
  • aecbfa56 on github
  • Prev Build on main (#36496702368)
  • Next Build on main (#36907778489)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc