Skip to content

Fix rules lint/prepare/check failing with "cortex address is required"#61

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-rules-lint-error
Open

Fix rules lint/prepare/check failing with "cortex address is required"#61
Copilot wants to merge 2 commits intomainfrom
copilot/fix-rules-lint-error

Conversation

Copy link
Copy Markdown

Copilot AI commented May 5, 2026

Since v0.18.0, rules lint, rules prepare, and rules check fail with cortex address is required even though these are purely local file operations requiring no Cortex connectivity.

Root cause: The setup PreAction registered on the rules parent command unconditionally validated Address and ID, blocking all subcommands — including local-only ones.

Fix: Split setup into two methods:

  • setup (PreAction, runs for all subcommands) — applies config file defaults only, no validation
  • setupClient — validates Address/ID and creates the Cortex client; called explicitly only by commands that require Cortex connectivity: list, print, get, delete, delete-namespace, load, diff, sync
# v0.17.0 behavior restored:
$ cortextool rules lint
INFO[0000] SUCCESS: 0 rules found, 0 linted expressions

# Cortex-dependent commands still enforce address:
$ cortextool rules list
cortextool: error: cortex address is required (use --address flag, ...)

Copilot AI linked an issue May 5, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix rules lint error related to missing cortex address Fix rules lint/prepare/check failing with "cortex address is required" May 5, 2026
Copilot AI requested a review from friedrichg May 5, 2026 23:13
@friedrichg friedrichg marked this pull request as ready for review May 6, 2026 00:11
@friedrichg friedrichg requested a review from SungJin1212 May 6, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rules lint fails with address is required

2 participants