Skip to content

test(policy): import tier helpers by name#4910

Merged
cv merged 1 commit into
mainfrom
codex/cleanup-codeql-property-access
Jun 7, 2026
Merged

test(policy): import tier helpers by name#4910
cv merged 1 commit into
mainfrom
codex/cleanup-codeql-property-access

Conversation

@cv

@cv cv commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Updates the policy tier tests to import the tier helper functions by name instead of through a default module object. This resolves the CodeQL js/property-access-on-non-object alerts without changing test coverage or production behavior.

Changes

  • Replaced the default tiers import in test/policy-tiers.test.ts with named imports for getTier, listTiers, and resolveTierPresets.
  • Updated tier test call sites to use those named helpers directly.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Tests
    • Updated policy tier tests to use named exports, improving test organization and consistency for tier listing, retrieval, and preset resolution operations.

@cv cv self-assigned this Jun 7, 2026
@coderabbitai

coderabbitai Bot commented Jun 7, 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: 01292231-985a-4345-bcf6-a73a405365f2

📥 Commits

Reviewing files that changed from the base of the PR and between 8ff7c59 and 4a5d143.

📒 Files selected for processing (1)
  • test/policy-tiers.test.ts

📝 Walkthrough

Walkthrough

The test file is refactored to import and use named exports getTier, listTiers, and resolveTierPresets from the tiers module instead of calling methods on a default tiers object. All tier-related assertions are updated consistently to call these functions directly.

Changes

Tier API named exports migration

Layer / File(s) Summary
Import and getTier API
test/policy-tiers.test.ts
Import statement changed to use named exports; getTier(name) calls replace tiers.getTier(name) method calls for tier retrieval and null-handling validation.
listTiers API
test/policy-tiers.test.ts
listTiers() function calls replace tiers.listTiers() method calls in tier enumeration order/shape checks, label computation, and the integration test loop that verifies tier-presets existence.
resolveTierPresets API
test/policy-tiers.test.ts
resolveTierPresets(name, options) function calls replace tiers.resolveTierPresets(...) method calls across default resolution, access override, preset selection filtering, combined override+selection, restricted-tier, unknown-tier, selection matching, and validation assertions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

v0.0.60

Suggested reviewers

  • ericksoa
  • prekshivyas
  • cjagwani

Poem

🐰 With tests refactored clean and bright,
Named exports dance in morning light,
No more default to rely,
getTier, listTiers multiply—
Each function called direct and right! ✨

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: switching tier helper imports from default export to named imports in the test file.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cleanup-codeql-property-access

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

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: None
Optional E2E: None

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None. No E2E is recommended because this is a tests-only change limited to unit test import style and references. It cannot affect NemoClaw runtime behavior or real assistant user flows.

Optional E2E

  • None.

New E2E recommendations

  • None.

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

E2E Scenario Advisor Recommendation

Required scenario E2E: None
Optional scenario E2E: None

Workflow run

Full scenario advisor summary

E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required scenario E2E

  • None. Only a non-scenario unit test file changed outside test/e2e-scenario/ and scenario workflow paths; this cannot affect scenario E2E behavior.

Optional scenario E2E

  • None.

Relevant changed files

  • None.

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 0 worth checking, 0 nice ideas
Top item: No actionable findings.

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

@cv cv merged commit 4696ff7 into main Jun 7, 2026
39 checks passed
@cv cv deleted the codex/cleanup-codeql-property-access branch June 7, 2026 14:05
@cv cv added the v0.0.61 Release target label Jun 7, 2026
@wscurran wscurran added the chore Build, CI, dependency, or tooling maintenance label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Build, CI, dependency, or tooling maintenance v0.0.61 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants