Skip to content

feat(aviator): 2493049 extract FPR parsing into fcli-common-fpr module - #1151

Merged
rsenden merged 3 commits into
fortify:dev/v3.xfrom
anishkumarnagaraj-design:feat/v3.x/aviator/common-fpr-module
Oct 30, 2026
Merged

rsenden merged 3 commits into
fortify:dev/v3.xfrom
anishkumarnagaraj-design:feat/v3.x/aviator/common-fpr-module

Conversation

@anishkumarnagaraj-design

@anishkumarnagaraj-design anishkumarnagaraj-design commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Story

ValueEdge/Octane 2493049 – Extract FPR parsing from fcli-aviator-common into a reusable fcli-common-fpr module (needed before the Aviator 27.1 release).

Targets dev/v3.x.

Why

SAST + DAST FPR parsing should be a standalone, Aviator-independent library that other OpenText teams can reuse.

What changed

  • New module fcli-core/fcli-common-fpr (com.fortify.cli.common.fpr.*): model, filter, processor, dast, util/utils, config + resources (extensions_config.yaml, languages_comment_config.yaml, webinspect.xsd). No com.fortify.cli.aviator imports.
  • Aviator-specific behavior is injected rather than hard-coded:
    • AuditTagConfig (Aviator status / expected-outcome tag ids) and FilterTemplateCustomizer (Aviator tag-definition injection).
    • AviatorSastFprParser (in aviator-common) wraps the generic SastFprParser and returns the unchanged ParsedFprData.
    • Generic audit.xml reading extracted to AuditXmlReader; AuditProcessor delegates to it.
  • Moved code throws FcliSimpleException/FcliTechnicalException/FcliBugException (the Aviator exceptions extend these). Catch sites in RemediationsApplyHelper, RemediationProcessor and AviatorStreamProcessor now catch the Fcli supertypes so behavior is preserved.
  • Wiring: gradle.properties (fcliCommonFprRef), fcli-app/build.gradle.kts, fcli-aviator-common api(project(...)); native-image reflect-config FQNs updated; .github/copilot-instructions.md module list.
  • Moved tests with their classes (parsing, filter engine, util); audit/remediation/enricher tests stay in aviator-common.

Behavior

No functional change intended. The Aviator tag config reproduces the previous FPRProcessor tag logic; LanguageCommentMapperUtil now lazy-loads its YAML if not initialized (previously returned "Unknown").

Tests

  • ./gradlew build (incl. unit tests, NativeReflectConfigTest) compiles and passes locally on a dev/v3.x base, except 3 StreamInitializationTimeoutTest tests in fcli-aviator-common that already fail on dev/v3.x without this change (missing FcliExecutionContext in the test). Only its imports were updated here for the moved classes.
  • Functional tests and native-image build are left to CI.

Decisions / out of scope

  • Proto files and generated stubs stay in fcli-aviator-common.
  • The filter package moved too (deliberate deviation from the story wording): FPRInfo, Node and StreamingFVDLProcessor depend on FilterTemplate.
  • fpr.remediation, ParsedFprData, AuditResponse, TagMappingConfig stay in Aviator.

Known limitations / follow-ups (for reviewers)

  • Not yet fully standalone: fcli-common-fpr still depends on fcli-common-core (FcliSimpleException, FcliTechnicalException, FcliBugException, SecureXmlParserFactory). It has no Aviator dependency. Removing the fcli-common-core dependency, e.g. by introducing module-local exceptions, is a candidate for a later phase if the library is to be consumed outside fcli.
  • FilterTemplateCustomizer as an out-channel: AviatorFilterTemplateCustomizer captures the filter-template DOM in a field that AviatorSastFprParser reads back after parsing (contract documented in Javadoc). A cleaner follow-up is to expose the DOM on SastFprData and make the customizer stateless. Not done here to keep this PR a behavior-preserving move.
  • util / utils packages: both exist in common.fpr because the original Aviator code already had both. Merging them is deferred to avoid extra churn and rebase conflicts.

Related / conflicts

@anishkumarnagaraj-design
anishkumarnagaraj-design changed the base branch from feat/v3.x/aviator/27.1 to dev/v3.x October 29, 2026 05:34
@anishkumarnagaraj-design
anishkumarnagaraj-design changed the base branch from dev/v3.x to feat/v3.x/aviator/27.1 October 29, 2026 05:49
Anishkumar N and others added 2 commits October 29, 2026 15:12
Move the SAST/DAST FPR parsing code out of fcli-aviator-common into a new
Aviator-independent module fcli-core/fcli-common-fpr so it can be reused by
other teams.

- New package com.fortify.cli.common.fpr.* (model, filter, processor, dast,
  util, utils, config) with its own tests and resources
- Aviator-specific behavior (Aviator status/expected-outcome tags, filter
  template tag injection) is injected via AuditTagConfig and
  FilterTemplateCustomizer; AviatorSastFprParser wraps the generic parser
- Generic audit.xml reading extracted to AuditXmlReader
- Moved code throws Fcli exceptions; Aviator catch sites updated
- Proto files, remediation, AuditProcessor and SourceCodeEnricher stay in
  fcli-aviator-common

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@anishkumarnagaraj-design
anishkumarnagaraj-design force-pushed the feat/v3.x/aviator/common-fpr-module branch from 0e2bdb1 to 78983f5 Compare October 29, 2026 09:43
@anishkumarnagaraj-design
anishkumarnagaraj-design changed the base branch from feat/v3.x/aviator/27.1 to dev/v3.x October 29, 2026 09:43
Comment thread .github/copilot-instructions.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The assessment reflects a ~95-file cross-module refactor whose behavior preservation and native-image/functional builds depend on CI verification that a human must confirm.

No open issues 🎉

What changed in this PR

This PR extracts the SAST/DAST FPR parsing code out of fcli-aviator-common into a new, Aviator-independent fcli-common-fpr module (com.fortify.cli.common.fpr.*), so the parsing library can be reused by other OpenText teams ahead of the Aviator 27.1 release. It is intended to be a behavior-preserving move: Aviator-specific concerns (status/expected-outcome tag IDs and filter-template tag injection) are now injected into the generic parser via AuditTagConfig and FilterTemplateCustomizer rather than hard-coded.

Changes:

  • New module fcli-common-fpr with model/filter/processor/dast/util/config code and resources (extensions_config.yaml, languages_comment_config.yaml, webinspect.xsd); exceptions switched to Fcli*Exception supertypes.
  • Product-specific behavior injected: generic SastFprParser/SastFprData + AuditXmlReader; Aviator wraps them via AviatorSastFprParser and AviatorFilterTemplateCustomizer, preserving prior FPRProcessor tag logic.
  • Wiring updated: gradle.properties, fcli-app refs, fcli-aviator-common api(project(...)), native-image reflect-config FQNs, and module list in copilot-instructions; tests moved with their classes.

I verified there are no dangling references to any moved class (in .java, action .yaml, or native-image .json), that fcli-common-fpr has zero com.fortify.cli.aviator.* references, that the new AuditXmlReader/AuditProcessor/AuditTagConfig wiring is consistent and behavior-preserving, and that moved resources still resolve on the unified runtime classpath. No high-confidence code defects were found; the main residual risk is that native-image and functional-test builds are left to CI.

File Description
fcli-core/​fcli-common-fpr/​** (model, filter, processor, dast, util, utils, config) New module; package renamed to com.fortify.cli.common.fpr.*, Aviator exceptions replaced by Fcli*Exception.
fcli-common-fpr/​.../​FPRProcessor.java Replaces hard-coded Aviator tag IDs with injected AuditTagConfig + FilterTemplateCustomizer; adds 2-arg (DEFAULT) constructor.
fcli-common-fpr/​.../​AuditTagConfig.java, FilterTemplateCustomizer.java, SastFprParser.java, SastFprData.java, FprConstants.java, FprYamlResourceLoader.java New product-neutral abstractions / shared constants / classpath YAML loader.
fcli-common-fpr/​.../​FilterTemplateParser.java Tag-injection logic removed; now delegates to injected customizer.
fcli-common-fpr/​.../​util/​LanguageCommentMapperUtil.java, FileTypeLanguageMapperUtil.java Lazy-load bundled YAML instead of requiring Aviator init (volatile + idempotent).
fcli-aviator-common/​.../​audit/​AviatorSastFprParser.java, audit/​processor/​AviatorFilterTemplateCustomizer.java Aviator adapters that supply tag config / filter-template DOM injection and rewrap into ParsedFprData.
fcli-aviator-common/​** (imports, Constants.java, AuditProcessor, ParsedFprData, processors, grpc, remediation) Updated to consume the new module; catch sites widened to Fcli*Exception; Constants delegates shared values to FprConstants.
fcli-aviator/​** (commands, helpers, tests) Import updates to new package names; correlate parser uses AviatorSastFprParser.
gradle.properties, fcli-app/​build.gradle.kts, fcli-aviator-common/​build.gradle.kts, fcli-common-fpr/​build.gradle.kts Wire the new module (fcliCommonFprRef, api(project(...)), snakeyaml dep).
native-image reflect-config.json (yaml, grpc) Updated FQNs for moved ExtensionsConfig/LanguagesCommentConfig.
.github/​copilot-instructions.md Documents the new module and its Aviator-independence rule.
Test files across both modules Package/import/assertion updates mirroring the move; new AviatorSastFprParserTest / AviatorFilterTemplateCustomizerTest.

Review effort: Balanced

- Rename model.Entry to FvdlExternalEntry and drop fully qualified names
- Make FprHandle validation messages generic (no scan-type-specific checks)
- Load default audit.xml from classpath resource; extract getAuditDoc
- Remove duplicate ExtensionsConfig entry from grpc/reflect-config.json

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rsenden
rsenden merged commit cb95b1a into fortify:dev/v3.x Oct 30, 2026
14 of 15 checks passed
ankit2995 pushed a commit to ankit2995/fcli that referenced this pull request Nov 23, 2026
The target branch now contains fortify#1146 itself (back-merged from dev/v3.x),
along with fortify#1145 (StreamInitializationTimeout) and fortify#1151 (FPR classes moved
to com.fortify.cli.common.fpr). Conflicts were resolved by taking the target's
version of each conflicted file and replaying only this branch's changes
made after the fortify#1146 backport (server flow control, keepalive/lock-lost
robustness, review fixes).

Correlation now creates its StreamInitializationTimeout per stream attempt,
as DAST audit already does, so a stream re-opened after SERVER_BUSY gets its
own countdown instead of inheriting the first attempt's. Both processors
close the refused attempt's timer before a busy-start retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ankit2995 pushed a commit that referenced this pull request Nov 25, 2026
…ion streams (backport of #1146 to 27.1)

Cherry-pick of 43607ce onto feat/v3.x/aviator/27.1. Conflict resolution: keep 27.1's FPR model packages (com.fortify.cli.aviator.fpr/dast; the fcli-common-fpr module from #1151 is dev-only) and drop the StreamInitializationTimeout field/test changes that depend on dev-only #1145.
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