Fixes #525 - Add checks to health subcommand#521
Conversation
c9ad8d0 to
7da240c
Compare
|
None of these test failures seem related. FWIW I cannot get the full unit test suite to run locally without issue either. My unit test passes, though :) |
|
@qcjames53 Before I review in-depth, can you review #431? This is a previous contribution that has made overlapping progress and addresses some of what would be questions I have for this PR. Ideally, we would build on #431 |
|
Of course, Eric. #431 wasn't on our team's radar at all so I'll need some time to rectify. I'll reach out to make sure we're not duplicating more effort than this. |
|
This PR should now be up to par. I rebased on master and added a few additional checks to the existing |
|
The newest push adds a flag to ignore errored out foreman tasks (for automation mainly). I've also removed health checks from the GH automation since the unit test checks it instead. |
4bee8e3 to
8aeb0a1
Compare
|
The latest force push handles db auth correctly for external dbs. |
|
I just pushed some changes to add New unit tests added to cover this and |
530f563 to
ab1d07e
Compare
|
Newest push should take care of linting. |
54a44d2 to
1334070
Compare
|
@ehelms @ekohl I just pushed changes that should address both of your concerns. I've feature gated |
665eaa9 to
8b44806
Compare
| Developer docs: | ||
| - [Check roles](docs/developer/checks.md) - How to integrate check roles; update as checks are created/modified | ||
| - [Container Image Builds](docs/developer/container-image-builds.md) - Info on image naming, registries | ||
| - [Deployment Architecture](docs/developer/deployment.md) | ||
| - [Development Environment](docs/developer/development-environment.md) - Dev environment setup with Foreman from source | ||
| - [How to Add a Feature](docs/developer/how-to-add-a-feature.md) - End-to-end feature development | ||
| - [Playbooks and Roles](docs/developer/playbooks-and-roles.md) - Playbook structure, naming, metadata | ||
| - [Testing](docs/developer/testing.md) - Additional info on test infrastructure, fixtures, patterns | ||
|
|
||
| User docs: | ||
| - [Certificates](docs/user/certificates.md) - Overview of certificate sources | ||
| - [Parameters](docs/user/parameters.md) - Map of Foreman installation parameters; update as parameters are created/modified | ||
|
|
||
| - [CONTRIBUTING](CONTRIBUTING.md) - How to contribute | ||
| - [Development](DEVELOPMENT.md) - Foremanctl development overview | ||
| - [IOP](docs/iop.md) - Overview of insights on premise | ||
| - [Migration Guide](docs/migration-guide.md) - Migrating from foreman-installer to foremanctl | ||
| - [Release](RELEASE.md) - Info on Foremanctl releases No newline at end of file |
There was a problem hiding this comment.
Not for this PR, but perhaps it's easier to add mkdocs and instruct the agent on how to use that instead. Just like https://github.com/theforeman/foreman-infra/tree/master/docs generates https://theforeman.github.io/foreman-infra/.
There was a problem hiding this comment.
That would be a big upgrade. I didn't want to modify the docs TOO much for a PR where sweeping changes are obviously out of scope.
There was a problem hiding this comment.
My opinion: building and trying to maintain a static site as the source of truth introduces overhead. Instead of reading locally, agents now have to query over the network. If you are making changes in a PR to any documentation and trying to consume those updates, you have to generate a static site. Additionally, agents then also have to parse HTML to find the relevant bits rather than just quickly parsing local markdown.
|
@qcjames53 a reboot should fix the iop tests |
|
Thanks Eric. I rebased and pushed to rerun CI. @ekohl would you like to review this PR again or are you okay with current changes? |
|
Ewoud uncovered https://projects.theforeman.org/issues/38465 which can cause duplicate permissions. Around 4:30 today I will re-add the duplicate permissions check for this release and include instructions in the markdown file to remove this check once the above issue is addressed. Edit: I'm not planning on adding "--fix" since that's silly to carry over. It will be fail-only and the onus is on the user to clean up the duplicate permissions. Let me know if that's not the ideal approach. |
|
I've created #551 to track migrating these db queries to authenticated API calls. I've also re-added the |
8ab3582 to
b6d7987
Compare
… documentation
|
I force pushed to re-run automation (previous failure was unrelated to my changes). |
ehelms
left a comment
There was a problem hiding this comment.
EL10 failure is unrelated, based on other tests I am going to merge.
| - "../../vars/flavors/{{ flavor }}.yml" | ||
| - "../../vars/base.yaml" | ||
| - "../../vars/database.yml" | ||
| - "../../vars/health.yml" |
| changed_when: false | ||
|
|
||
| - name: Check for duplicate permissions | ||
| when: not (health_fix | default(false) | bool) |
Why are you introducing these changes? (Problem description, related links). What are the changes introduced in this pull request?
This PR expands the existing
foremanctl healthsubcommand to reach equivalency with the existingforeman-maintain health checktool.The following tests are run on a default health check in foreman-maintain:
I've implemented these five checks:
health_services_up- Checks all currently implemented quadlet services are running (with different configs supported)health_server_ping- Can we ping the foreman server?health_foreman_tasks_not_paused- Are there paused foreman tasks?health_facts_count- Does a host exist with more facts thanhealth_max_fact_values_per_host?check_duplicate_permissions- Are permissions duplicated.I've skipped these checks (reasoning provided):
How to test this pull request
Steps to reproduce:
foremanctl healthand verify all checks pass.vagrant ssh quadletand manually stop a service. Rerun the check and confirmhealth_services_upfails. Restart the service.health_server_pingfails. Change the config back afterwards.health_foreman_tasks_not_pausedfails.health_max_fact_values_per_hostvalue insrc/vars/health.ymlto below the number of facts of your host and confirmhealth_facts_countfails../forge testfirst to generate needed files then runpytest tests/health_test.py.--fixand see that the duplicates are cleared.Checklist