-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix(lib.cache): apply fallback cache fix, fix tests #656
Fix(lib.cache): apply fallback cache fix, fix tests #656
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm they resolve the reported problem.
Testing Process:
I tested both the current devel branch (which exhibits the issue) and your fix branch, following these steps:
Pre-requisites Setup (Just In Case)
# 1. In aap-gateway project root, create services directory if doesn't exist
cd aap-gateway
mkdir -p services
# 2. Clone galaxy_ng repository
cd services
git clone https://github.com/ansible/galaxy_ng.git
cd ..
Phase 1: Test with DAB Devel Branch (Base Case)
OUTSIDE CONTAINER:
# 1. Stop existing services
cd aap-dev
make hub-server-down
# 2. Update Galaxy requirements (all three files)
cd ../services/galaxy_ng/requirements
# In requirements.insights.txt, requirements.common.txt, requirements.standalone.txt:
# Change Django version
Django>=4.2.16,<4.3.0
# Change DAB version to devel
django-ansible-base[jwt-consumer] @ git+https://github.com/ansible/django-ansible-base@devel
# 3. Rebuild Hub
cd ../ # back to galaxy_ng root
sudo LOCK_REQUIREMENTS=0 docker compose -f dev/compose/aap.yaml build --no-cache
cd ../../aap-dev
make hub-server-up
Phase 2: Test with the Fix Branch
OUTSIDE CONTAINER:
# 1. Stop services
cd aap-dev
make hub-server-down
# 2. Update Galaxy requirements files again
cd services/galaxy_ng/requirements
# In all three requirements files, change DAB line to the fork's branch
jango-ansible-base[jwt-consumer] @ git+https://github.com/BrennanPaciorek/django-ansible-base@fix/fallback-cache
# 3. Rebuild and start
cd ../
sudo LOCK_REQUIREMENTS=0 docker compose -f dev/compose/aap.yaml build --no-cache
cd ../../aap-dev
make hub-server-up
INSIDE CONTAINER:
# 1. Connect to container
sudo docker exec -it galaxy_ng-api-1 bash
# 2. Verify branch
pip show django-ansible-base
# 3. Test commands - these should now work differently
pulpcore-manager showmigrations
dynaconf list
Expected Results:
- With devel branch: We should see the module-level import issue
- With fix branch: Commands should work without the database connection error
Verification Results:
-
With DAB devel branch:
showmigrations
failed with the expected database connection errordynaconf list
showed minimal output- Version confirmed: 2024.11.26.0.dev38+ga65e8f7
-
With your fix branch:
showmigrations
works correctly, showing all migrationsdynaconf list
shows full configuration- Version confirmed: 24.11.25.0.dev574+g6ae3759
Implementation Notes:
The fix properly addresses the root cause by moving the get_setting
calls from module-level to class instance context, preventing premature settings access during import.
Testing Challenges:
I want to highlight some significant challenges in testing DAB changes:
- Setting up the test environment requires careful coordination between multiple components (Gateway, Hub, DAB)
- The current dependency management makes it non-trivial to test specific DAB versions:
- Had to modify multiple requirements files (insights.txt, common.txt, standalone.txt)
- Required Django version upgrade (to >=4.2.16) to work with current DAB devel
- Complex container build process with multiple layers makes dependency injection challenging
Suggestions for Future:
- Consider improving the development setup to make testing DAB changes more straightforward
- Document the proper way to test DAB changes in the context of Hub/Gateway
Conclusion:
The fix works as intended and resolves the issue. However, the testing process revealed some areas where we could improve our development workflow, particularly around testing DAB changes in downstream components.
👍 for the fix itself.
Thank you for handling this @art-tapin. Very thorough testing and reporting; can really see the legwork put into verifying this patch. I'll look into merging this Monday now that we've got some fix verification. Thank you for discovering the root cause of the issue and creating the initial fix @jctanner. |
8fcefb1
to
17ea450
Compare
|
Apply fix for Fallback cache premature file creation.
AAP-36305