v2 Migration: qualys - #18
Conversation
- Convert integration.js to TypeScript (src/integration.ts) - Replace postman-request with polarity-integration-utils - Convert Ember/Handlebars component to Lit web component (web-components/details.ts) - Update config.json (runtimeVersion 2, dataTypes, webComponents) - Fix credential leakage in error logging (security review) - Sanitize parseErrorToReadableJSON to strip auth from serialized errors - Remove v1 files (integration.js, config/config.js, components/, templates/, styles/) - Version 4.0.0 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Migrates the Qualys integration from the v1 Ember/CommonJS structure to a v2 TypeScript runtime with Lit-based web components, Vite build tooling, and updated integration metadata.
Changes:
- Replaces v1 integration entrypoints/templates/styles with TypeScript server code and a new Lit details component.
- Adds v2 build, lint, format, and Vitest/Vite configuration.
- Updates package metadata, config, workflows, license, and documentation references for the v2 migration.
Reviewed changes
Copilot reviewed 42 out of 49 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| web-components/details.ts | Adds the v2 Lit details renderer. |
| vitest.config.ts | Adds server/browser Vitest projects. |
| vite.config.js | Adds Vite web component build config. |
| tsconfig.web.json | Adds TypeScript config for web components. |
| tsconfig.json | Adds TypeScript config for server code. |
| test/web-components/details.test.ts | Adds placeholder browser test. |
| test/integration.test.ts | Adds placeholder server test. |
| templates/block.hbs | Removes v1 Ember template. |
| styles/styles.less | Removes v1 styles. |
| src/validateOptions.ts | Adds TypeScript option validation. |
| src/validateOptions.js | Removes CommonJS validation module. |
| src/querying/queryVulnerabilitiesForAllEntities.ts | Adds TypeScript vulnerability query helper. |
| src/querying/queryVulnerabilitiesForAllEntities.js | Removes CommonJS vulnerability query helper. |
| src/querying/queryHostDetectionListForAllEntities.ts | Adds TypeScript host detection querying. |
| src/querying/queryHostDetectionListForAllEntities.js | Removes CommonJS host detection querying. |
| src/querying/queryAssetsForAllEntities.ts | Adds TypeScript asset query helper. |
| src/querying/queryAssetsForAllEntities.js | Removes CommonJS asset query helper. |
| src/integration.ts | Adds v2 startup, lookup, and validation exports. |
| src/getLookupResults.ts | Adds TypeScript lookup orchestration. |
| src/getLookupResults.js | Removes CommonJS lookup orchestration. |
| src/getDisplayResults.ts | Adds TypeScript display formatting. |
| src/getDisplayResults.js | Removes CommonJS display formatting. |
| src/dataTransformations.ts | Adds TypeScript transformation utilities. |
| src/dataTransformations.js | Removes CommonJS transformation utilities. |
| src/createRequestWithDefaults.js | Removes v1 request wrapper. |
| src/createLookupResults.ts | Adds TypeScript lookup result formatting. |
| src/createLookupResults.js | Removes CommonJS lookup result formatter. |
| src/constants.ts | Converts constants to TypeScript exports. |
| src/associateDataWithEntities.ts | Adds TypeScript entity/data association. |
| src/associateDataWithEntities.js | Removes CommonJS association helper. |
| README.md | Updates image path. |
| package.json | Updates runtime entrypoint, dependencies, and scripts. |
| LICENSE | Updates license text. |
| integration.js | Removes v1 root integration entrypoint. |
| eslint.config.mjs | Adds ESLint flat config. |
| config/config.json | Updates integration metadata for v2. |
| config/config.js | Removes v1 JS config. |
| components/block.js | Removes v1 Ember component. |
| .prettierrc | Updates formatting width. |
| .prettierignore | Adds ignored paths. |
| .npmrc | Adds legacy peer dependency install behavior. |
| .gitignore | Ignores build output. |
| .github/workflows/run-int-dev-checklist.yml | Updates checklist workflow. |
| .github/workflows/release-current-version.yml | Updates release workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| text=${link.capitalize ? capitalizeStr(link.id) : link.id} | ||
| no-icon | ||
| ></pi-external-link | ||
| >${i < links.length - 1 ? html`<span class="link-separator">, </span>` : nothing} |
There was a problem hiding this comment.
Agree — implemented. Restructured the Lit template so the closing </pi-external-link> bracket stays on the same line as the tag name, preventing the stray > from rendering as text. Added a prettier-ignore comment to prevent the formatter from splitting it back across lines.
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' |
There was a problem hiding this comment.
Disagree — not implemented. This file is generated and managed by the ICL toolchain (icl upgrade). Changes to ICL-managed files should be made upstream in the ICL tool itself, not in individual integrations.
The closing tag </pi-external-link was split across two lines, causing a literal > to render after each external link in link lists. Restructure the template so the closing bracket stays on the same line as the tag name, and add a prettier-ignore comment to prevent reformatting. Addresses PR review feedback for #18 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
sarus
left a comment
There was a problem hiding this comment.
Addressing PR review feedback — 1 fix implemented, 1 comment on ICL-managed file declined.
Server tests (17): - startup initialization - doLookup with valid host detection results - doLookup returning null for empty/miss results - Multiple entity handling - Ignored IP filtering (127.0.0.1, etc.) - Request options verification - Error propagation (API errors, non-Error throws) - QID custom type entity support - validateOptions for all fields and URL validation Web component tests (16): - Renders host detection data correctly - Handles empty/undefined details gracefully - Key-value pair rendering - Title fields with showLabelAndValue - Date formatting - Collapsible list items (collapsed by default) - HTML content in expandable sections - Copy button presence - Section breaks - Single tab vs multi-tab rendering - Empty tab filtering - Copyable fields with copy button - External links via pi-external-link - List of links rendering Also adds resolve aliases to vitest.config.ts to fix polarity-integration-utils ESM resolution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
v1 → v2 Migration
Repository:
qualysLinear Ticket: INT-1886
This PR was generated by the Polarity Integration Upgrade CLI.