Skip to content

test(flow): cover wildcard conflict rule and HasScheduleConflict - #5073

Open
kdhulipala-wq wants to merge 2 commits into
NVIDIA:mainfrom
kdhulipala-wq:kcd-flow-conflict-tests-v2
Open

test(flow): cover wildcard conflict rule and HasScheduleConflict#5073
kdhulipala-wq wants to merge 2 commits into
NVIDIA:mainfrom
kdhulipala-wq:kcd-flow-conflict-tests-v2

Conversation

@kdhulipala-wq

Copy link
Copy Markdown
Contributor

**This is a re-issue of an older pull request 4684 to restart the CI pipeline which was broken on the older version of main.

Two test gaps from the rack decommission follow-up review (Kun's notes on #4408).

TestBuiltinRule: adds two cases for the decommission wildcard:

  • Active decommission blocks an incoming operation type not explicitly listed in the rule (inject_expectation), via the wildcard B entry
  • Symmetric: incoming decommission blocks an active unlisted type

TestResolver_HasScheduleConflict: new test for the coarse-grained schedule-conflict check, which was previously untested. Cases cover:

  • Empty/nil existing schedules
  • bring_up and decommission wildcard matches (both directions)
  • decommission blocking an unlisted operation type via wildcard B
  • inject_expectation not conflicting with power or firmware
  • Multi-schedule detection where only one existing entry conflicts

Signed-off-by: Krishna Dhulipala <kdhulipala@nvidia.com>
@kdhulipala-wq
kdhulipala-wq requested a review from a team as a code owner August 17, 2026 20:23
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6bbbf4eb-8e6d-42f1-b395-8dcbec8c6894

📥 Commits

Reviewing files that changed from the base of the PR and between 3289201 and 63064da.

📒 Files selected for processing (1)
  • rest-api/flow/internal/task/conflict/conflict_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • rest-api/flow/internal/task/conflict/conflict_test.go

Included review availability: Your plan includes up to 12 reviews per rolling hour; 11 remain after this review.


Summary by CodeRabbit

  • Tests
    • Expanded coverage for schedule conflict detection, including empty schedules, multiple schedules, symmetric wildcard rules, and non-conflicting operations.
    • Added validation for conflict behavior involving unlisted operation types.
    • Improved test coverage for injected expectations and operation handling.

Walkthrough

The change adds a test helper and expands conflict-resolution coverage. Tests verify wildcard decommission matching and Resolver.HasScheduleConflict behavior for empty, compatible, conflicting, symmetric, and multiple schedules.

Changes

Conflict resolution tests

Layer / File(s) Summary
Conflict matching and schedule validation
rest-api/flow/internal/task/conflict/conflict_test.go
Added makeOp and expanded tests for wildcard decommission conflicts and Resolver.HasScheduleConflict, including symmetric, compatible, empty, self-compatible, and multi-schedule cases.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 63064

This change adds coverage for wildcard conflict handling and schedule-conflict detection without changing production behavior; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the added tests for wildcard conflict rules and HasScheduleConflict.
Description check ✅ Passed The description directly explains the test coverage for wildcard conflicts and HasScheduleConflict.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

🔐 TruffleHog Secret Scan

No secrets or credentials found!

Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉

🔗 View scan details

🕐 Last updated: 2026-08-17 20:25:33 UTC | Commit: 3289201

@thossain-nv thossain-nv added the rest-api Add this label when an issue or PR concerns NICo REST API label Aug 17, 2026 — with ChatGPT Codex Connector
Signed-off-by: Krishna Dhulipala <kdhulipala@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rest-api Add this label when an issue or PR concerns NICo REST API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants