Skip to content

Pd 1635 remove deprecated dast apis#1518

Merged
future-pirate-king merged 1 commit intodevelopfrom
PD-1635-remove-deprecated-dast-apis
Mar 10, 2025
Merged

Pd 1635 remove deprecated dast apis#1518
future-pirate-king merged 1 commit intodevelopfrom
PD-1635-remove-deprecated-dast-apis

Conversation

@avzz-19
Copy link
Copy Markdown
Contributor

@avzz-19 avzz-19 commented Jan 10, 2025

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 10, 2025

Walkthrough

This pull request removes a range of deprecated files and legacy code across adapters, components, models, serializers, styles, and tests related to device preferences and dynamic scanning. Outdated URL builders, computed properties, and enum references (now replaced with DS_DEVICE_TYPE) are eliminated. The changes also update Mirage API routes and remove unnecessary endpoints from environment configuration, resulting in a leaner codebase with fewer legacy registrations and redundant logic.

Changes

File(s) Change Summary
app/adapters/device-preference.ts
app/adapters/dynamicscan-mode.ts
app/adapters/dynamicscan-old.ts
Removed adapter classes, their URL builders, and Ember Data registrations.
app/adapters/project-available-device.ts Removed manualDevices property and nested URL construction methods; simplified URL logic.
app/components/file-details/dynamic-scan/... Removed old drawer, expiry, and proxy settings components (templates, TS, SCSS); updated device type constants.
app/components/project-preferences-old/... Removed legacy project preference components, templates, and type declarations.
app/models/device-preference.ts
app/models/dynamicscan-mode.ts
app/models/dynamicscan-old.ts
app/models/file.ts
app/enums.ts
Removed models, computed properties, dynamic status methods, and deprecated enums (DYNAMIC_STATUS, DEVICE_TYPE).
app/serializers/device-preference.js Deleted serializer extending DRFSerializer.
app/styles/_component-variables.scss and related SCSS files Removed obsolete CSS variables and styling for dynamic scan drawer components.
config/environment.js Removed endpoints for devicePreferences, dynamicShutdown, and dynamicscanMode.
mirage/config.js
mirage/factories/*
Updated API routes and factory definitions; shifted device type enum usage to DS_DEVICE_TYPE.
tests/... Removed dynamic status initializations, updated enum references, and deleted obsolete adapter/model test files; reduced assertions related to dynamic status.

Suggested reviewers

  • Praseetha-KR
  • cosmosgenius
  • Yibaebi

Poem

I'm a happy rabbit, hopping away the old,
Deleting outdated code, making our codebase bold.
Carrots of clean logic now fill every row,
As legacy files disappear like soft winter snow.
With a skip and a hop, our project feels light—
Code refreshed, clean, and shining bright!
🥕🐇

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.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm warn config production Use --omit=dev instead.
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @storybook/ember@8.4.6
npm error Found: ember-source@5.12.0
npm error node_modules/ember-source
npm error dev ember-source@"~5.12.0" from the root project
npm error peer ember-source@">= 3.28.12" from @ember-data/tracking@5.3.9
npm error node_modules/@ember-data/tracking
npm error peer @ember-data/tracking@"5.3.9" from @ember-data/model@5.3.9
npm error node_modules/@ember-data/model
npm error peer @ember-data/model@"5.3.9" from @ember-data/debug@5.3.9
npm error node_modules/@ember-data/debug
npm error @ember-data/debug@"5.3.9" from ember-data@5.3.9
npm error node_modules/ember-data
npm error 2 more (ember-cli-mirage, ember-data)
npm error peer @ember-data/tracking@"5.3.9" from @ember-data/store@5.3.9
npm error node_modules/@ember-data/store
npm error peer @ember-data/store@"5.3.9" from @ember-data/adapter@5.3.9
npm error node_modules/@ember-data/adapter
npm error @ember-data/adapter@"5.3.9" from ember-data@5.3.9
npm error node_modules/ember-data
npm error 8 more (@ember-data/debug, @ember-data/graph, ...)
npm error 1 more (ember-data)
npm error 24 more (@ember/render-modifiers, @ember/test-helpers, ...)
npm error
npm error Could not resolve dependency:
npm error peer ember-source@"~3.28.1 || ^4.0.0" from @storybook/ember@8.4.6
npm error node_modules/@storybook/ember
npm error dev @storybook/ember@"8.4.6" from the root project
npm error
npm error Conflicting peer dependency: ember-source@4.12.4
npm error node_modules/ember-source
npm error peer ember-source@"~3.28.1 || ^4.0.0" from @storybook/ember@8.4.6
npm error node_modules/@storybook/ember
npm error dev @storybook/ember@"8.4.6" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /.npm/_logs/2025-03-10T06_24_09_594Z-eresolve-report.txt
npm error A complete log of this run can be found in: /.npm/_logs/2025-03-10T06_24_09_594Z-debug-0.log


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a4f02b and 8129d01.

📒 Files selected for processing (25)
  • app/adapters/device-preference.ts (0 hunks)
  • app/adapters/dynamicscan-mode.ts (0 hunks)
  • app/adapters/dynamicscan-old.ts (0 hunks)
  • app/adapters/project-available-device.ts (0 hunks)
  • app/components/file-details/dynamic-scan/action/drawer/automated-dast/index.ts (1 hunks)
  • app/components/file-details/dynamic-scan/action/drawer/device-pref-table/type/index.ts (1 hunks)
  • app/components/file-details/dynamic-scan/drawer-old/index.hbs (0 hunks)
  • app/components/file-details/dynamic-scan/drawer-old/index.scss (0 hunks)
  • app/components/file-details/dynamic-scan/drawer-old/index.ts (0 hunks)
  • app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.hbs (0 hunks)
  • app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.scss (0 hunks)
  • app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.ts (0 hunks)
  • app/components/file-details/dynamic-scan/expiry-old/index.hbs (0 hunks)
  • app/components/file-details/dynamic-scan/expiry-old/index.scss (0 hunks)
  • app/components/file-details/dynamic-scan/expiry-old/index.ts (0 hunks)
  • app/components/file-details/scan-actions-old/manual-scan/index.scss (0 hunks)
  • app/components/project-preferences-old/device-preference/index.hbs (0 hunks)
  • app/components/project-preferences-old/device-preference/index.ts (0 hunks)
  • app/components/project-preferences-old/index.hbs (0 hunks)
  • app/components/project-preferences-old/index.ts (0 hunks)
  • app/components/project-preferences-old/provider/index.hbs (0 hunks)
  • app/components/project-preferences-old/provider/index.ts (0 hunks)
  • app/enums.ts (1 hunks)
  • app/helpers/device-type.ts (1 hunks)
  • app/models/device-preference.ts (0 hunks)
💤 Files with no reviewable changes (21)
  • app/components/project-preferences-old/index.hbs
  • app/components/file-details/dynamic-scan/expiry-old/index.scss
  • app/components/project-preferences-old/provider/index.hbs
  • app/adapters/device-preference.ts
  • app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.scss
  • app/adapters/dynamicscan-old.ts
  • app/components/file-details/dynamic-scan/drawer-old/index.scss
  • app/adapters/dynamicscan-mode.ts
  • app/components/file-details/dynamic-scan/drawer-old/index.hbs
  • app/components/file-details/dynamic-scan/expiry-old/index.hbs
  • app/components/file-details/scan-actions-old/manual-scan/index.scss
  • app/components/project-preferences-old/device-preference/index.hbs
  • app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.hbs
  • app/components/project-preferences-old/provider/index.ts
  • app/components/project-preferences-old/index.ts
  • app/adapters/project-available-device.ts
  • app/components/project-preferences-old/device-preference/index.ts
  • app/components/file-details/dynamic-scan/expiry-old/index.ts
  • app/models/device-preference.ts
  • app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.ts
  • app/components/file-details/dynamic-scan/drawer-old/index.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • app/helpers/device-type.ts
  • app/components/file-details/dynamic-scan/action/drawer/device-pref-table/type/index.ts
  • app/enums.ts
  • app/components/file-details/dynamic-scan/action/drawer/automated-dast/index.ts
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Publish to Cloudflare Pages
  • GitHub Check: Setup & Build Application
  • GitHub Check: Cloudflare Pages

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jan 10, 2025

Deploying irenestaging with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8129d01
Status: ✅  Deploy successful!
Preview URL: https://2ccec335.irenestaging.pages.dev
Branch Preview URL: https://pd-1635-remove-deprecated-da.irenestaging.pages.dev

View logs

@cypress
Copy link
Copy Markdown

cypress Bot commented Jan 10, 2025

Irene    Run #596

Run Properties:  status check failed Failed #596  •  git commit 32588d76b4 ℹ️: Merge 6564dfe2324c8d7cd4d2afc7eda12ffe885cebe9 into a554ee9848dc5e7aab239f3032c2...
Project Irene
Branch Review PD-1635-remove-deprecated-dast-apis
Run status status check failed Failed #596
Run duration 05m 12s
Commit git commit 32588d76b4 ℹ️: Merge 6564dfe2324c8d7cd4d2afc7eda12ffe885cebe9 into a554ee9848dc5e7aab239f3032c2...
Committer Avi Shah
View all properties for this run ↗︎

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

Tests for review

Failed  cypress/tests/dynamic-scan.spec.ts • 1 failed test

View Output

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

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
mirage/config.js (2)

436-438: Add mock response data for DELETE dynamicscans endpoint.

The endpoint returns an empty object. Consider adding mock response data to better simulate the API behavior.

 this.delete('/v2/dynamicscans/:id', () => {
-  return {};
+  return {
+    status: 'success',
+    message: 'Dynamic scan deleted successfully'
+  };
 });

440-442: Add mock response data for PUT dynamicscans extend endpoint.

The endpoint returns an empty object. Consider adding mock response data to better simulate the API behavior.

 this.put('/v2/dynamicscans/:id/extend', () => {
-  return {};
+  return {
+    status: 'success',
+    message: 'Dynamic scan extended successfully',
+    extended_until: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString()
+  };
 });
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6564dfe and f48653c.

📒 Files selected for processing (43)
  • app/adapters/device-preference.ts (0 hunks)
  • app/adapters/dynamicscan-mode.ts (0 hunks)
  • app/adapters/dynamicscan-old.ts (0 hunks)
  • app/adapters/project-available-device.ts (2 hunks)
  • app/components/file-details/dynamic-scan/action/drawer/device-pref-table/type/index.ts (1 hunks)
  • app/components/file-details/dynamic-scan/drawer-old/index.hbs (0 hunks)
  • app/components/file-details/dynamic-scan/drawer-old/index.scss (0 hunks)
  • app/components/file-details/dynamic-scan/drawer-old/index.ts (0 hunks)
  • app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.hbs (0 hunks)
  • app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.scss (0 hunks)
  • app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.ts (0 hunks)
  • app/components/file-details/dynamic-scan/expiry-old/index.hbs (0 hunks)
  • app/components/file-details/dynamic-scan/expiry-old/index.scss (0 hunks)
  • app/components/file-details/dynamic-scan/expiry-old/index.ts (0 hunks)
  • app/components/file-details/scan-actions-old/manual-scan/index.scss (0 hunks)
  • app/components/project-preferences-old/device-preference/index.hbs (0 hunks)
  • app/components/project-preferences-old/device-preference/index.ts (0 hunks)
  • app/components/project-preferences-old/index.hbs (0 hunks)
  • app/components/project-preferences-old/index.ts (0 hunks)
  • app/components/project-preferences-old/provider/index.hbs (0 hunks)
  • app/components/project-preferences-old/provider/index.ts (0 hunks)
  • app/enums.ts (0 hunks)
  • app/models/device-preference.ts (0 hunks)
  • app/models/dynamicscan-mode.ts (0 hunks)
  • app/models/dynamicscan-old.ts (0 hunks)
  • app/models/file.ts (0 hunks)
  • app/serializers/device-preference.js (0 hunks)
  • app/styles/_component-variables.scss (0 hunks)
  • config/environment.js (0 hunks)
  • mirage/config.js (1 hunks)
  • mirage/factories/device-preference.ts (0 hunks)
  • mirage/factories/file.ts (0 hunks)
  • mirage/factories/project.ts (1 hunks)
  • tests/acceptance/file-details-test.js (1 hunks)
  • tests/acceptance/file-details/api-scan-test.js (0 hunks)
  • tests/acceptance/file-details/manual-scan-test.js (0 hunks)
  • tests/integration/components/file-details/dynamic-scan/manual-test.js (3 hunks)
  • tests/integration/components/file-details/scan-actions/api-scan-test.js (0 hunks)
  • tests/unit/adapters/dynamicscan-mode-test.js (0 hunks)
  • tests/unit/helpers/device-type-test.js (1 hunks)
  • tests/unit/models/device-preference-test.js (0 hunks)
  • tests/unit/models/dynamicscan-mode-test.js (0 hunks)
  • tests/unit/models/file-test.js (0 hunks)
💤 Files with no reviewable changes (36)
  • mirage/factories/file.ts
  • tests/unit/adapters/dynamicscan-mode-test.js
  • tests/integration/components/file-details/scan-actions/api-scan-test.js
  • app/components/project-preferences-old/provider/index.hbs
  • app/components/file-details/dynamic-scan/expiry-old/index.scss
  • app/adapters/device-preference.ts
  • tests/unit/models/dynamicscan-mode-test.js
  • tests/unit/models/device-preference-test.js
  • tests/acceptance/file-details/api-scan-test.js
  • tests/acceptance/file-details/manual-scan-test.js
  • app/serializers/device-preference.js
  • app/components/file-details/dynamic-scan/drawer-old/index.hbs
  • app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.hbs
  • app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.scss
  • app/components/file-details/dynamic-scan/drawer-old/index.scss
  • config/environment.js
  • app/models/dynamicscan-mode.ts
  • app/adapters/dynamicscan-old.ts
  • app/components/file-details/dynamic-scan/expiry-old/index.hbs
  • app/components/project-preferences-old/device-preference/index.hbs
  • app/models/dynamicscan-old.ts
  • app/components/file-details/scan-actions-old/manual-scan/index.scss
  • app/enums.ts
  • app/adapters/dynamicscan-mode.ts
  • app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.ts
  • app/styles/_component-variables.scss
  • app/models/device-preference.ts
  • tests/unit/models/file-test.js
  • app/components/project-preferences-old/provider/index.ts
  • mirage/factories/device-preference.ts
  • app/components/project-preferences-old/index.hbs
  • app/components/file-details/dynamic-scan/drawer-old/index.ts
  • app/components/project-preferences-old/index.ts
  • app/components/project-preferences-old/device-preference/index.ts
  • app/components/file-details/dynamic-scan/expiry-old/index.ts
  • app/models/file.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • app/components/file-details/dynamic-scan/action/drawer/device-pref-table/type/index.ts
  • mirage/factories/project.ts
  • tests/unit/helpers/device-type-test.js
  • tests/integration/components/file-details/dynamic-scan/manual-test.js
  • app/adapters/project-available-device.ts
  • tests/acceptance/file-details-test.js
⏰ Context from checks skipped due to timeout of 90000ms (12)
  • GitHub Check: Run Integration Tests - Part 8
  • GitHub Check: Run Integration Tests - Part 7
  • GitHub Check: Run Integration Tests - Part 6
  • GitHub Check: Run Integration Tests - Part 5
  • GitHub Check: Run Integration Tests - Part 4
  • GitHub Check: Run Integration Tests - Part 3
  • GitHub Check: Run Integration Tests - Part 2
  • GitHub Check: Run Integration Tests - Part 1
  • GitHub Check: Run Acceptance Tests
  • GitHub Check: Run Unit Tests
  • GitHub Check: Run Linting
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
mirage/config.js (1)

28-28: LGTM! Good API versioning practice.

The v2 API endpoints are properly grouped together as noted in the comment, maintaining a clean and organized structure.

Also applies to: 432-442

Comment thread app/adapters/project-available-device.ts Outdated
Comment thread app/models/file.ts
Comment thread mirage/factories/project.ts Outdated
@avzz-19 avzz-19 force-pushed the PD-1635-remove-deprecated-dast-apis branch from a9959f9 to a67b57a Compare March 6, 2025 13:00
@avzz-19 avzz-19 force-pushed the PD-1635-remove-deprecated-dast-apis branch from 0a4f02b to 8129d01 Compare March 10, 2025 06:22
@sonarqubecloud
Copy link
Copy Markdown

@future-pirate-king future-pirate-king merged commit 990a5d4 into develop Mar 10, 2025
@future-pirate-king future-pirate-king deleted the PD-1635-remove-deprecated-dast-apis branch March 10, 2025 08:47
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