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

Replace ContainerLabelTagMapping.controls_tag? with Tag.controlled_by_mapping scope #16449

Merged
merged 1 commit into from
Nov 13, 2017

Conversation

cben
Copy link
Contributor

@cben cben commented Nov 12, 2017

THIS WAS REVERTED in #16462.

More efficient and necessary for ManageIQ/manageiq-providers-kubernetes#162 mapping in graph refresh.

Links

Overview/plan: ManageIQ/manageiq-providers-kubernetes#126

This is necessary to complete containers graph refresh, BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1470021

@miq-bot miq-bot added the wip label Nov 12, 2017
…_mapping scope

More efficient, and can be used in graph refresh.
@cben cben force-pushed the mapped-tags-scope branch from 6fc96a2 to c4e76ed Compare November 12, 2017 11:02
@cben cben changed the title [WIP] Replace ContainerLabelTagMapping.controls_tag? with Tag.controlled_by_mapping scope Replace ContainerLabelTagMapping.controls_tag? with Tag.controlled_by_mapping scope Nov 13, 2017
cben added a commit to cben/manageiq-providers-kubernetes that referenced this pull request Nov 13, 2017
Original code didn't set read_only (UI does set it),
failed with new retagging implementation from
ManageIQ/manageiq#16449
@miq-bot
Copy link
Member

miq-bot commented Nov 13, 2017

@cben Cannot apply the following label because they are not recognized: enhancement gaprindashvili/yes

@miq-bot miq-bot removed the wip label Nov 13, 2017
@miq-bot
Copy link
Member

miq-bot commented Nov 13, 2017

Checked commit cben@c4e76ed with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🏆

Copy link
Contributor

@Ladas Ladas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, would be nice to prove that the queries perform good with high counts.

@cben
Copy link
Contributor Author

cben commented Nov 13, 2017

@miq-bot add-label performance, gaprindashvili/yes

Yeah, I should benchmark. Wanted something that works at all first :-)

@cben
Copy link
Contributor Author

cben commented Nov 13, 2017

Also, I hope later to move to simpler query on tag prefix, but not before some refactorings, that'd be g/no.

@agrare agrare merged commit 340bd59 into ManageIQ:master Nov 13, 2017
@agrare agrare added this to the Sprint 73 Ending Nov 13, 2017 milestone Nov 13, 2017
cben added a commit to cben/manageiq-providers-kubernetes that referenced this pull request Nov 13, 2017
- Use factory for more accurate test

  Original test didn't set read_only (UI does set it),
  failed with new retagging implementation from
  ManageIQ/manageiq#16449

- Test that we don't remove user-assigned tags
cben added a commit to cben/manageiq that referenced this pull request Nov 13, 2017
It seems Tag.controlled_by_mapping works right
but entity.tags.controlled_by_mapping doesn't (?)

Until I debug it, this revert prevents regression
of tag mapping in classic refresh
(and specifically fixes save_tags_inventory_spec)
cben added a commit to cben/manageiq that referenced this pull request Nov 20, 2017
In ManageIQ#16453, I changed this spec to "realistically"
create a tag mapping + category + tag.
But I made a typo/thinko, taking the parent
(category) tag to be assigned to the vm.
This caused false failure for ManageIQ#16449 and days of
lost work debugging/rewriting it, eventually caused
similar failure in the rewrite too :-(

https://bugzilla.redhat.com/show_bug.cgi?id=1508437
cben added a commit to cben/manageiq that referenced this pull request Nov 20, 2017
A scope is needed for tag mapping in graph refresh, and may improve
performance.
Alternative to ManageIQ#16449 - this one no longer cares if there exists a
ContainerLabelTagMapping linked to the category, only that it's name
starts with `kubernetes:` / `amazon:`.  This can happen to
user-created categories too, so we also check it's read_only.
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.

4 participants