Skip to content
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

[AAP-18826] Integrate Resources API #652

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

Dostonbek1
Copy link
Member

@Dostonbek1 Dostonbek1 commented Feb 7, 2024

  • implement resource_registry app from django-ansible-base

JIRA: AAP-18826

@Alex-Izquierdo
Copy link
Collaborator

Don't we need to bump DAB?

@Dostonbek1
Copy link
Member Author

Don't we need to bump DAB?

I initially thought we needed since there was recent migration changes regarding resource_registry lib in dab, but while testing this PR locally I didn't encounter any issues. I will bump it just to be safe.

@Alex-Izquierdo
Copy link
Collaborator

@Dostonbek1 in your local env you were working with the pinned version?
I have this:

eda-api_1                |   File "/app/venv/lib64/python3.11/site-packages/django/core/management/commands/migrate.py", line 383, in handle
redis_1                  | 1:M 08 Feb 2024 18:35:16.726 * Ready to accept connections
eda-api_1                |     emit_post_migrate_signal(
eda-api_1                |   File "/app/venv/lib64/python3.11/site-packages/django/core/management/sql.py", line 52, in emit_post_migrate_signal
eda-api_1                |     models.signals.post_migrate.send(
eda-api_1                |   File "/app/venv/lib64/python3.11/site-packages/django/dispatch/dispatcher.py", line 176, in send
eda-api_1                |     return [
eda-api_1                |            ^
eda-api_1                |   File "/app/venv/lib64/python3.11/site-packages/django/dispatch/dispatcher.py", line 177, in <listcomp>
eda-api_1                |     (receiver, receiver(signal=self, sender=sender, **named))
eda-api_1                |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
eda-api_1                |   File "/app/venv/lib64/python3.11/site-packages/ansible_base/resource_registry/apps.py", line 60, in initialize_resources
eda-api_1                |     data.append(Resource.init_from_object(obj, resource_type=r_type))
eda-api_1                |                 ^^^^^^^^^^^^^^^^^^^^^^^^^
eda-api_1                | AttributeError: type object 'Resource' has no attribute 'init_from_object'

@Alex-Izquierdo
Copy link
Collaborator

The fact that the tests are green makes me wonder if we need a better test coverage in the integration with DAB

@Dostonbek1
Copy link
Member Author

@Dostonbek1 in your local env you were working with the pinned version? I have this:

eda-api_1                |   File "/app/venv/lib64/python3.11/site-packages/django/core/management/commands/migrate.py", line 383, in handle
redis_1                  | 1:M 08 Feb 2024 18:35:16.726 * Ready to accept connections
eda-api_1                |     emit_post_migrate_signal(
eda-api_1                |   File "/app/venv/lib64/python3.11/site-packages/django/core/management/sql.py", line 52, in emit_post_migrate_signal
eda-api_1                |     models.signals.post_migrate.send(
eda-api_1                |   File "/app/venv/lib64/python3.11/site-packages/django/dispatch/dispatcher.py", line 176, in send
eda-api_1                |     return [
eda-api_1                |            ^
eda-api_1                |   File "/app/venv/lib64/python3.11/site-packages/django/dispatch/dispatcher.py", line 177, in <listcomp>
eda-api_1                |     (receiver, receiver(signal=self, sender=sender, **named))
eda-api_1                |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
eda-api_1                |   File "/app/venv/lib64/python3.11/site-packages/ansible_base/resource_registry/apps.py", line 60, in initialize_resources
eda-api_1                |     data.append(Resource.init_from_object(obj, resource_type=r_type))
eda-api_1                |                 ^^^^^^^^^^^^^^^^^^^^^^^^^
eda-api_1                | AttributeError: type object 'Resource' has no attribute 'init_from_object'

Yeah this is related with the migrations in resource_registry app, there is a fix for it in DAB but it is after the version that we are using right now. So bumping the DAB version should resolve it.

@Dostonbek1 Dostonbek1 merged commit c97a431 into ansible:main Feb 13, 2024
2 checks passed
@Dostonbek1 Dostonbek1 deleted the resources-api branch February 13, 2024 17:00
Dostonbek1 added a commit that referenced this pull request Mar 4, 2024
* implement resource_registry app from django-ansible-base
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants