You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "nicoschmdt (via GitHub)" <gi...@apache.org> on 2025/01/16 13:39:01 UTC

[PR] Add account.created preset variable to Quota tariffs [cloudstack]

nicoschmdt opened a new pull request, #10200:
URL: https://github.com/apache/cloudstack/pull/10200

   ### Description
   
   This PR adds the `account.created` preset variable to Quota tariffs, allowing users to consider an account's creation date when defining values to, for instance, grant a discount on the first month.
   
   This variable is injected as a String. Therefore, users need to parse it first: `Date.parse(account.created)`.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [x] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [x] Minor
   
   ### How Has This Been Tested?
   
   In a local lab, the billing of two accounts was compared in relation to the amount of VM snapshots each one has.
   
   - User Account: created on 17 Oct 2024 17:36:46, with 3 VM snapshots
   - Root Account: created on 24 Oct 2024 13:51:35, with 1 VM snapshot
   
   The base script for the activation rule used was:
   
   ```js
   today = new Date(); // current date was 24 Oct 2024
   daysDiff = (today-Date.parse(account.created))/(1000*60*60*24);
   
   if (daysDiff <= 5 && daysDiff >= 0) {
     20
   } else {
     0
   }
   ```
   
   When `daysDiff` is less than or equal to 15 both accounts were charged. When `daysDiff` is less than or equal to 5 only the Root Account was charged.
   
   It was noted that the first Root Account created by ACS doesn't have a creation date so the script was changed to: 
   
   ```js
   today = new Date();
   daysDiff = (today-Date.parse(account.created))/(1000*60*60*24);
   
   if (daysDiff <= 30 && daysDiff >= 0) {
     0
   } else {
     20
   }
   ```
   
   In this condition, it was observed that the first Root Account was charged while the others weren't.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add account.created preset variable to Quota tariffs [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10200:
URL: https://github.com/apache/cloudstack/pull/10200#issuecomment-2607922631

   @winterhazel a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add account.created preset variable to Quota tariffs [cloudstack]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #10200:
URL: https://github.com/apache/cloudstack/pull/10200#issuecomment-2620983227

   Awesome work, congrats on your first merged pull request!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add account.created preset variable to Quota tariffs [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #10200:
URL: https://github.com/apache/cloudstack/pull/10200#issuecomment-2596384093

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/10200?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 17.01%. Comparing base [(`0c13ded`)](https://app.codecov.io/gh/apache/cloudstack/commit/0c13ded943cc1ac9672d8745eee90cf115204595?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`b68e97a`)](https://app.codecov.io/gh/apache/cloudstack/commit/b68e97a1350ffc998062b37ff363fd8b40678b84?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 1 commits behind head on main.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@             Coverage Diff              @@
   ##               main   #10200      +/-   ##
   ============================================
   + Coverage     16.16%   17.01%   +0.85%     
   - Complexity    13015    13017       +2     
   ============================================
     Files          5644     5250     -394     
     Lines        494640   462242   -32398     
     Branches      59937    54211    -5726     
   ============================================
   - Hits          79955    78661    -1294     
   + Misses       405858   374901   -30957     
   + Partials       8827     8680     -147     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/10200/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/10200/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/10200/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `17.01% <100.00%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/10200?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add account.created preset variable to Quota tariffs [cloudstack]

Posted by "winterhazel (via GitHub)" <gi...@apache.org>.
winterhazel commented on PR #10200:
URL: https://github.com/apache/cloudstack/pull/10200#issuecomment-2607918295

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add account.created preset variable to Quota tariffs [cloudstack]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #10200:
URL: https://github.com/apache/cloudstack/pull/10200#issuecomment-2595720657

   Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
   Here are some useful points:
   - In case of a new feature add useful documentation (raise doc PR at https://github.com/apache/cloudstack-documentation)
   - Be patient and persistent. It might take some time to get a review or get the final approval from the committers.
   - Pay attention to the quality of your code, ensure tests are passing and your PR doesn't have conflicts.
   - Please follow [ASF Code of Conduct](https://github.com/apache/.github/blob/main/.github/CODE_OF_CONDUCT.md) for all communication including (but not limited to) comments on Pull Requests, Issues, Mailing list and Slack.
   - Be sure to read the [CloudStack Coding Conventions](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Coding+conventions).
   Apache CloudStack is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@cloudstack.apache.org (https://cloudstack.apache.org/mailing-lists.html)
   Slack: https://apachecloudstack.slack.com/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add account.created preset variable to Quota tariffs [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10200:
URL: https://github.com/apache/cloudstack/pull/10200#issuecomment-2608069125

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12177


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add account.created preset variable to Quota tariffs [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland merged PR #10200:
URL: https://github.com/apache/cloudstack/pull/10200


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org