Skip to content

[PM-39164] Gate Access Intelligence report reads on new-architecture flag#7825

Open
Banrion wants to merge 1 commit into
mainfrom
dirt/pm-39137/load-file-reports
Open

[PM-39164] Gate Access Intelligence report reads on new-architecture flag#7825
Banrion wants to merge 1 commit into
mainfrom
dirt/pm-39137/load-file-reports

Conversation

@Banrion

@Banrion Banrion commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

PM-39164

Related Client PR: bitwarden/clients#21315

📔 Objective

This re-points the Access Intelligence report read path from the file-storage flag (AccessIntelligenceVersion2) to the new-architecture flag (AccessIntelligenceNewArchitecture). The file-storage flag should govern only the write format, so keying reads off it meant a report written as a file no longer loaded once file storage was toggled off, the read fell back to inline-only logic and returned a stale or broken "last report." This change fixes that so a file-backed report still loads in any valid flag state, while write-format selection remains file-flag-gated.

Changes

  • Gate GetLatestOrganizationReportAsync (read branch + validated-file download-URL block) on AccessIntelligenceNewArchitecture instead of the file-storage flag.
  • Gate the DownloadReportFileAsync validated-file check on AccessIntelligenceNewArchitecture.
  • Update the affected GetLatest and DownloadReportFile flag-on/flag-off cases in OrganizationReportsControllerTests to exercise the new-architecture flag.

…ture flag

Re-point GetLatestOrganizationReportAsync and DownloadReportFileAsync from the
file-storage flag (AccessIntelligenceVersion2) to AccessIntelligenceNewArchitecture
so file-backed reports still load after file storage is toggled off. Write paths
remain file-flag-gated.
@Banrion Banrion requested a review from a team as a code owner June 16, 2026 23:07
@Banrion Banrion added the ai-review Request a Claude code review label Jun 16, 2026
@Banrion Banrion requested a review from lastbestdev June 16, 2026 23:07
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the re-pointing of the Access Intelligence report read path from the file-storage flag (AccessIntelligenceVersion2) to the new-architecture flag (AccessIntelligenceNewArchitecture) in OrganizationReportsController. The change correctly gates GetLatestOrganizationReportAsync (read branch and validated-file download-URL block) and the DownloadReportFileAsync validated-file check on the new flag, while write-format paths such as UpdateOrganizationReportAsync remain gated on the file-storage flag — consistent with the stated intent. Both feature flag constants exist in Constants.cs, and the test updates correctly swap the two DownloadReportFile cases from SetupV2Authorization to SetupAuthorization plus an explicit new-architecture flag stub, keeping flag-on/flag-off coverage symmetric.

Code Review Details

No findings. The change is well-scoped, the flag re-pointing matches the PR objective, and the test updates accurately mirror the controller's new gating logic.

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.24%. Comparing base (a7e9480) to head (38fac60).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7825      +/-   ##
==========================================
- Coverage   65.72%   61.24%   -4.49%     
==========================================
  Files        2210     2210              
  Lines       97820    97820              
  Branches     8832     8832              
==========================================
- Hits        64296    59905    -4391     
- Misses      31298    35782    +4484     
+ Partials     2226     2133      -93     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review needs-qa

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants