saltstack / saltstack/salt

state.show_state_usage misses include:d states

Open
#58,670 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug severity-high
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

If you have included states like I described in issue #11868 it seems that state.show_state_usage call puts the included states in the 'unused' part of the result:

web-1:
    ----------
    base:
        ----------
        count_all:
            235
        count_unused:
            176
        count_used:
            59
        unused:
            - all-1804-fixups
            - all-secure
            - apache
            [...]
        used:
            [...]
            - machine.web.apache

The first lines of machine/web/apache/init.sls are:

include:
  - apache

So i'd say its used.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the state.show_state_usage call and the example machine/web/apache/init.sls, focusing on how the include entry is represented in the used and unused results. Reproduce the shown output with an included state, then verify that included states are classified as used rather than unused.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.