Skip to content

Release v.2.14.1 - #80

Merged
ruslanbaidan merged 37 commits into
masterfrom
stage
Aug 14, 2026
Merged

Release v.2.14.1#80
ruslanbaidan merged 37 commits into
masterfrom
stage

Conversation

@ruslanbaidan

@ruslanbaidan ruslanbaidan commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 new “asset-based ISO 27005:2022 alignment” capabilities by adding structured risk metadata (risk sources, review cadence, residual risk acceptance workflow), supervisor-based delegation, and auditable history tracking across information and operational risks.

Changes:

  • Add ANR supervisors/roles model and APIs, plus delegated authorization paths for limited risk-field updates and residual risk approvals.
  • Introduce risk sources, reassessment triggers, and interested parties (entities, tables, services, APIs) with import/export support.
  • Add ANR history tracking (entity/table/service/controller) and record history events for consequences and recommendation linking/unlinking.

Reviewed changes

Copilot reviewed 71 out of 71 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
view/layout/layout.phtml Loads new front-end JS modules related to history tables and new domain services.
src/Validator/InputValidator/InstanceRiskOp/UpdateInstanceRiskOpDataInputValidator.php Extends validation rules for operational risk updates (risk source, supervisors, residual acceptance, review metadata).
src/Validator/InputValidator/InstanceRiskOp/PatchDelegatedInstanceRiskOpDataInputValidator.php Restricts PATCH payloads to delegated/supervisor-editable fields for operational risks.
src/Validator/InputValidator/InstanceRisk/UpdateInstanceRiskDataInputValidator.php Extends validation rules for information risk updates (supervisors, residual acceptance, review metadata, risk source).
src/Validator/InputValidator/InstanceRisk/PatchDelegatedInstanceRiskDataInputValidator.php Restricts PATCH payloads to delegated/supervisor-editable fields for information risks.
src/Validator/InputValidator/AnrSupervisor/UpdateAnrSupervisorDataInputValidator.php Validator variant for updating supervisors (name not required).
src/Validator/InputValidator/AnrSupervisor/PostAnrSupervisorDataInputValidator.php Validator variant for creating supervisors (name required).
src/Validator/InputValidator/AnrSupervisor/PatchAnrSupervisorStatusInputValidator.php Validator for patching supervisor active status.
src/Validator/InputValidator/AnrSupervisor/AbstractAnrSupervisorDataInputValidator.php Shared supervisor validation rules (name/email/roles/linking/isActive).
src/Validator/FieldValidator/LinkedUserExistenceValidator.php Validates linked user existence when assigning a linked user ID.
src/Table/UserTable.php Adds user search helper for linking supervisors to users.
src/Table/RiskSourceTable.php Adds persistence/query helpers and “used in risks” checks for risk sources.
src/Table/ReassessmentTriggerTable.php Adds ANR reassessment trigger queries ordered by position.
src/Table/InterestedPartyTable.php Adds ANR interested party queries ordered by position.
src/Table/InstanceRiskTable.php Adds risk-source join/keyword/order support for information-risk listing/search.
src/Table/InstanceRiskOwnerTable.php Removes legacy risk owner table implementation.
src/Table/InstanceRiskOpTable.php Adds risk-source join/keyword/order support for operational-risk listing/search.
src/Table/AnrSupervisorTable.php Adds supervisor query helpers (filters, linked-user lookups, role checks).
src/Table/AnrSupervisorRoleTable.php Adds table wrapper for supervisor roles.
src/Table/AnrHistoryTable.php Adds history query helpers by target/type and latest entry retrieval.
src/Service/RiskSourceService.php Adds CRUD service layer for risk sources with safety checks on deletion.
src/Service/ResidualRiskAcceptanceService.php Implements residual-risk decision action (approval checks + history entries).
src/Service/ReassessmentTriggerService.php Adds CRUD + duplication + import processing for reassessment triggers (position-aware).
src/Service/InterestedPartyService.php Adds CRUD + duplication + import processing for interested parties (position-aware).
src/Service/InstanceRiskOwnerService.php Removes legacy risk owner service implementation.
src/Service/AnrRecommendationRiskService.php Records ANR history events when recommendations are linked/unlinked to risks.
src/Service/AnrInstanceConsequenceService.php Records ANR history events when consequence values/visibility changes affect risks.
src/Service/AnrHistoryService.php Adds history entry creation/batch insert + export-ready formatting.
src/Middleware/AnrValidationMiddleware.php Adds delegated supervisor authorization paths for limited PATCH/POST routes.
src/Import/Traits/ImportDataStructureAdapterTrait.php Adapts import structure for supervisor-based ownership and adds new risk metadata fields.
src/Import/Service/InstanceImportService.php Integrates import processors/services for supervisors, interested parties, reassessment triggers, and risk sources.
src/Import/Processor/RiskSourceImportProcessor.php Adds import processor to upsert risk sources with caching.
src/Import/Processor/OperationalInstanceRiskImportProcessor.php Imports risk source, supervisor ownership, review metadata, and residual acceptance fields for operational risks.
src/Import/Processor/InstanceRiskImportProcessor.php Imports risk source, supervisor ownership, review metadata, and residual acceptance fields for information risks.
src/Export/Service/Traits/OperationalInstanceRiskExportTrait.php Exports risk source, supervisor ownership, review metadata, and residual acceptance data for operational risks.
src/Export/Service/Traits/InformationInstanceRiskExportTrait.php Exports risk source, supervisor ownership, review metadata, and residual acceptance data for information risks.
src/Export/Service/AnrExportService.php Extends ANR export to include supervisors, risk sources, interested parties, and reassessment triggers.
src/Entity/RiskSource.php Adds front-office RiskSource entity mapped to risk_sources.
src/Entity/ReassessmentTrigger.php Adds front-office ReassessmentTrigger entity mapped to anr_reassessment_triggers.
src/Entity/InterestedParty.php Adds InterestedParty entity mapped to anr_interested_parties with position support.
src/Entity/InstanceRiskOp.php Extends operational risk entity with risk source, supervisor ownership, review metadata, and residual acceptance fields.
src/Entity/InstanceRisk.php Extends information risk entity with risk source, supervisor ownership, review metadata, and residual acceptance fields.
src/Entity/AnrSupervisorRole.php Adds supervisor role entity and role constants.
src/Entity/AnrSupervisor.php Adds supervisor entity with roles and linked risks relationships.
src/Entity/AnrHistory.php Adds history entity + field/change-type constants for audit log.
src/Controller/ApiAnrSupervisorsController.php Adds REST API controller for supervisor management and user-linking search.
src/Controller/ApiAnrRiskSourcesController.php Adds REST API controller for risk source CRUD/listing.
src/Controller/ApiAnrRisksManagementController.php Adds REST API endpoint for risks management view/batch updates.
src/Controller/ApiAnrRiskResidualAcceptanceController.php Adds REST endpoint for residual acceptance decisions on information risks.
src/Controller/ApiAnrRiskOwnersController.php Removes legacy risk owners API controller.
src/Controller/ApiAnrReassessmentTriggersController.php Adds REST API controller for reassessment triggers CRUD/listing.
src/Controller/ApiAnrOperationalRiskResidualAcceptanceController.php Adds REST endpoint for residual acceptance decisions on operational risks.
src/Controller/ApiAnrInterestedPartiesController.php Adds REST API controller for interested parties CRUD/listing.
src/Controller/ApiAnrInstancesRisksOpController.php Extends responses and adds delegated PATCH flow for operational risks.
src/Controller/ApiAnrInstancesRisksController.php Extends responses and adds delegated PATCH flow for information risks.
src/Controller/ApiAnrHistoryController.php Adds REST API endpoint to fetch ANR history entries.
migrations/db/20260615120000_create_anr_history_table.php Creates anr_history audit table.
migrations/db/20260603120000_add_anr_supervisors.php Adds supervisors/roles tables + migrates legacy owners into supervisors + adds new risk columns/FKs.
migrations/db/20260522101000_add_interested_parties.php Creates anr_interested_parties table.
migrations/db/20260519101000_add_residual_risk_acceptance.php Adds residual risk acceptance fields (initial schema) and operational risk source FK.
migrations/db/20260515101000_add_risk_review_metadata.php Adds review metadata fields and reassessment trigger monitoring approach.
migrations/db/20260511101000_add_anr_reassessment_triggers.php Creates anr_reassessment_triggers table.
migrations/db/20260505100000_add_risk_sources.php Creates risk_sources table, seeds defaults per ANR, and adds FK to information risks.
composer.json Upgrades Guzzle to v7 and adds explicit guzzlehttp/psr7 dependency.

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

Comment thread src/Import/Processor/InstanceRiskImportProcessor.php
Comment thread src/Service/ResidualRiskAcceptanceService.php
* origin/feature/AB-17:
  Add assigned risk counts for linked supervisors
* origin/stage:
  Add assigned risk counts for linked supervisors
  Moved the duplicated export methods to a trait.
  FIxed the users creation command to set the proper password.

# Conflicts:
#	src/Service/AnrService.php
Copilot AI review requested due to automatic review settings July 30, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 78 out of 78 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

src/Validator/InputValidator/InstanceRiskOp/UpdateInstanceRiskOpDataInputValidator.php:31

  • riskSourceId uses ToInt, which will coerce empty strings to 0. Downstream (AnrInstanceRiskOpService::getRiskSourceFromData) treats only null/'' as "clear" and will try to load ID 0 otherwise. Normalize empty input to null like the InstanceRisk validator does.
    src/Validator/InputValidator/AnrSupervisor/PatchAnrSupervisorStatusInputValidator.php:21
  • isActive is marked as required but also allow_empty => true. With the Boolean filter + controller cast to bool, an empty/null payload can be accepted and interpreted as false, unintentionally deactivating a supervisor. Require a non-empty value for this field.
    src/Validator/InputValidator/InstanceRiskOp/UpdateInstanceRiskOpDataInputValidator.php:264
  • reviewFrequency has no length validation, but the DB column is limited (e.g. InstanceRiskOp::$reviewFrequency is length=50). This can lead to persistence errors when longer values are submitted. Add a StringLength validator (and normalize empty strings to null for consistency with the InstanceRisk validator).

Added the PDF reports generation possibility
Copilot AI review requested due to automatic review settings July 30, 2026 14:54
@ruslanbaidan ruslanbaidan changed the title Asset-based ISO 27005:2022 alignment Release v.2.14.1 Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 78 out of 79 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

src/Validator/InputValidator/InstanceRiskOp/UpdateInstanceRiskOpDataInputValidator.php:31

  • riskSourceId is filtered with ToInt, which turns an empty string into 0. Downstream code treats only null/"" as "unset" and will attempt findById(0), causing an unnecessary lookup/error for PATCH/PUT payloads that send an empty value. Use a callback that preserves null for empty input (consistent with other *SupervisorId and InstanceRisk validators).
    src/Service/ResidualRiskAcceptanceService.php:112
  • normalizeDecision() currently treats decisions case-sensitively and rejects the legacy value rejected, even though other parts of the codebase accept/translate it as an alias of not_accepted. This can break clients sending rejected (or different casing). Normalize to lowercase and map rejected -> not_accepted.

…ext reassessment date, fixed assigned to RO and RRA risks number.
Copilot AI review requested due to automatic review settings July 31, 2026 15:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 79 out of 80 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/Validator/InputValidator/InstanceRiskOp/UpdateInstanceRiskOpDataInputValidator.php:33

  • riskSourceId is optional, but using ToInt will convert an empty string to 0. That can lead to attempting to assign risk source ID 0 instead of clearing the field (null). Align this filter with the other optional *Id fields by returning null for null/'' and casting otherwise.
    src/Service/ResidualRiskAcceptanceService.php:116
  • normalizeDecision() currently rejects the legacy value "rejected" even though other parts of the codebase (validators and exports) treat rejected as an alias of not_accepted. Also, it doesn't normalize case, so e.g. "Accepted" will be rejected. Consider lowercasing and mapping rejected -> not_accepted to keep API behavior consistent.

Copilot AI review requested due to automatic review settings August 4, 2026 16:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 81 out of 82 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/Validator/InputValidator/InstanceRiskOp/UpdateInstanceRiskOpDataInputValidator.php:34

  • riskSourceId is filtered with ToInt, which casts null/'' to 0. The service layer treats only null/'' as “clear risk source” and otherwise calls findById((int)$riskSourceId), so an empty value will become 0 and likely trigger a lookup for ID 0 instead of clearing.
    src/Service/ResidualRiskAcceptanceService.php:116
  • normalizeDecision() only accepts exact "accepted" / "not_accepted" and does not lowercase input. Elsewhere in this PR, validators accept the legacy value "rejected" (and lowercasing is applied), and import code normalizes "rejected" -> "not_accepted". As-is, the residual acceptance endpoint can reject values that the rest of the API considers valid.

Copilot AI review requested due to automatic review settings August 5, 2026 07:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 81 out of 82 changed files in this pull request and generated 1 comment.

Suppressed comments (4)

src/Validator/InputValidator/InstanceRiskOp/UpdateInstanceRiskOpDataInputValidator.php:30

  • riskSourceId is filtered with ToInt, so an empty string (""), which the service treats as "no risk source", becomes 0. Downstream, AnrInstanceRiskOpService::getRiskSourceFromData() will then call findById(0), which is likely an invalid ID and can throw. Align this with the InstanceRisk validator by converting null/"" to null before casting to int.
    src/Validator/InputValidator/InstanceRiskOp/UpdateInstanceRiskOpDataInputValidator.php:87
  • residualRiskDecision currently allows the legacy value "rejected" and passes it through unchanged. Other parts of the code normalize legacy "rejected" to "not_accepted" (e.g., import processors) and ResidualRiskAcceptanceService only accepts "accepted"/"not_accepted". To avoid persisting mixed values, normalize "rejected" to "not_accepted" in this filter.
    src/Validator/InputValidator/InstanceRisk/UpdateInstanceRiskDataInputValidator.php:179
  • residualRiskDecision currently allows the legacy value "rejected" and passes it through unchanged. Other parts of the code normalize legacy "rejected" to "not_accepted" and ResidualRiskAcceptanceService only accepts "accepted"/"not_accepted". To avoid persisting mixed values, normalize "rejected" to "not_accepted" in this filter.
    src/Validator/InputValidator/AnrSupervisor/PatchAnrSupervisorStatusInputValidator.php:26
  • PatchAnrSupervisorStatusInputValidator marks isActive as required but also allow_empty=true. With Laminas\Filter\Boolean, empty payloads like null/"" will be coerced to false and still considered valid, which can unintentionally deactivate a supervisor. Require an explicit boolean by disallowing empty values here.

Comment thread view/layout/layout.phtml
@ruslanbaidan
ruslanbaidan merged commit 57a9074 into master Aug 14, 2026
2 checks passed
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