Skip to content

Conversation

aslamovamir
Copy link
Contributor

@aslamovamir aslamovamir commented Apr 2, 2025

Description

What does this PR do?
This api endpoint will be updated to only show client counts for an entire billing period. By default, it will return the activity information of the current billing period.
The start_time and end_time parameters will still be available but can only be used to specify the beginning or end of a billing period, not specific dates within/outside a billing period. If specified, The counters API will return data for the billing period corresponding to the specified start time, meaning the start time of the query will be aligned with the start of the billing period to which it belongs, regardless of the exact date provided by the user. If only end_time is specified, the query will be aligned with the start of the billing period to which the end_time belongs to.

On CE, the counters api will be able to return results for any time-ranges except for the current month. What this means is that, by default, the counters api returns results until the end of last month. If current month is specified as the end_time, data is only returned until the last month with a warning end_time parameter can only be used to specify until the end of last month. The value provided for this parameter is not supported and is ignored. Showing counts until the end of last month.

Associated ENT PR: https://github.com/hashicorp/vault-enterprise/pull/7704

TODO only if you're a HashiCorp employee

  • Backport Labels: If this fix needs to be backported, use the appropriate backport/ label that matches the desired release branch. Note that in the CE repo, the latest release branch will look like backport/x.x.x, but older release branches will be backport/ent/x.x.x+ent.
    • LTS: If this fixes a critical security vulnerability or severity 1 bug, it will also need to be backported to the current LTS versions of Vault. To ensure this, use all available enterprise labels.
  • ENT Breakage: If this PR either 1) removes a public function OR 2) changes the signature
    of a public function, even if that change is in a CE file, double check that
    applying the patch for this PR to the ENT repo and running tests doesn't
    break any tests. Sometimes ENT only tests rely on public functions in CE
    files.
  • Jira: If this change has an associated Jira, it's referenced either
    in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.
  • ENT PR: If this change has an associated ENT PR, please link it in the
    description. Also, make sure the changelog is in this PR, not in your ENT PR.

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Apr 2, 2025
Copy link

github-actions bot commented Apr 2, 2025

CI Results:
All Go tests succeeded! ✅

@aslamovamir aslamovamir changed the title wip VAULT-34674 Apr 3, 2025
@aslamovamir aslamovamir marked this pull request as ready for review April 3, 2025 01:02
@aslamovamir aslamovamir requested a review from a team as a code owner April 3, 2025 01:02
Copy link

github-actions bot commented Apr 3, 2025

Build Results:
All builds succeeded! ✅

@aslamovamir aslamovamir requested a review from divyaac April 14, 2025 14:52
Copy link
Contributor

@akshya96 akshya96 left a comment

Choose a reason for hiding this comment

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

LGTM! We need to remove oss patch file and added a comment to confirm if we need go.mod and go.sum changes.

@aslamovamir
Copy link
Contributor Author

Member

@akshya96 Thanks for the review! I reverted go mod changes and removed the oss patch file

Copy link
Contributor

@divyaac divyaac left a comment

Choose a reason for hiding this comment

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

We need to add a changelog entry for this!

@aslamovamir aslamovamir requested review from divyaac and akshya96 April 14, 2025 19:41
@aslamovamir
Copy link
Contributor Author

We need to add a changelog entry for this!

Added the changelog entree for CE, let me know if we need to add the ENT changelog here too?

@aslamovamir aslamovamir merged commit 4f661c6 into main Apr 15, 2025
91 of 92 checks passed
@aslamovamir aslamovamir deleted the aslamovamir-vault-34674-counters-by-billing-period-oss branch April 15, 2025 13:36
Erfankam pushed a commit to Erfankam/vault that referenced this pull request Sep 1, 2025
* apply oss changes

* comment fix

* fix TestOperatorUsageCommandRun by defining billing start via license

* update go mod

* revert the changes in operator usage test

* fix operator usage test

* fix acme regeneration tests

* revert the changes for activity testonly test

* fix activity testonly tests

* seperate tests into ce and ent

* move 2 more tests to oss and ent

* remove left over test from common

* updates after feedback

* updates

* added unit tests to tests oss get start and end time function

* bring updates from ent

* carry over updates from ent pr

* fix the wording in ce warning

* add a dot to ent warning

* update comment

* revert go mod and go sum changes, remove the unintended oss changes patch

* add changelog entree for ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants