-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update: Group samples count calculation should include shared groups and projects #862
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
201b69c
to
b597634
Compare
This comment has been minimized.
This comment has been minimized.
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.
Looks good and is working as specified. Just one small change.
@@ -91,6 +91,26 @@ def shared_namespace_metadata_keys(namespace) | |||
metadata_fields | |||
end | |||
|
|||
def aggregated_samples_count # rubocop:disable Metrics/AbcSize |
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.
Nitpick: Please change the order of the first 2 lines of the function to
return sample_count unless shared_namespaces.any?
aggregated_samples_count = samples_count
This way the first line is the early return from the function, and we do not have to create/assign the new variable before doing so.
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.
Makes sense! Switched in 73d2743
Code Metrics Report
Code coverage of files in pull request scope (100.0%)
Reported by octocov |
What does this PR do and why?
Describe in detail what your merge request does and why.
This PR changes the sample count of a group to incorporate sample counts from it's shared groups and projects. This update will allow the samples count to properly reflect the amount of samples shown after clicking samples on the sidebar for a group.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other pull requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
General check:
Sharing a project:
Sharing a group:
**Direct samples count for a shared project = samples count of that project
**Direct samples count for a shared group = the sum of all samples found within projects in itself and it's ancestor groups. (This does not include the samples count of projects or groups that have been shared with it)
PR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.