Skip to content

Handle exclude predicate#4439

Open
balanza wants to merge 5 commits into
mainfrom
poc-check-predicate
Open

Handle exclude predicate#4439
balanza wants to merge 5 commits into
mainfrom
poc-check-predicate

Conversation

@balanza

@balanza balanza commented Jul 1, 2026

Copy link
Copy Markdown
Member

Following RFC trento-project/docs#188

This PR extends the check execution flow to pass per-host metadata (starting with is_majority_maker) as target attributes, enabling check policies to reference host properties. It also updates the execution results UI to surface hosts that were excluded by a check's exclude predicate.

@balanza balanza force-pushed the poc-check-predicate branch 4 times, most recently from 024bc29 to 9f3c3a6 Compare July 2, 2026 00:01
@balanza balanza requested a review from Copilot July 2, 2026 00:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the checks execution/request pipeline and the Execution Results UI to correctly represent hosts that are excluded by a check’s exclude predicate (and to support predicates that rely on host attributes like is_majority_maker).

Changes:

  • Add is_majority_maker as a target attribute when requesting cluster checks executions (and plumb this attribute from cluster details to host targets).
  • Surface excluded_by_policy agent results in the UI as a distinct “Excluded by policy” row and show a dedicated detail view including the exclusion predicate.
  • Update contracts dependency ref to include the updated protobuf schema (e.g., target attributes).

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/trento/infrastructure/checks/checks_test.exs Adds coverage for target attributes and is_majority_maker propagation in execution requests.
test/trento/clusters_test.exs Verifies is_majority_maker is set in target attributes for HANA scale-up cluster nodes.
lib/trento/infrastructure/checks/checks.ex Adds protobuf target attributes (including is_majority_maker) to ExecutionRequested targets.
lib/trento/clusters.ex Computes majority-maker hostnames from cluster details and passes is_majority_maker into checks target data.
assets/js/lib/model/index.js Adds the EXCLUDED_BY_POLICY status constant.
assets/js/pages/ExecutionResults/checksUtils.js Adds isAgentExcluded helper based on EXCLUDED_BY_POLICY.
assets/js/pages/ExecutionResults/CheckResultOutline.jsx Renders excluded hosts as “Excluded by policy” rows and avoids treating them as evaluated results.
assets/js/pages/ExecutionResults/TargetResult.jsx Adds styling support for excluded rows (isExcluded).
assets/js/pages/ExecutionResults/CheckResultOutline.test.jsx Adds test coverage for the excluded-by-policy row rendering.
assets/js/pages/ExecutionResults/CheckResultDetail/CheckResultDetail.jsx Adds excluded-by-policy detail rendering including the exclusion predicate expression.
assets/js/pages/ExecutionResults/CheckResultDetail/CheckResultDetail.test.jsx Adds test coverage for excluded-by-policy details.
assets/js/lib/test-utils/factories/executions.js Adds an agentCheckExcludedFactory for excluded agent results in UI tests.
mix.exs Bumps trento_contracts git ref.
mix.lock Locks trento_contracts to the updated git ref.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -53,8 +55,12 @@ defmodule Trento.Infrastructure.Checks do
targets:
@balanza balanza force-pushed the poc-check-predicate branch from 9f3c3a6 to 793f827 Compare July 2, 2026 08:35
balanza and others added 5 commits July 2, 2026 16:31
The Target protobuf field was renamed from host_data to attributes in
the contracts submodule. Update web's checks engine and tests to use
the new field name.

Update mix.exs/mix.lock to point to contracts commit f3c137c which
introduces the new attributes field.
Wanda returns excluded (host, check) pairs with status
"excluded_by_policy" and the exclude_expression. Surface them as a
distinct, neutral "Excluded by policy" row in the check results outline
(instead of a red 0/N expectations failure) and show the exclusion
predicate in the check detail panel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The "pass host data to checks" commit accidentally removed the
maybe_put_error_details clauses and map_request_failed_error helper
from QueueEventParser (a rebase artifact), breaking QueueEventParserTest.
Restore them to match main.
@balanza balanza force-pushed the poc-check-predicate branch from c2a8062 to 645840d Compare July 2, 2026 14:32
@balanza balanza marked this pull request as ready for review July 2, 2026 14:40
@balanza balanza requested a review from nelsonkopliku July 2, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants