Skip to content

Add feature conflicts and parameter persistence for forge#570

Draft
jeremylenz wants to merge 11 commits into
theforeman:masterfrom
jeremylenz:feature-conflicts
Draft

Add feature conflicts and parameter persistence for forge#570
jeremylenz wants to merge 11 commits into
theforeman:masterfrom
jeremylenz:feature-conflicts

Conversation

@jeremylenz

@jeremylenz jeremylenz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Why are you introducing these changes? (Problem description, related links)

Some features are mutually exclusive and enabling both leads to a broken deployment. This adds a conflicts mechanism to the feature system so incompatible combinations are caught at deploy time. Also enables parameter persistence for forge so deploy-dev arguments are remembered between runs.

Builds on #569 (cloud-connector-feature) — this PR is intended to be rebased on top of that one. **** ONLY look at the last 3 commits here. ****

What are the changes introduced in this pull request?

  • Add conflicts key support to features.yaml and a conflicting_features filter plugin that detects mutually exclusive features
  • Add validation in check_features role to fail deploys when conflicting features are enabled
  • Enable parameter persistence for forge (OBSAH_PERSIST_PARAMS)
  • Add --preserve-plugin-branches parameter for forge deploy-dev

How to test this pull request

Steps to reproduce:

  • Define two features with a conflicts entry in features.yaml, enable both, and verify deployment fails with a clear error message
  • Run unit tests: python -m pytest tests/unit/features_filter_test.py -vv
  • Run forge deploy-dev with arguments, then run again without them and verify they are remembered

Checklist

  • Tests added/updated (if applicable)
  • Documentation updated (if applicable)

🤖 Generated with Claude Code

jeremylenz and others added 11 commits June 10, 2026 15:32
Re-implements the upstream satellite_operations.cloud_connector role
natively in foremanctl so users can enable it via:
  foremanctl deploy --add-feature cloud-connector

The new role installs rhc and yggdrasil-worker-forwarder, templates
the worker config, starts the rhcd service, and sets rhc_instance_id
via the Foreman API. Optional HTTP proxy support is included.

Works with both foremanctl deploy and forge deploy-dev (with
appropriate credential overrides for the dev environment).

Enforces mutual exclusion with the iop feature at runtime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move iop mutual exclusion and package availability checks into a
new check_cloud_connector role that runs in the checks phase, before
any services are deployed. This avoids a long deploy-dev run failing
late when it reaches the cloud_connector role.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use ca_path with the Foreman CA certificate instead of validate_certs,
matching the pattern used by other roles (foreman, check_foreman_api).
The self-signed CA cert is always available in the deploy context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
After setting the rhc_instance_id, POST to the new
/api/v2/rh_cloud/announce_to_sources endpoint to register the
Satellite in Sources on console.redhat.com. This replaces the
Ruby-side CloudConnectorAnnounceTask that previously triggered
on REX job completion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The yggdrasil-worker-forwarder binary uses the OS trust store and
doesn't accept a CA path argument. Add the Foreman CA certificate
to the system trust store so the worker can verify Foreman's
self-signed certificate when forwarding cloud requests.

Also fix Content-Type header on the announce_to_sources POST.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Set allow_auto_inventory_upload to true via the Foreman API,
matching the previous cloud connector setup behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify /etc/pki/consumer/cert.pem exists early in the checks
phase, since the cloud_connector role needs it to derive the
rhc_instance_id from the certificate CN.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove cross-role variable references from defaults (use standalone
  fallback values; base.yaml provides the real overrides)
- Rename task "Configure rhc-cloud-connector-worker" for consistency
- Rename "Announce Satellite to Sources" to "Announce to Sources"
- Fix var-naming lint: use role-prefixed variable names instead of
  double-underscore prefix

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a 'conflicts' key to features.yaml that declares mutually
exclusive features. A new conflicting_features filter function
validates enabled features and the check_features role fails
early with a clear error message when conflicts are detected.

Uses cloud-connector / iop as the first conflict pair.

Also adds check_features role to deploy-dev so the validation
runs in both production and development deploy paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds OBSAH_PERSIST_PARAMS=true to the forge wrapper, matching
foremanctl's behavior. This ensures features added via
forge deploy-dev --add-feature are remembered across runs,
which is required for conflict detection to work when features
are added in separate deploys.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant