Skip to content

Feature/dast fairplay ios17 gate - #1687

Draft
sammyjeng wants to merge 1 commit into
developfrom
feature/dast-fairplay-ios17-gate
Draft

Feature/dast fairplay ios17 gate#1687
sammyjeng wants to merge 1 commit into
developfrom
feature/dast-fairplay-ios17-gate

Conversation

@sammyjeng

@sammyjeng sammyjeng commented May 26, 2026

Copy link
Copy Markdown
Contributor

Frontend gate for the FairPlay iOS 17+ DAST block

  • Add canStartDast, dastBlockedReason, and dastBlockedMessage attributes to the file model.
  • When the backend reports canStartDast=false, disable the start / schedule-automation button in the dynamic scan drawer and wrap it in a tooltip showing dastBlockedMessage.
  • Add the new fields to the mirage file factory and an integration test covering the disabled state and tooltip.

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 48bc41a7-5694-4aae-a194-80b03d09ffbf

📥 Commits

Reviewing files that changed from the base of the PR and between 8148a81 and 80698fb.

📒 Files selected for processing (6)
  • app/components/file-details/dynamic-scan/action/drawer/index.hbs
  • app/components/file-details/dynamic-scan/action/drawer/index.scss
  • app/components/file-details/dynamic-scan/action/drawer/index.ts
  • app/models/file.ts
  • mirage/factories/file.ts
  • tests/integration/components/file-details/dynamic-scan/manual-test.js
✅ Files skipped from review due to trivial changes (2)
  • app/models/file.ts
  • app/components/file-details/dynamic-scan/action/drawer/index.scss
🚧 Files skipped from review as they are similar to previous changes (4)
  • mirage/factories/file.ts
  • tests/integration/components/file-details/dynamic-scan/manual-test.js
  • app/components/file-details/dynamic-scan/action/drawer/index.hbs
  • app/components/file-details/dynamic-scan/action/drawer/index.ts

Walkthrough

Adds backend-driven DAST gating: new file attributes indicate whether DAST can start and provide a blocked message; the component short-circuits start enablement when blocked; the template wraps the start button in a tooltip showing the backend message when blocked; styles and an integration test were added.

Changes

DAST Backend Blocking Feature

Layer / File(s) Summary
Data model and test factory
app/models/file.ts, mirage/factories/file.ts
FileModel adds canStartDast: boolean, `dastBlockedReason: string
Component getters, template tooltip, and styles
app/components/file-details/dynamic-scan/action/drawer/index.ts, app/components/file-details/dynamic-scan/action/drawer/index.hbs, app/components/file-details/dynamic-scan/action/drawer/index.scss
Component adds isDastBlockedByBackend and startDynamicScanDisabledReason getters and updates enableStartDynamicScanBtn to return false when blocked. Template wraps the start button in an AkTooltip enabled when blocked to surface the blocking message. New .start-btn-disabled-tooltip-content style sets tooltip width and wrapping.
Integration test for disabled start behavior
tests/integration/components/file-details/dynamic-scan/manual-test.js
New test configures file.canStartDast=false with a dastBlockedMessage, opens the manual dynamic-scan drawer, asserts the start button is disabled, and verifies the tooltip shows the blocking message.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • appknox/irene#1683: Modifies the same dynamic-scan action drawer start-button enablement logic related to device availability; adjacent to this PR's backend-blocking gating.

Suggested reviewers

  • SmitGala
  • Yibaebi
  • avzz-19

Poem

🐰 I wriggle by the drawer's light,
A tiny tooltip holds the night.
The backend says the scan must wait,
I whisper why — a gentle state.
Hop on, read the message, then all's right. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title refers to a real aspect of the change (FairPlay iOS17 DAST gating), but it's abbreviated and unclear for someone unfamiliar with the project context, and does not clearly summarize the main user-facing change from the description. Consider a more descriptive title like 'Disable DAST when backend reports FairPlay iOS17+ block' to clearly indicate the main change to new reviewers.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly relates to the changeset, outlining the backend gating mechanism, UI changes, and test coverage for the FairPlay iOS17+ DAST blocking feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/dast-fairplay-ios17-gate

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Stylelint (17.12.0)
app/components/file-details/dynamic-scan/action/drawer/index.scss

AllFilesIgnoredError: All input files were ignored because of the ignore pattern. Either change your input, ignore pattern or use "--allow-empty-input" to allow no inputs
at standalone (file:///usr/local/lib/node_modules/stylelint/lib/standalone.mjs:322:43)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (2)
app/components/file-details/dynamic-scan/action/drawer/index.hbs (1)

71-117: ⚖️ Poor tradeoff

Consider eliminating the duplicated button definition.

The AkButton component is rendered identically in both branches of the conditional (lines 84-99 and 103-116), which violates DRY principles and creates maintenance risk. If button props or content change, they must be updated in both places.

Consider refactoring to render the button once and conditionally wrap it in the tooltip only when blocked.

♻️ Refactoring approach

One pattern would be to extract the button to a local {{#let}} block or render it conditionally wrapped:

{{`#let` (component "AkButton" 
  click=this.runDynamicScan
  loading=this.startDynamicScan.isRunning
  disabled=(not this.enableStartDynamicScanBtn)
  data-test-fileDetails-dynamicScanDrawer-startBtn=true
) as |StartButton|}}
  {{`#if` this.isDastBlockedByBackend}}
    <AkTooltip `@arrow`={{true}} `@placement`='top'>
      <:tooltipContent>
        <div local-class='start-btn-disabled-tooltip-content'>
          {{this.startDynamicScanDisabledReason}}
        </div>
      </:tooltipContent>
      <:default><StartButton>...</StartButton></:default>
    </AkTooltip>
  {{else}}
    <StartButton>...</StartButton>
  {{/if}}
{{/let}}

This ensures the button definition stays synchronized.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/components/file-details/dynamic-scan/action/drawer/index.hbs` around
lines 71 - 117, Duplicate AkButton markup is rendered in both branches; extract
the button into a single reusable element and only conditionally wrap it with
AkTooltip when this.isDastBlockedByBackend. Move the AkButton props/children
(click=this.runDynamicScan, `@loading`=this.startDynamicScan.isRunning,
`@disabled`=(not this.enableStartDynamicScanBtn), leftIcon with AkIcon using
`@isAutomatedScan`, and the translated label) into one place (e.g., a local
{{`#let`}} component or an inline partial), then render that single StartButton
inside AkTooltip when isDastBlockedByBackend and directly otherwise, keeping the
tooltip content sourced from this.startDynamicScanDisabledReason.
app/models/file.ts (1)

55-56: 💤 Low value

Consider adding an explicit default value for clarity.

The canStartDast attribute works correctly without a default (undefined will not equal false in the component check), but adding defaultValue: true would make the intended behavior more explicit and prevent potential confusion.

📝 Suggested enhancement
-  `@attr`('boolean')
+  `@attr`('boolean', { defaultValue: true })
   declare canStartDast: boolean;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/models/file.ts` around lines 55 - 56, The canStartDast attribute on the
model should have an explicit default to make intended behavior clear; update
the `@attr`('boolean') declaration for canStartDast to include defaultValue: true
so the model property is initialized true by default (locate the canStartDast
attribute in the file model declaration to modify).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@app/components/file-details/dynamic-scan/action/drawer/index.hbs`:
- Around line 71-117: Duplicate AkButton markup is rendered in both branches;
extract the button into a single reusable element and only conditionally wrap it
with AkTooltip when this.isDastBlockedByBackend. Move the AkButton
props/children (click=this.runDynamicScan,
`@loading`=this.startDynamicScan.isRunning, `@disabled`=(not
this.enableStartDynamicScanBtn), leftIcon with AkIcon using `@isAutomatedScan`,
and the translated label) into one place (e.g., a local {{`#let`}} component or an
inline partial), then render that single StartButton inside AkTooltip when
isDastBlockedByBackend and directly otherwise, keeping the tooltip content
sourced from this.startDynamicScanDisabledReason.

In `@app/models/file.ts`:
- Around line 55-56: The canStartDast attribute on the model should have an
explicit default to make intended behavior clear; update the `@attr`('boolean')
declaration for canStartDast to include defaultValue: true so the model property
is initialized true by default (locate the canStartDast attribute in the file
model declaration to modify).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b00a5a03-4df7-46cf-a889-d60664f6199f

📥 Commits

Reviewing files that changed from the base of the PR and between 0957250 and 8148a81.

📒 Files selected for processing (6)
  • app/components/file-details/dynamic-scan/action/drawer/index.hbs
  • app/components/file-details/dynamic-scan/action/drawer/index.scss
  • app/components/file-details/dynamic-scan/action/drawer/index.ts
  • app/models/file.ts
  • mirage/factories/file.ts
  • tests/integration/components/file-details/dynamic-scan/manual-test.js

@cypress

cypress Bot commented May 26, 2026

Copy link
Copy Markdown

Irene    Run #841

Run Properties:  status check failed Failed #841  •  git commit 98f4bd685d ℹ️: Merge 8148a81452f2be26b629196824c77be001108911 into 0957250ce708077efd2180338d8f...
Project Irene
Branch Review feature/dast-fairplay-ios17-gate
Run status status check failed Failed #841
Run duration 02m 46s
Commit git commit 98f4bd685d ℹ️: Merge 8148a81452f2be26b629196824c77be001108911 into 0957250ce708077efd2180338d8f...
Committer Samartha J V
View all properties for this run ↗︎

Test results
Tests that failed  Failures 2
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 1
Tests that did not run due to a failure in a mocha hook  Skipped 7
Tests that passed  Passing 22
View all changes introduced in this branch ↗︎

Tests for review

Failed  ignore-vulnerability.spec.ts • 1 failed test

View Output

Test Artifacts
Ignore Vulnerability > It ignores vulnerability from Risk --> Passed (CRITERIA: "current file") (RESET: for "Current File Only") Test Replay Screenshots
Failed  dynamic-scan.spec.ts • 1 failed test

View Output

Test Artifacts
Dynamic Scan > it tests dynamic scan for an apk file: 132571 Test Replay Screenshots

Comment thread app/components/file-details/dynamic-scan/action/drawer/index.hbs Outdated
Expose canStartDast, dastBlockedReason, and dastBlockedMessage on the file model so the dynamic scan drawer can rely on the backend eligibility verdict.

Disable the Start button when DAST is blocked, show the backend-provided reason in the disabled-state tooltip, and keep the button markup centralized under a disabled AkTooltip wrapper.

Add Mirage defaults and an integration test for the blocked start state.
@sammyjeng
sammyjeng force-pushed the feature/dast-fairplay-ios17-gate branch from 8148a81 to 80698fb Compare June 2, 2026 14:00
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 2, 2026

Copy link
Copy Markdown

Deploying irenestaging with  Cloudflare Pages  Cloudflare Pages

Latest commit: 80698fb
Status: ✅  Deploy successful!
Preview URL: https://36d66e6c.irenestaging.pages.dev
Branch Preview URL: https://feature-dast-fairplay-ios17.irenestaging.pages.dev

View logs

@sonarqubecloud

sonarqubecloud Bot commented Jun 2, 2026

Copy link
Copy Markdown

@Yibaebi Yibaebi 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.

LGTM!

@sammyjeng
sammyjeng marked this pull request as draft June 4, 2026 13:09
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