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

Relationship to all entities that are archivable should use an active context #85

Closed
moolitayer opened this issue Aug 8, 2017 · 8 comments

Comments

@moolitayer
Copy link

I think these are:

  • container.rb
  • container_group.rb
  • container_image.rb
  • container_project.rb

See

cc @Ladas @cben @agrare

@cben
Copy link
Contributor

cben commented Aug 8, 2017

and container_node.rb (EDIT: not yet, ManageIQ/manageiq#15351)

cc @zakiva @zeari
I agree we want active on the associations by default. But should be careful whether this changes meaning of any historical/chargeback reporting — might need to adjust those queries to still include archived objects.

@zeari
Copy link

zeari commented Aug 10, 2017

meaning of any historical/chargeback reporting — might need to adjust those queries to still include archived objects.

@cben we use archived? so it should be fine. https://github.com/manageiq/manageiq/blob/master/app/models/chargeback_container_image.rb#L100

@Ladas
Copy link
Contributor

Ladas commented Aug 10, 2017

Also the relations using :active should be the same as before, when the foreign key was nullified. In both cases, the relation did not return disconnected objects. So chargeback was usually using something else, like Model.where(...), instead of the associations.

@cben
Copy link
Contributor

cben commented Aug 10, 2017 via email

@zeari
Copy link

zeari commented Aug 10, 2017

Chargeback: just asking archived? is not enough, if we add active scoping,
youll stop seeing archived ones; will need the both-kinds query to preserve
behavior.

We always take all Containers\projects into consideration regardless if theyre currently active or not.
archived? is used to show in the specific line of the report if the container\project is currently alive or not.

@cben
Copy link
Contributor

cben commented Sep 12, 2017

leftover: the pod-project relation is disconnected but kept track of using old_container_project:
ContainerGroup belongs_to :old_container_project
ContainerProject has_many :archived_container_groups, :foreign_key => "old_container_project_id"

In the spirit of soft delete, should stop doing that, retain container group's container_project_id intact but put active scope on project.container_groups.
UPDATE: this got implemented by ManageIQ/manageiq#16302, but still need a data migration to restore already disconnected container_project_id from old_container_project_id.

@miq-bot
Copy link
Member

miq-bot commented Apr 30, 2018

This issue has been automatically marked as stale because it has not been updated for at least 6 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions!

@mfeifer
Copy link
Contributor

mfeifer commented Jan 30, 2020

Please re-open if this is still a bug.

@mfeifer mfeifer closed this as completed Jan 30, 2020
@Fryguy Fryguy removed the stale label Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants