You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by agneya2001 <gi...@git.apache.org> on 2015/12/10 05:01:40 UTC
[GitHub] cloudstack pull request: QUOTA: Ensuring that the dates displayed ...
GitHub user agneya2001 opened a pull request:
https://github.com/apache/cloudstack/pull/1205
QUOTA: Ensuring that the dates displayed are as per user expectations
When querying db we use start of next day to query quota usage for
today, but while displaying it to user we still need to show it as
todays date
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/shapeblue/cloudstack master-9126
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cloudstack/pull/1205.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1205
----
commit 0bad8dd18a445d9570bf6589bf9b5bbeccbd4dca
Author: Abhinandan Prateek <ab...@shapeblue.com>
Date: 2015-12-08T04:29:06Z
QUOTA: Ensuring that the dates displayed are as per user expectations
When querying db we use start of next day to query quota usage for
today, but while displaying it to user we still need to show it as
todays date
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] cloudstack pull request: QUOTA: Ensuring that the dates displayed ...
Posted by agneya2001 <gi...@git.apache.org>.
Github user agneya2001 commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1205#discussion_r47334512
--- Diff: plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java ---
@@ -233,9 +233,9 @@ public int compare(QuotaBalanceVO o1, QuotaBalanceVO o2) {
// order is desc last item is the start item
QuotaBalanceVO startItem = quotaBalance.get(quotaBalance.size() - 1);
QuotaBalanceVO endItem = quotaBalance.get(0);
- resp.setStartDate(startItem.getUpdatedOn());
+ resp.setStartDate(startDate);
--- End diff --
setStartDate of QuotaBalanceResponse makes a copy of the date passed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] cloudstack pull request: QUOTA: Ensuring that the dates displayed ...
Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1205#discussion_r47333986
--- Diff: plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java ---
@@ -233,9 +233,9 @@ public int compare(QuotaBalanceVO o1, QuotaBalanceVO o2) {
// order is desc last item is the start item
QuotaBalanceVO startItem = quotaBalance.get(quotaBalance.size() - 1);
QuotaBalanceVO endItem = quotaBalance.get(0);
- resp.setStartDate(startItem.getUpdatedOn());
+ resp.setStartDate(startDate);
--- End diff --
instead of startDate, pass a new object like new Date(startDate.getTime()) for the ref issue we discovered with the earlier PR. Alternatively, you may fix the setters and getters to do return or set using new Date() syntax
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] cloudstack pull request: QUOTA: Ensuring that the dates displayed ...
Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:
https://github.com/apache/cloudstack/pull/1205#issuecomment-163885070
Alright, re-review it. LGTM.
cc @remibergsma @DaanHoogland
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] cloudstack pull request: QUOTA: Ensuring that the dates displayed ...
Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the pull request:
https://github.com/apache/cloudstack/pull/1205#issuecomment-164293808
did a code review and trustin @bhaisaab his testing skills: LGTM
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] cloudstack pull request: QUOTA: Ensuring that the dates displayed ...
Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1205#discussion_r47333902
--- Diff: plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java ---
@@ -83,7 +83,12 @@ public void setDomainId(Long domainId) {
}
public Date getEndDate() {
- return endDate == null ? null : _responseBuilder.startOfNextDay(endDate == null ? null : new Date(endDate.getTime()));
+ if (endDate==null){
--- End diff --
minor style issue: add a space between comparators so like
if (endData == null)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] cloudstack pull request: QUOTA: Ensuring that the dates displayed ...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/cloudstack/pull/1205
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] cloudstack pull request: QUOTA: Ensuring that the dates displayed ...
Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1205#discussion_r47335119
--- Diff: plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java ---
@@ -233,9 +233,9 @@ public int compare(QuotaBalanceVO o1, QuotaBalanceVO o2) {
// order is desc last item is the start item
QuotaBalanceVO startItem = quotaBalance.get(quotaBalance.size() - 1);
QuotaBalanceVO endItem = quotaBalance.get(0);
- resp.setStartDate(startItem.getUpdatedOn());
+ resp.setStartDate(startDate);
--- End diff --
LGTM then :)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] cloudstack pull request: QUOTA: Ensuring that the dates displayed ...
Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:
https://github.com/apache/cloudstack/pull/1205#issuecomment-163882122
LGTM (tested on Abhi's env)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---