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

Update the dds stats command to get the rows from Statistics endpoint #643

Merged

Conversation

i-oden
Copy link
Member

@i-oden i-oden commented Aug 21, 2023

Before submitting this PR

  1. Description: The current method of stats was to calculate number of projects etc every time the command dds stats was run. Now, there's a new endpoint which gets the statistics from the reporting table and returns all rows. This PR updates the dds stats command to return those rows and print them as tables.
  2. Jira task / GitHub issue: DDS-1575
  3. How to test: Add information on how someone could manually test this functionality. As detailed as possible.
  4. Type of change: Check the relevant boxes in the section below
  5. Add docstrings and comments to code, even if you personally think it's obvious.

What type of change(s) does the PR contain?

  • New feature
    • Breaking: Please describe the reason for the break and how we can fix it.
    • Non-breaking
  • Bug fix
    • Breaking: Please describe the reason for the break and how we can fix it.
    • Non-breaking
  • Security Alert fix
  • Documentation
  • Tests (only)
  • Workflow

Checklist

  • Sprintlog
    • Added
    • Not needed (E.g. PR contains only tests)
  • Rebase / Update / Merge from base branch (the branch from which the current is forked)
    • Done
    • Not needed
  • Blocking PRs
    • Merged
    • No blocking PRs
  • PR to master branch

Actions / Scans

  • Black: Python code formatter. Does not execute. Only tests.
    Run black . locally to execute formatting.
    • Passed
  • Pylint: Python code linter. Does not execute. Only tests.
    Fix code producing warnings. Code must get 10/10.
    • Warnings fixed
    • Passed
  • Prettier: General code formatter. Our use case: MD and yaml mainly.
    Run npx prettier --write . locally to execute formatting.
    • Passed
  • Yamllint: Linting of yaml files.
    • Passed
  • Tests: Pytest to verify that functionality works as expected.
    • New tests added
    • No new tests
    • Passed
  • TestPyPi: Build CLI and publish to TestPyPi in order to verify before release.
    • Passed
  • CodeQL: Scan for security vulnerabilities, bugs, errors
    • New alerts: Go through them and either fix, dismiss och ignore. Add reasoning in items below.
    • Alerts fixed: What?
    • Alerts ignored / dismissed: Why?
    • Passed
  • Trivy: Security scanner
    • New alerts: Go through them and either fix, dismiss och ignore. Add reasoning in items below.
    • Alerts fixed: What?
    • Alerts ignored / dismissed: Why?
    • Passed
  • Snyk: Security scanner
    • New alerts: Go through them and either fix, dismiss och ignore. Add reasoning in items below.
    • Alerts fixed: What?
    • Alerts ignored / dismissed: Why?
    • Passed

@i-oden i-oden self-assigned this Aug 21, 2023
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Merging #643 (431b82b) into dev (803bbc2) will increase coverage by 0.32%.
Report is 1 commits behind head on dev.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##              dev     #643      +/-   ##
==========================================
+ Coverage   46.30%   46.63%   +0.32%     
==========================================
  Files          31       31              
  Lines        2790     2792       +2     
==========================================
+ Hits         1292     1302      +10     
+ Misses       1498     1490       -8     
Files Changed Coverage Δ
dds_cli/__main__.py 41.72% <40.00%> (+0.31%) ⬆️
dds_cli/__init__.py 91.76% <100.00%> (+0.09%) ⬆️
dds_cli/superadmin_helper.py 100.00% <100.00%> (ø)

@i-oden
Copy link
Member Author

i-oden commented Sep 6, 2023

Tests and fixes of the failed checks needed

@i-oden i-oden requested a review from valyo September 6, 2023 14:47
@i-oden i-oden marked this pull request as ready for review September 6, 2023 14:47
Copy link
Member

@valyo valyo left a comment

Choose a reason for hiding this comment

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

Works fine and the local tests pass

@i-oden i-oden merged commit beb367b into dev Sep 12, 2023
18 checks passed
@i-oden i-oden deleted the DDS-1575-update-dds-stats-command-to-get-latest-reporting-row branch September 12, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants