Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ruletype delete -all - shows healthcheck rules and a few other things #3372

Closed
3 tasks
rdimitrov opened this issue May 20, 2024 · 2 comments
Closed
3 tasks
Labels
bug Something isn't working good first issue Good for newcomers P2 Nice to fix: non-critical items that should be evaluated and planned during issue triage

Comments

@rdimitrov
Copy link
Member

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
@rdimitrov rdimitrov added the bug Something isn't working label May 20, 2024
@evankanderson evankanderson added P2 Nice to fix: non-critical items that should be evaluated and planned during issue triage good first issue Good for newcomers labels Aug 27, 2024
@evankanderson
Copy link
Member

@eleftherias is going to break this up into smaller work chunks

@eleftherias
Copy link
Contributor

Split this up into #5306 and #5307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers P2 Nice to fix: non-critical items that should be evaluated and planned during issue triage
Projects
None yet
Development

No branches or pull requests

3 participants