Skip to content

Conversation

@fao89
Copy link
Member

@fao89 fao89 commented Oct 24, 2025

Description

https://issues.redhat.com/browse/AAP-45875

  • What is being changed?
    This change is the foundation for enabling runtime platform feature flags for AAP. This updates the django-ansible-base to be the central location where all platform flags are defined. Components can inherit the ansible_base.feature_flags application to inherit all platform feature flag definitions.
  • Why is this change needed?
    To enable runtime platform feature flags in AAP.
  • How does this change address the issue?
    This change addresses the issue by defining a database flag source, which contains all the feature flags along with their associated metadata. These feature flags are installed into each components database at install-time and kept in sync via resource sync (Gateway is the provider)

Before this can be merged, the following should be done:

  1. Confirm each feature flags metadata
    1. Only Dispatcher and EDA_Analytics feature flags need their metadata confirmed now.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Documentation update
  • Test update

Self-Review Checklist

  • I have performed a self-review of my code
  • I have added relevant comments to complex code sections
  • I have updated documentation where needed
  • I have considered the security impact of these changes
  • I have considered performance implications
  • I have thought about error handling and edge cases
  • I have tested the changes in my local environment

Testing Instructions

Prerequisites

Steps to Test

Recommend testing this through AAP Dev, but it can be tested directly via the test app as well.

  1. Clone https://github.com/ansible/aap-dev/
  2. Enter aap-dev directory and run make configure-sources
  3. Use this PR for the DAB source
  4. Use this PR for the Gateway source - https://github.com/ansible-automation-platform/aap-gateway/pull/1056

Expected Results

AAP Deploys as expected with database feature flags.

Additional Context

Required Actions

@fao89 fao89 force-pushed the phase2/feature-flags/poc branch from 58dc37b to e27082d Compare October 27, 2025 14:30
@fao89 fao89 force-pushed the phase2/feature-flags/poc branch from e27082d to 3b5558b Compare October 27, 2025 14:33
@AlanCoding
Copy link
Member

Only Dispatcher and EDA_Analytics feature flags need their metadata confirmed now.

I'm not sure if we're going to keep the dispatcher feature flag, as it was for a transition period. So it's likely better to never port it to the updated flags system.

@fao89 fao89 marked this pull request as ready for review October 30, 2025 18:41
@fao89 fao89 force-pushed the phase2/feature-flags/poc branch 5 times, most recently from 97f0f83 to 1f5731b Compare November 6, 2025 14:25
@fao89 fao89 force-pushed the phase2/feature-flags/poc branch from 1f5731b to f78d946 Compare November 21, 2025 14:43
@fao89 fao89 force-pushed the phase2/feature-flags/poc branch from f78d946 to 533343f Compare November 21, 2025 15:26
@fao89 fao89 force-pushed the phase2/feature-flags/poc branch 3 times, most recently from cca0e57 to 5387799 Compare November 21, 2025 17:53
zkayyali812 and others added 14 commits November 24, 2025 10:03
…ests

- Add FEATURE_CASE_INSENSITIVE_AUTH_MAPS_ENABLED flag definition to feature_flags.yaml
- Update claims.py to use the correct flag name with _ENABLED suffix
- Fix test_claims.py to use proper django-flags API (enable_flag/disable_flag)
- Remove deprecated settings manipulation in favor of feature flags API
- All 237 authentication claims tests now pass

Fixes failing tests that were expecting the missing feature flag for
case-insensitive authentication mapping functionality.

Signed-off-by: Fabricio Aguiar <fabricio.aguiar@gmail.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
This change resolves failing resource sync tests by ensuring the system user
is properly excluded from orphan detection during resource synchronization.

**Problem:**
Resource sync tests were failing because the system user (_system) was being
incorrectly identified as an "orphaned" resource and deleted during sync
operations. The issue was an inconsistency between:

1. The manifest endpoint (views.py) which already excluded system users
2. The orphan detection logic (sync.py) which did not exclude system users

This caused the system user to be absent from manifests but present in
orphan detection, leading to unintended deletion.

**Solution:**
- Added system user exclusion to get_orphan_resources() function
- Used get_system_user() utility for robust system user identification
- Filter by object_id rather than username for more reliable exclusion
- Maintains consistency with existing manifest endpoint behavior

**Impact:**
- Fixes 4 failing tests: test_resource_sync, test_delete_orphans,
  test_resource_sync_update_conflict, test_resource_sync_create_conflict
- Protects system user from being deleted during resource sync operations
- No impact on regular user resource synchronization behavior

Signed-off-by: Fabricio Aguiar <fabricio.aguiar@gmail.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@fao89 fao89 force-pushed the phase2/feature-flags/poc branch from 1516f17 to 60caf7b Compare November 24, 2025 10:23
@github-actions
Copy link

DVCS PR Check Results:

PR appears valid (JIRA key(s) found)

@bhavenst bhavenst enabled auto-merge (squash) November 24, 2025 20:33
@sonarqubecloud
Copy link

@bhavenst bhavenst merged commit 9db7237 into ansible:devel Nov 24, 2025
15 of 17 checks passed
fao89 added a commit to ansible/galaxy_ng that referenced this pull request Nov 24, 2025
requires: ansible/django-ansible-base#875
Signed-off-by: Fabricio Aguiar <fabricio.aguiar@gmail.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
hsong-rh pushed a commit to ansible/eda-server that referenced this pull request Nov 25, 2025
Jira: https://issues.redhat.com/browse/AAP-45879

This PR moves the EDA feature flag source from Settings based feature
flags, to platform database level feature flags.
This also makes gateway the provider of this data for the platform.

This is required to enable platform level feature flags.

Gateway is the provider of the feature flag value updates, and is
resource synced to EDA/other components.

It can be validated and tested simply with AAP Dev, and requires the
following DAB PR to be merged in beforehand -
ansible/django-ansible-base#875
Once the DAB PR is merged, I will update this PR to point back to the
upstream devel branch of DAB

To test -

1. Clone AAP-Dev
2. make configure-sources
3. Select DAB, GW, and EDA for sources
4. make aap
5. Attempt to hit <GATEWAY_API>/feature_flags/X api endpoint and patch a
flags value.
6. If Gateway Setting RUNTIME_FEATURE_FLAGS == True, the update succeeds
and flag value is resource synced to EDA
7. If Gateway Setting RUNTIME_FEATURE_FLAGS == False, the update fails
with error explaining why.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants