server icon indicating copy to clipboard operation
server copied to clipboard

[PM-13730] Return Policy object instead of NotFoundException

Open BTreston opened this issue 1 year ago â€ĸ 3 comments

đŸŽŸī¸ Tracking

PM-13730

📔 Objective

This PR removes the thrown NotFoundException when policies are not found and returns a default Policy object with the same Type sent in the request and the Enabled value set to false

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

đŸĻŽ Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or â„šī¸ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or âš ī¸ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or â™ģī¸ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

BTreston avatar Oct 17 '24 20:10 BTreston

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 41.79%. Comparing base (1fb366d) to head (9005f25). Report is 35 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4911      +/-   ##
==========================================
+ Coverage   41.75%   41.79%   +0.04%     
==========================================
  Files        1363     1364       +1     
  Lines       63915    64029     +114     
  Branches     5853     5874      +21     
==========================================
+ Hits        26686    26762      +76     
- Misses      36026    36063      +37     
- Partials     1203     1204       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 17 '24 21:10 codecov[bot]

Logo Checkmarx One – Scan Summary & Details – b7aabb28-2bf0-4a76-a027-597dc8bf8cc0

New Issues

Severity Issue Source File / Package Checkmarx Insight
HIGH Passwords And Secrets - Generic Password /test-database.yml: 185 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 92 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 80 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 69 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 111 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 189 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 182 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 105 Query to find passwords and secrets in infrastructure code.
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 515 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /cleanup-rc-branch.yml: 21 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /_move_finalization_db_scripts.yml: 27 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /_move_finalization_db_scripts.yml: 103 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 207 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 631 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 548 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 582 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /build.yml: 548 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /build.yml: 582 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /build.yml: 515 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /build.yml: 631 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...

Fixed Issues

Severity Issue Source File / Package
HIGH Passwords And Secrets - Generic Password /test-database.yml: 104
HIGH Passwords And Secrets - Generic Password /test-database.yml: 91
HIGH Passwords And Secrets - Generic Password /test-database.yml: 79
HIGH Passwords And Secrets - Generic Password /test-database.yml: 68
HIGH Passwords And Secrets - Generic Password /test-database.yml: 188
HIGH Passwords And Secrets - Generic Password /test-database.yml: 110
HIGH Passwords And Secrets - Generic Password /test-database.yml: 184
HIGH Passwords And Secrets - Generic Password /test-database.yml: 181
MEDIUM CSRF /src/Api/AdminConsole/Controllers/PoliciesController.cs: 148
MEDIUM CSRF /src/Api/AdminConsole/Controllers/PoliciesController.cs: 78
MEDIUM CSRF /src/Api/AdminConsole/Controllers/PoliciesController.cs: 61
MEDIUM CSRF /src/Api/AdminConsole/Controllers/PoliciesController.cs: 148
MEDIUM CSRF /src/Api/AdminConsole/Controllers/PoliciesController.cs: 78
MEDIUM CSRF /src/Api/AdminConsole/Controllers/PoliciesController.cs: 61
MEDIUM Unpinned Actions Full Length Commit SHA /_move_finalization_db_scripts.yml: 102
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 206
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 547
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 581
MEDIUM Unpinned Actions Full Length Commit SHA /_move_finalization_db_scripts.yml: 26
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 514
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 630
MEDIUM Unpinned Actions Full Length Commit SHA /cleanup-rc-branch.yml: 20
LOW Unpinned Actions Full Length Commit SHA /build.yml: 581
LOW Unpinned Actions Full Length Commit SHA /_move_finalization_db_scripts.yml: 26
LOW Unpinned Actions Full Length Commit SHA /build.yml: 630
LOW Unpinned Actions Full Length Commit SHA /build.yml: 206
LOW Unpinned Actions Full Length Commit SHA /build.yml: 514
LOW Unpinned Actions Full Length Commit SHA /cleanup-rc-branch.yml: 20
LOW Unpinned Actions Full Length Commit SHA /build.yml: 547
LOW Unpinned Actions Full Length Commit SHA /_move_finalization_db_scripts.yml: 102

github-actions[bot] avatar Oct 17 '24 21:10 github-actions[bot]

@r-tome Still a bit shaky on exactly how nunit works, but I think I have the general gist for what these tests should do. Definitely open to more feedback, if these seem totally off base let me know.

BTreston avatar Oct 18 '24 21:10 BTreston