Skip to content

Removing all traces of Satellite Compatibility API#10

Draft
PaulWay wants to merge 37 commits intomainfrom
advisor_remove_sat_compat
Draft

Removing all traces of Satellite Compatibility API#10
PaulWay wants to merge 37 commits intomainfrom
advisor_remove_sat_compat

Conversation

@PaulWay
Copy link
Collaborator

@PaulWay PaulWay commented Jul 14, 2025

The Satellite Compatibility API consists of three main URL paths:

  • /r/insights/v1/
  • /r/insights/v2/
  • /r/insights/v3/

These were used by old versions of Satellite (before about 6.12) in
communicating with the Insights API in the Hybrid Cloud Console. These were
gradually phased out, so that versions beyond about 6.14 do not use any of
those API calls but use /api/insights/v1/ and /api/inventory/v1/ instead.

This work removes the code handling these URLs.

Signed-off-by: Paul Wayper <paulway@redhat.com>
@PaulWay PaulWay self-assigned this Jul 15, 2025
@PaulWay PaulWay added Advisor The 'Advisor' component of the code. API The API components of both Advisor and Tasks labels Jul 15, 2025
@dkuc
Copy link
Collaborator

dkuc commented Jul 18, 2025

Are you certain that insights-client doesn't make use of any of these paths?

Previously, the `api/scripts/import_content.py` script was expected to run by
itself and read files from the operating system. This is no longer supported.
However, the legacy of this was that we tried to manually set up the Django
environment, something that is now confusing parts of the WSGI loader. This
manual setup can easily be removed.

Signed-off-by: Paul Wayper <paulway@redhat.com>
Skip tests (rather than failing) if clowdapp.yml not available, and other
minor code improvements.

Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Implementing two basic CI/CD GitHub workflows on PRs.

- A check that we can install the advisor-backend code and that it passes
  `flake8` and Django unit tests on the Advisor API, Tasks API, and Advisor
  service.

- A check that we can build the container from the `Containerfile` using
  `podman` (on Ubuntu, no less!).

Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
For reasons as yet unknown, the logs from gunicorn include an 'args'
field that contains a dictionary with many many fields.  Some are
cryptic one-letter fields like 'U' and 'h'.  Others are named fields
in curly braces with a trailing letter, such as '{x-real-ip}i'.  Some
are duplicated in the headers.  Many we do not care about.

To preserve the same format of the logs that we currently store, we need
to copy these fields into the outer record as attributes with regular
names.

Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
The `hide_metrics` function seems to have been failing in Stage because it
assumed there were attributes of the log record which weren't there.

This fixes that problem and tests the full range of paths we expect through
this function.

Also fixes an incorrect string split attempt on the first character of a string,
and only rewrite URLs that are actually in the Tasks API

Signed-off-by: Paul Wayper <paulway@redhat.com>
We can't remove the `record.args` attribute because the logger library
relies on it. So instead we fill it with exactly the keys needed for the
message used with `gunicorn`.

Signed-off-by: Paul Wayper <paulway@redhat.com>
PaulWay and others added 17 commits September 16, 2025 07:38
The 'cgroup-limits' script is not being used because it is not in
the default path. We need to refer to it by absolute path.

Signed-off-by: Paul Wayper <paulway@redhat.com>
For as yet unknown reasons, sometimes the gunicorn log arguments
have '-' as the value of the 'U' (URL) and 'm' (method) field. So we
fill those in from the 'raw_uri' and 'request_method' fields respectively.
We split the raw_uri into query parameters as well if it contains a '?'.

Signed-off-by: Paul Wayper <paulway@redhat.com>
In investigating why the 'summary' field in many rules is the same as the
'generic' field, I found that changes to the 'summary' field were not being
tracked in trying to determine whether to update the rule model of an
existing rule. This fix makes sure that fields we check and possibly modify
are always included in the list of fields checked for updates.

(Hopefully) fixes RHINENG-17698

Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
* update pipfile.lock for hermetic-builds
* pin cel-python to remove google-re2 dep
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
* Raise auth error early if KESSEL_ENABLED but the 'user_id' field is absent
* Add some INFO-level logging to has_kessel_permission while we debug things

Signed-off-by: Paul Wayper <paulway@redhat.com>
Signed-off-by: Paul Wayper <paulway@redhat.com>
…ed to Advisor at all (#35)

Signed-off-by: Paul Wayper <paulway@redhat.com>
@PaulWay PaulWay marked this pull request as draft November 20, 2025 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Advisor The 'Advisor' component of the code. API The API components of both Advisor and Tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants