Fix rules lint/prepare/check failing with "cortex address is required"#61
Open
Fix rules lint/prepare/check failing with "cortex address is required"#61
rules lint/prepare/check failing with "cortex address is required"#61Conversation
Agent-Logs-Url: https://github.com/cortexproject/cortex-tools/sessions/98c83076-3e00-4d75-91e0-4a809ca0824d Co-authored-by: friedrichg <1517449+friedrichg@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix rules lint error related to missing cortex address
Fix May 5, 2026
rules lint/prepare/check failing with "cortex address is required"
friedrichg
approved these changes
May 6, 2026
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.
Since v0.18.0,
rules lint,rules prepare, andrules checkfail withcortex address is requiredeven though these are purely local file operations requiring no Cortex connectivity.Root cause: The
setupPreAction registered on therulesparent command unconditionally validatedAddressandID, blocking all subcommands — including local-only ones.Fix: Split
setupinto two methods:setup(PreAction, runs for all subcommands) — applies config file defaults only, no validationsetupClient— validatesAddress/IDand creates the Cortex client; called explicitly only by commands that require Cortex connectivity:list,print,get,delete,delete-namespace,load,diff,sync