-
Notifications
You must be signed in to change notification settings - Fork 1.3k
PR multi tags in compute offering [#4398] #4399
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
PR multi tags in compute offering [#4398] #4399
Conversation
engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java
Outdated
Show resolved
Hide resolved
engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java
Outdated
Show resolved
Hide resolved
|
@DV101010 can you invest some time in an automated test? |
|
Hi Dahn,
when you talk about automation tests then mean you marvin and similar
things, correct? I'm a newbie in cloudstack and haven't experience with
marvin. I can try it but I think it will need some time.
Exists next to this side
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Marvin+-+Testing+with+Python
other useful documents for the first steps?
Am Do., 12. Nov. 2020 um 13:08 Uhr schrieb dahn <[email protected]>:
… @DV101010 can you invest some time in an automated test?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4399 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANW3U4XYLKCT4HIUIO7V7HDSPPF33ANCNFSM4SOGQP3Q>
.
|
|
@DK101010 All necesary steps/items are in the cwiki in that article and in others, but if you have specific questions the [email protected] list can give more feedback. |
|
Hi @DaanHoogland, Let me know if I can improve the test. |
|
@blueorangutan test centos7 kvm-centos7 keepEnv |
encapsulate multi tag check from Ingest Feature, DepolymentPlanningManager into HostDaoImpl to prevent code duplicates
|
Hi, |
| @Override | ||
| public boolean checkHostServiceOfferingTags(HostVO host, ServiceOffering serviceOffering){ | ||
| if (host == null) { | ||
| return false; | ||
| } | ||
| if (serviceOffering == null) { | ||
| return false; | ||
| } | ||
| if (Strings.isNullOrEmpty(serviceOffering.getHostTag())) { | ||
| return true; | ||
| } | ||
|
|
||
| List<String> serviceOfferingTags = Arrays.asList(serviceOffering.getHostTag().split(",")); | ||
| if(host.getHostTags() != null && host.getHostTags().containsAll(serviceOfferingTags)){ | ||
| return true; | ||
| } | ||
| return false; | ||
| } |
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.
trying to isolate this check is fine but the DAO is for DB interaction, and this is really business logic. personally I would make it a default method for the Host interface, but a member of HostVO could also be.
Can you (shortly) explain why you put it here, @DK101010 ?
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.
Hi,
In the HostDaoImpl there are a couple of other methods that are check host tags, therefore i thought will be good to add this also here. So will be encapsulate common logic in one class, but my experience is still not very well in CS and when it destroy other guidelines then will be also ok to move this method. For me sounds HostVO good, because it seems to be only relevant for this object.
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.
as said I prefer a default method on the interface but it maight require undesirable imports so HostVO is good for my part.
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.
will you be moving this method @DK101010 ?
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.
is moved ;)
very good to avoid duplicates, but I'd put it in the Host object hierarchy somewhere. For this piece of code a unit test would do, @DK101010 . no need for an integration test as far as I can see. |
@weizhouapache I'm also for (1), it is cleaner. But we need also checks in the frontend for future actions to prevent doubles. Also I think a DB upgrade is not necessary. In my opinion it is for a user a small thing to fix this mistake. Especially as I can't imagine that there are so many duplicate tags in use. |
@DK101010 IMHO DB upgrade is also required, as we need to remove the duplications in cloudstack upgrade (otherwise it needs user intervention to remove them from DB manually ). for example, we need to remove record with id=62 from below it is not a small change. I confirm that we can set same storage tag two times on a primary storage as well. |
OK, I thought the user can change the tags over the UI. So we need additional |
@DK101010 yes, it looks a bit complicated. I suggest you to change SQL in this pr as 1st step. |
|
Thanks for start incorporating the suggested changes @DK101010, let us know when it is ready for review |
|
@blueorangutan package |
|
@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 740 |
|
@DK101010 could you please fix the conflicts ? |
|
@blueorangutan package |
|
@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 748 |
|
@blueorangutan test |
|
@weizhouapache a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
tested ok |
|
Trillian test result (tid-1471)
|
|
@blueorangutan package |
|
@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 877 |
|
@blueorangutan test |
|
@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1651)
|
nvazquez
left a comment
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.
LGTM
Description
Types of changes
How Has This Been Tested?
manually tested (run cloudstack in my vmware environment)
PR: #4399