chore(policies): disable gRPC or event handlers by configuration + add metrics - #3287
Open
pbleser-oc wants to merge 1 commit into
Open
chore(policies): disable gRPC or event handlers by configuration + add metrics#3287pbleser-oc wants to merge 1 commit into
pbleser-oc wants to merge 1 commit into
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 2 critical |
| CodeStyle | 26 minor |
🟢 Metrics 36 complexity · 0 duplication
Metric Results Complexity 36 Duplication 0
🟢 Coverage 20.52% diff coverage · -0.02% coverage variation
Metric Results Coverage variation ✅ -0.02% coverage variation (-1.00%) Diff coverage ✅ 20.52% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (b2cf7a9) 84082 19347 23.01% Head commit (5b58792) 84362 (+280) 19395 (+48) 22.99% (-0.02%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#3287) 307 63 20.52% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
8 tasks
pbleser-oc
force-pushed
the
chore/#1312-policies-event-handler-split
branch
from
August 12, 2026 17:08
9f7cf9c to
0ad1242
Compare
Member
Author
|
The test failures actually did highlight a bug, will fix. |
pbleser-oc
force-pushed
the
chore/#1312-policies-event-handler-split
branch
from
August 13, 2026 10:10
f5f32aa to
f135baf
Compare
…trics * add the ability to disable the gRPC API handler (POLICIES_GRPC_DISABLED) * add the ability to disable the Events API handler (POLICIES_EVENTS_DISABLED) * add metrics * add support for specifying rego files via the environment varirable POLICIES_ENGINE_FILES * for file paths specified in yaml or in POLICIES_ENGINE_FILES, support 'config:' and 'data:' path prefixes * fix typos in the documentation, and try to make it more clear * add metrics to the documentation * add a section for testing in the documentation * introduces a new top-level package pkg/metrics/ with utilities for metrics that are backported from the groupware branch, with unit tests
pbleser-oc
force-pushed
the
chore/#1312-policies-event-handler-split
branch
from
August 13, 2026 11:42
f135baf to
5b58792
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In the scope of the broader issue #1312, this PR deals with performing those changes for the
policiesservice, namely to add the ability to disable the gRPC API or to disable the events API handler by configuration.Additionally, it also fixes the README, and adds metrics.
Related Issue
Motivation and Context
Details can be found in #1312
POLICIES_GRPC_DISABLED)POLICIES_EVENTS_DISABLED)POLICIES_ENGINE_FILESPOLICIES_ENGINE_FILES, supportconfig:anddata:path prefixespkg/metrics/with utilities for metrics that are backported from thegroupwarebranch, with unit testsHow Has This Been Tested?
Since there are currently no feature tests, it was tested by running the
policiesservice and debugging into the runtime to verify the behaviour.Types of changes
Checklist: