Move host facts count health check to the Foreman API

Open
#876 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
postgresql, python, sql

Research direction

Start at check_host_facts_count and the existing /api/v2/fact_values path, then read the OAuth authentication pathway and task/permission query migrations named in the issue. Done means the check uses a supported per-host fact-count API, no longer needs Foreman database credentials, preserves threshold and all-host reporting, and has integration coverage.

Written by the indexing model from the issue text.

Description

check_host_facts_count is the remaining post-deployment health check that reads Foreman application data directly from PostgreSQL.

The current /api/v2/fact_values endpoint returns complete fact values. Using it for this check would transfer every fact from every host and does not provide an efficient per-host aggregate, so replacing the single grouped SQL query with it would regress large deployments.

Once Foreman exposes a supported per-host fact count through the API:

  • switch check_host_facts_count to OAuth-authenticated API access
  • remove its dependency on Foreman database credentials
  • retain the current threshold and all-host reporting behavior
  • add integration coverage for the API path

Split from #551 so the existing OAuth authentication pathway and the task/permission query migrations can land independently.

Dominant language
Python
Stars
26
Forks
56
Avg merge
2d 22h
Merged PRs (30d)
31

Getting set up

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.

More from theforeman/foremanctl

All issues in theforeman/foremanctl

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.