Skip to content
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

ROX-24358: compliance last scan time sortable #11193

Merged
merged 8 commits into from
May 30, 2024

Conversation

dashrews78
Copy link
Contributor

@dashrews78 dashrews78 commented May 21, 2024

Description

Added sort capability for the Last Scan Time on the /v2/compliance/scan/stats/profiles/{profile-name}/clusters endpoint. This required a slight modification to the query framework. See testing section from examples.

Checklist

  • Investigated and inspected CI test results
  • Unit test and regression tests added
    - [ ] Evaluated and added CHANGELOG entry if required
    - [ ] Determined and documented upgrade steps
    - [ ] Documented user facing changes (create PR based on [openshift/openshift-docs](https://github.com/openshift/openshift-docs) and merge into rhacs-docs)

If any of these don't apply, please comment below.

Testing Performed

Here I tell how I validated my change

curl --insecure "https://central-stackrox.apps.ds-05-29-profuse-help-implem.ocp.infra.rox.systems:443/v2/compliance/scan/stats/profiles/ocp4-cis-node/clusters" -u admin:XXX | json_pp > ~/Downloads/no-sort.json

no-sort.json

curl --insecure "https://central-stackrox.apps.ds-05-29-profuse-help-implem.ocp.infra.rox.systems:443/v2/compliance/scan/stats/profiles/ocp4-cis-node/clusters?query.pagination.sortOption.field=Compliance%20Scan%20Last%20Executed%20Time%20Max&query.pagination.sortOption.reversed=false" -u admin:XXX | json_pp > ~/Downloads/sort.json

sort.json

curl --insecure "https://central-stackrox.apps.ds-05-29-profuse-help-implem.ocp.infra.rox.systems:443/v2/compliance/scan/stats/profiles/ocp4-cis-node/clusters?query.pagination.sortOption.field=Compliance%20Scan%20Last%20Executed%20Time%20Max&query.pagination.sortOption.reversed=true" -u admin:XXX | json_pp > ~/Downloads/reverse-sort.json

reverse-sort.json

Reminder for reviewers

In addition to reviewing code here, reviewers must also review testing and request further testing in case the
performed one does not seem sufficient. As a reviewer, you must not approve the change until you understand the
performed testing and you are satisfied with it.

Copy link

openshift-ci bot commented May 21, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@rhacs-bot
Copy link
Contributor

rhacs-bot commented May 21, 2024

Images are ready for the commit at 5ad4290.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.4.x-814-g5ad429069e.

@dashrews78 dashrews78 changed the title chore(research): compliance last scan time research ROX-24358: compliance last scan time research May 23, 2024
@dashrews78 dashrews78 force-pushed the dashrews/compliance-last-scan-time-research branch from 6f05145 to 58e081e Compare May 23, 2024 18:35
Copy link

codecov bot commented May 28, 2024

Codecov Report

Attention: Patch coverage is 52.94118% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 47.98%. Comparing base (6b22b10) to head (5ad4290).
Report is 6 commits behind head on master.

Files Patch % Lines
...rt/storagetov2/compliance_results_stats_service.go 0.00% 3 Missing ⚠️
pkg/search/postgres/pagination.go 62.50% 3 Missing ⚠️
pkg/search/postgres/query/common.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #11193   +/-   ##
=======================================
  Coverage   47.97%   47.98%           
=======================================
  Files        2330     2330           
  Lines      166730   166760   +30     
=======================================
+ Hits        79990    80019   +29     
- Misses      80387    80390    +3     
+ Partials     6353     6351    -2     
Flag Coverage Δ
go-unit-tests 47.98% <52.94%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@SimonBaeumer SimonBaeumer left a comment

Choose a reason for hiding this comment

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

Nice! 🚢 🐳

pkg/search/postgres/query/common.go Show resolved Hide resolved
@dashrews78 dashrews78 force-pushed the dashrews/compliance-last-scan-time-research branch from d706f1c to 9416f71 Compare May 29, 2024 15:20
@dashrews78
Copy link
Contributor Author

/retest

@dashrews78 dashrews78 changed the title ROX-24358: compliance last scan time research ROX-24358: compliance last scan time sortable May 30, 2024
@dashrews78 dashrews78 merged commit 04148ca into master May 30, 2024
73 checks passed
@dashrews78 dashrews78 deleted the dashrews/compliance-last-scan-time-research branch May 30, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants