minder
minder copied to clipboard
Fix ruletype delete -all - shows healthcheck rules and a few other things
The ruletype delete --all command should delete all ruletypes that are not referenced by existing profiles. This works, but I noticed a few issues around it:
- [ ] Shows the healthcheck ruletypes (should be hidden)
- [ ] Deleting takes quite some time apparently (had a profile, deleted it, listed profiles (nothing shown) then tried deleting the ruletypes and it said I still reference them). After a few tries it eventually deleted all.
- [ ] We should show which profile are referencing the ruletypes we failed to delete
+----------------------------------------------------+----------------------------------------------------+
| Minder Server | staging.stacklok.dev:443 |
+----------------------------------------------------+----------------------------------------------------+
| Project | rdimitrov / |
| | e3b56286-34ff-4b8d-a1ca-f2a0777c2a90 |
+----------------------------------------------------+----------------------------------------------------+
---
➜ minder-smoke-tests git:(main) ✗ minder profile list
WARNING: Running against a test environment (staging.stacklok.dev) and may not be stable
+----+----------------------------------------------------+-------+-----------+
| ID | NAME | ALERT | REMEDIATE |
+----+----------------------------------------------------+-------+-----------+
---
➜ minder-smoke-tests git:(main) ✗ minder ruletype delete --all
WARNING: Running against a test environment (staging.stacklok.dev) and may not be stable
You are about to permanently delete all of your rule types.
Are you sure? Yes
The following rule type(s) were successfully deleted:
github_actions_allowed
mixed_scripts_check
pr_trusty_check
dependabot_configured
invisible_characters_check
no_binaries_in_repo
pr_vulnerability_check
no_open_security_advisories
The following rule type(s) are referenced by existing profiles and were not deleted:
stacklok/actions_check_pinned_tags
stacklok/allowed_selected_actions
stacklok/artifact_signature
stacklok/automatic_branch_deletion
stacklok/branch_protection_allow_deletions
stacklok/branch_protection_allow_force_pushes
stacklok/branch_protection_allow_fork_syncing
stacklok/branch_protection_enabled
stacklok/branch_protection_enforce_admins
stacklok/branch_protection_lock_branch
stacklok/branch_protection_require_conversation_resolution
stacklok/branch_protection_require_linear_history
stacklok/branch_protection_require_pull_request_approving_review_count
stacklok/branch_protection_require_pull_request_code_owners_review
stacklok/branch_protection_require_pull_request_dismiss_stale_reviews
stacklok/branch_protection_require_pull_request_last_push_approval
stacklok/branch_protection_require_pull_requests
stacklok/branch_protection_require_signatures
stacklok/codeql_enabled
stacklok/default_workflow_permissions
stacklok/dependabot_configured
stacklok/dockerfile_no_latest_tag
stacklok/github_actions_allowed
stacklok/invisible_characters_check
stacklok/license
stacklok/mixed_scripts_check
stacklok/no_binaries_in_repo
stacklok/no_open_security_advisories
stacklok/pr_trusty_check
stacklok/pr_vulnerability_check
stacklok/repo_action_allow_list
stacklok/repo_workflow_access_level
stacklok/secret_push_protection
stacklok/secret_scanning
stacklok/trivy_action_enabled
repo_action_allow_list
secret_scanning
repo_workflow_access_level
trivy_action_enabled
secret_push_protection