Add RHDH integration: catalog emission, scaffolder templates, MTA card #1

Merged
anaeem merged 12 commits from rhdh-integration into main 2026-05-15 21:05:43 +00:00
Owner

RHDH 1.9 integration on top of the migration.discovery collection.

  • fleet_report now emits Backstage catalog YAMLs (System / Resource / Component-per-deployment) alongside the readiness report.
  • New Scaffolder templates: step1-discover-fleet, pair-source-repo, step2-containerize.
  • Frontend dynamic plugin source for the MTA card.
  • Operator + Backstage CR install manifests for anaeem cluster.
  • New report-fleet-adhoc.yml playbook accepting a multi-line IP/host list as extra_var.
  • Fix latent bug in deep_inspect war_introspection where regex_search captures returned single chars.
RHDH 1.9 integration on top of the migration.discovery collection. - fleet_report now emits Backstage catalog YAMLs (System / Resource / Component-per-deployment) alongside the readiness report. - New Scaffolder templates: step1-discover-fleet, pair-source-repo, step2-containerize. - Frontend dynamic plugin source for the MTA card. - Operator + Backstage CR install manifests for anaeem cluster. - New report-fleet-adhoc.yml playbook accepting a multi-line IP/host list as extra_var. - Fix latent bug in deep_inspect war_introspection where regex_search captures returned single chars.
Catalog emission (fleet_report):
  - Emit Backstage System / Resource(vm) / Component(java-app) YAMLs
    alongside the readiness report. One Component per detected
    deployment (WAR/EAR/jar); synthetic Component for app-servers
    with no deployments enumerated.
  - Components start with lifecycle=detected, no source-repo set.

deep_inspect bug fix:
  - regex_search('name=(.+)') | first | trim was returning the first
    *character* of the matched string (so every deployment showed up
    as name="n", path="p", type="t"). Use regex_search(pat, '\\1')
    capture form instead.

RHDH artifacts (rhdh/):
  - Software Templates: step1-discover-fleet, pair-source-repo,
    step2-containerize  (use rhaap:launch-job-template against JT 97/98).
  - Custom dynamic plugin source: @migration-discovery/plugin-mta-card
    (frontend card on Component pages; reads MTA hub via proxy).
  - Install manifests for the rhdh operator + Backstage CR with
    app-config wiring AAP, MTA, Gitea, Kubernetes plugin, Argo CD,
    TechDocs, and a CronJob that rotates the MTA Keycloak token.

Tests:
  - tests/test-emit-catalog.yml: standalone smoke test for the
    catalog emitter (validated against synthetic fixture).
- playbooks/report-fleet-adhoc.yml: builds an in-memory inventory from
  the fleet_report_inventory_text extra-var (multi-line IP/host list)
  so the RHDH step1-discover-fleet template can pass arbitrary targets.
- rhdh/install/01-operator.yaml: drop OwnNamespace OperatorGroup;
  rhdh operator only supports AllNamespaces — install into
  openshift-operators instead.
- rhdh/install/20-app-config.yaml: point Templates Location URL at
  the rhdh-integration branch until the PR is merged.
- Pivot from operator install to Helm chart (redhat-developer-hub 1.9.4).
  The rhdh operator hard-depends on cloud-native-postgresql, which is
  broken on this cluster (missing image-pull secret).
- helm-values.yaml: plugin list (AAP, ArgoCD, K8s, TechDocs, Gitea
  provider), app-config wiring AAP/MTA/Gitea/K8s/DevSpaces, env-from
  rhdh-secrets/rhdh-backend-secret.
- Update Step 1 template to call 'Step 1 (Ad-hoc) — Discover from IP list'
  (JT 107) instead of the inventory-based JT 97.
- Document install steps in install/README.md (Helm path; operator
  manifests preserved as reference).
- Add fleet_report/tasks/publish_catalog.yml: after emit_catalog,
  clone migration-catalog, drop YAMLs under engagements/<slug>/,
  rebuild root all.yaml to fan out, and push. Skips silently if
  no catalog_git_token / GIT_TOKEN env var is set.
- Wire publish step into main.yml after emit_catalog.
- Defaults updated: catalog_aap_step1_jt_id → 107 (the ad-hoc JT),
  catalog_git_url / branch / email / user for the publish step.
- helm-values: comment out unused Argo CD appConfig (no Argo
  instance on anaeem yet; plugin still loads, just no instances).
RHDH 1.9.4 default bundle does NOT include the AAP scaffolder plugin
(rhaap:*) or a Gitea catalog backend module. Pivot:

- helm-values: drop ansible-plugin-backstage-rhaap, drop Gitea catalog
  module, fix Argo CD plugin name (...-argo-cd-backend, not -argo-cd),
  enable roadiehq-scaffolder-backend-module-http-request-dynamic.
- helm-values: add /aap proxy with Authorization Bearer
  ${AAP_AUTH_TOKEN} so templates can POST to AAP without an
  AAPTokenField widget.
- step1/step2 templates: replace rhaap:launch-job-template with
  http:backstage:request POSTing to /api/proxy/aap/api/controller/v2/
  job_templates/{id}/launch/.
- step2: replace backstage:catalog:fetch with catalog:fetch (correct
  built-in action name).
Verified against /opt/app-root/src/dynamic-plugins/dist/ in rhdh image.
Corrected: roadiehq-backstage-plugin-argo-cd-backend
   →     roadiehq-backstage-plugin-argo-cd-backend-dynamic
Plugin throws on missing argocd.appLocatorMethods[].instances[].url,
which crashes the entire backend startup. Re-enable when openshift-gitops
is installed and an argocd: block is added to app-config.
Backstage catalog rejects entities with non-absolute URLs in
metadata.links — replace './...' with absolute AAP URLs (and an
'Open in MTA' link on Components).
RHDH 1.9 doesn't ship publish:gitea:pull-request and we don't have an
OCI source for it. Move the git commit into an AAP playbook
(playbooks/pair-source-repo.yml), have the RHDH template POST to a new
JT via the /api/proxy/aap proxy.

Also fix backstage:catalog:fetch (does not exist) → catalog:fetch.
Previous approach created a separate patch.yaml that would *replace*
the entity in Backstage's catalog (losing description, Maven coords,
deployment annotations, etc.). Now edit the original component YAML
in place: set spec.lifecycle=paired, merge in source-repo/devspaces
annotations, append the two new links, swap 'detected' tag for
'paired'.
anaeem merged commit e55b3f1158 into main 2026-05-15 21:05:43 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
anaeem/ansible-collection-discovery!1
No description provided.