Skip to content

Conversation

@zabelin-vladimir
Copy link

No description provided.

@zabelin-vladimir zabelin-vladimir requested a review from a team as a code owner November 28, 2025 16:04
Copilot AI review requested due to automatic review settings November 28, 2025 16:04
Copilot finished reviewing on behalf of zabelin-vladimir November 28, 2025 16:06
Copy link
Contributor

Copilot AI left a comment

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 a new GitHub Actions workflow to run ESLint security scanning on the DevExtreme monorepo. The workflow is designed to scan JavaScript and TypeScript files for security vulnerabilities using a custom ESLint security configuration (@devexpress/eslint-security-config). The scan runs on pull requests and can be manually triggered, generating an HTML report as an artifact.

Key changes:

  • New workflow file that runs security-focused ESLint rules
  • Isolated ESLint configuration in .github/eslint/ with its own dependencies
  • Custom HTML formatter for security scan results
  • Configuration to use private package registry for @devexpress/eslint-security-config

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
.github/workflows/eslint-security.yml Main workflow definition that triggers on PR changes to JS/TS files; runs ESLint with security rules and uploads HTML report
.github/eslint/security.config.mjs ESLint configuration that applies security rules, disables inline config in CI, and loads ignore patterns
.github/eslint/package.json Isolated npm package with ESLint 9.x, TypeScript-ESLint 8.x, and custom security config as dependencies
.github/eslint/package-lock.json Lockfile for the isolated ESLint environment ensuring reproducible builds
.github/eslint/only-problems-html.mjs Custom ESLint formatter that generates an HTML report showing only files with security issues
.github/eslint/targets.txt Specifies which files/directories to scan (currently set to ** - all files)
.github/eslint/ignore-security.txt Empty file for defining paths to exclude from security scanning
.github/eslint/.npmrc Configuration for authenticating with GitHub Packages to access private security config

ignores: [
'**/node_modules/**',
...extraIgnores,
],
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Trailing whitespace detected after the closing brace on line 26. This should be removed for consistency and to avoid linting issues.

Suggested change
],
],

Copilot uses AI. Check for mistakes.
workflow_dispatch:
pull_request:
paths:
- '.github/eslint/**'
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Trailing whitespace detected after .github/eslint/**. This should be removed for consistency.

Suggested change
- '.github/eslint/**'
- '.github/eslint/**'

Copilot uses AI. Check for mistakes.
- '.github/eslint/**'
- '**/*.ts'
- '**/*.js'

Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The workflow is missing the concurrency configuration that is present in other workflows like lint.yml. Without this, multiple runs of this security scan could execute simultaneously on the same PR, wasting resources. Consider adding:

concurrency:
  group: wf-${{github.event.pull_request.number || github.sha}}-${{github.workflow}}
  cancel-in-progress: true
Suggested change
concurrency:
group: wf-${{github.event.pull_request.number || github.sha}}-${{github.workflow}}
cancel-in-progress: true

Copilot uses AI. Check for mistakes.
Comment on lines 33 to 34
cache: npm
cache-dependency-path: .github/eslint/package-lock.json
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Using cache: npm when the repository uses pnpm is incorrect. Other workflows in this repository use pnpm with proper caching setup (see lint.yml). This should use pnpm's action-setup and cache the pnpm store directory instead:

- uses: pnpm/action-setup@v4
  with:
    run_install: false

- name: Get pnpm store directory
  shell: bash
  run: |
    echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
  name: Setup pnpm cache
  with:
    path: ${{ env.STORE_PATH }}
    key: ${{ runner.os }}-pnpm-store-${{ hashFiles('.github/eslint/package-lock.json') }}

Copilot uses AI. Check for mistakes.
VM_MEMORY: 18144
VM_CPU: 16
SECURITY_LINT: "1"
runs-on: farm
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Using runs-on: farm is inconsistent with other workflows in this repository which use devextreme-shr2 as the runner. This should be aligned with the repository's standard runner configuration for consistency and to ensure the appropriate environment is used.

Suggested change
runs-on: farm
runs-on: devextreme-shr2

Copilot uses AI. Check for mistakes.
@@ -0,0 +1 @@
** No newline at end of file
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Targeting ** will scan the entire repository including node_modules, build artifacts, test files, and other directories that shouldn't be security linted. This will cause extremely long execution times and produce irrelevant results. You should specify only the source code directories that need security scanning, such as:

packages/*/js/**
packages/*/src/**
apps/*/src/**

Additionally, consider excluding test files and build artifacts explicitly.

Suggested change
**
# Include only relevant source code directories for linting/scanning
packages/*/js/**
packages/*/src/**
apps/*/src/**
# Exclude test files and build artifacts
!**/test*/**
!**/tests/**
!**/testing/**
!**/build/**
!**/artifacts/**
!**/dist/**
!**/node_modules/**

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +26
ignores: [
'**/node_modules/**',
...extraIgnores,
],
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Inconsistent indentation: lines 23-26 use tabs while the rest of the file uses spaces. This should be consistent throughout the file.

Suggested change
ignores: [
'**/node_modules/**',
...extraIgnores,
],
ignores: [
'**/node_modules/**',
...extraIgnores,
],

Copilot uses AI. Check for mistakes.
"private": true,
"type": "module",
"devDependencies": {
"@devexpress/eslint-security-config": "^0.1.0",
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Inconsistent indentation: line 6 uses tabs while lines 7-10 use spaces. This should be consistent throughout the file.

Suggested change
"@devexpress/eslint-security-config": "^0.1.0",
"@devexpress/eslint-security-config": "^0.1.0",

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings December 1, 2025 13:40
Copilot finished reviewing on behalf of zabelin-vladimir December 1, 2025 13:41
Copy link
Contributor

Copilot AI left a comment

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 6 out of 8 changed files in this pull request and generated 3 comments.

Comment on lines +44 to +48
mapfile -t TARGETS < <(
sed 's/^[[:space:]]*//;s/[[:space:]]*$//' .github/eslint/targets.txt \
| grep -vE '^\s*#' \
| sed '/^\s*$/d'
)
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

The mapfile command is Bash 4+ specific and may not be available on all systems. Consider adding a shebang #!/usr/bin/env bash at the start of the script or using a more portable approach with while read loop for better compatibility.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +2
export default function(results, _context) {
const esc = (s) => String(s).replace(/[&<>"']/g, m => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[m]));
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

The HTML escape function doesn't handle all potential XSS vectors. While basic HTML entities are escaped, consider using a well-tested library or ensuring all user-controlled data (file paths, messages, rule IDs) are properly escaped. The current implementation is adequate for the basic cases but could be more robust.

Suggested change
export default function(results, _context) {
const esc = (s) => String(s).replace(/[&<>"']/g, m => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[m]));
import escapeHtml from 'escape-html';
export default function(results, _context) {
const esc = escapeHtml;

Copilot uses AI. Check for mistakes.
Comment on lines 30 to 38
cache: npm
cache-dependency-path: .github/eslint/package-lock.json

- name: Install security lint dependencies
working-directory: .github/eslint
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm ci
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

The cache strategy should use pnpm instead of npm to match the repository's package manager. According to the repository guidelines, DevExtreme uses pnpm 9.15.4 as its package manager.

Suggested change
cache: npm
cache-dependency-path: .github/eslint/package-lock.json
- name: Install security lint dependencies
working-directory: .github/eslint
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm ci
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install security lint dependencies
working-directory: .github/eslint
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm install --frozen-lockfile

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings December 1, 2025 14:11
Copilot finished reviewing on behalf of zabelin-vladimir December 1, 2025 14:12
Copy link
Contributor

Copilot AI left a comment

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 6 out of 8 changed files in this pull request and generated 1 comment.

code=$?
set -e
code=$?
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

Redundant variable assignment. Line 60 captures the exit code after set +e, but line 63 reassigns code=$? after set -e, which will always be 0 (the exit code of the successful set -e command itself). Remove line 63 to preserve the ESLint exit code.

Suggested change
code=$?

Copilot uses AI. Check for mistakes.
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.

1 participant