Skip to content

Feature/remilovoll/26/03/movepolicyfilemigrating#2603

Merged
lovoll merged 3 commits intomainfrom
feature/remilovoll/26/03/movepolicyfilemigrating
Mar 19, 2026
Merged

Feature/remilovoll/26/03/movepolicyfilemigrating#2603
lovoll merged 3 commits intomainfrom
feature/remilovoll/26/03/movepolicyfilemigrating

Conversation

@lovoll
Copy link
Contributor

@lovoll lovoll commented Mar 19, 2026

Description

Related Issue(s)

  • #{issue number}

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Løvoll, Remi added 2 commits March 18, 2026 15:05
1. when moving instance delegation
2. in app instance delegation in existinf api
Copilot AI review requested due to automatic review settings March 19, 2026 12:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces feature-flagged support for a new instance-delegation policy file path format (intended for an EF-backed storage layout) and adds logic to move/copy existing policy blobs to the new location during instance assignment import.

Changes:

  • Add AccessManagement.InstanceDelegation.EF feature flag branching to select “old” vs “new” instance delegation policy paths.
  • Update instance assignment import flow to copy policy blobs to a new path using blob leases, and extend APIs/call sites with partyId.
  • Update constructors/tests to inject IFeatureManager and add a new helper for the EF path format.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/apps/Altinn.AccessManagement/test/AccessMgmt.Tests/PolicyAdministrationPointTest.cs Updates test wiring for new PolicyAdministrationPoint constructor dependency (IFeatureManager).
src/apps/Altinn.AccessManagement/src/Altinn.AccessMgmt.Core/Utils/Helper/DelegationCheckHelper.cs Treats a new “missing original policy file” error as eligible for error-queue handling.
src/apps/Altinn.AccessManagement/src/Altinn.AccessMgmt.Core/Services/Contracts/IAssignmentService.cs Extends ImportInstanceAssignmentChange API with fromPartyId.
src/apps/Altinn.AccessManagement/src/Altinn.AccessMgmt.Core/Services/AssignmentService.cs Adds blob-copy + lease logic for moving instance policy files to a new location.
src/apps/Altinn.AccessManagement/src/Altinn.AccessMgmt.Core/HostedServices/Services/SingleInstanceRightSyncService.cs Passes partyId into ImportInstanceAssignmentChange.
src/apps/Altinn.AccessManagement/src/Altinn.AccessManagement.Core/Services/PolicyAdministrationPoint.cs Adds feature-flag routing to choose old/new instance policy paths.
src/apps/Altinn.AccessManagement/src/Altinn.AccessManagement.Core/Services/AppsInstanceDelegationService.cs Adds feature-flag handling and party lookups to construct an internal instance URN.
src/apps/Altinn.AccessManagement/src/Altinn.AccessManagement.Core/Helpers/DelegationHelper.cs Adds TryGetNewDelegationPolicyPathFromInstanceRule for the new EF path format.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Member

@jonkjetiloye jonkjetiloye left a comment

Choose a reason for hiding this comment

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

Litt småpirk fra copilot du kan vurdere.
Ellers ser det bra ut

@lovoll lovoll merged commit 35ce8af into main Mar 19, 2026
8 checks passed
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed for 'Authorization Altinn.AccessManagement'

Failed conditions
10.8% Coverage on New Code (required ≥ 65%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@lovoll lovoll deleted the feature/remilovoll/26/03/movepolicyfilemigrating branch March 19, 2026 14:06
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.

3 participants