Skip to content

ROX-33387: Add rootDir in cypress tsconfig file#19220

Merged
pedrottimark merged 1 commit intomasterfrom
ROX-33387-cypress-tsconfig-rootDir
Feb 27, 2026
Merged

ROX-33387: Add rootDir in cypress tsconfig file#19220
pedrottimark merged 1 commit intomasterfrom
ROX-33387-cypress-tsconfig-rootDir

Conversation

@pedrottimark
Copy link
Contributor

@pedrottimark pedrottimark commented Feb 26, 2026

Description

Problem

File '/stackrox/stackrox/ui/apps/platform/cypress/constants/GeneralPage.js' is not under 'rootDir' '/Users/mark/go/src/github.com/stackrox/stackrox/ui/apps/platform/src'. 'rootDir' is expected to contain all source files.
The file is in the program because:
Matched by include pattern './**/*.js' in '/Users/mark/go/src/github.com/stackrox/stackrox/ui/apps/platform/cypress/tsconfig.json'

Analysis

https://devblogs.microsoft.com/typescript/announcing-typescript-6-0-beta/#rootdir-now-defaults-to-.

In TypeScript 6.0, the default rootDir will always be the directory containing the tsconfig.json file. rootDir will only be inferred when using tsc from the command line without a tsconfig.json file.

Advice that I followed in #19161

Set "rootDir": "./src" if you were previously relying on this being inferred.

That is good as far as it goes, except cypress folder has tsconfig.json file that inherits from the parent configuration file:

  1. Therefore it inherits "rootDir": "./src" property which does not include the files in cypress folder.

  2. Futhermore its includes property includes (pardon pun) files outside the cypress folder: "../node_modules/cypress", "../cypress.d.ts"

Solution

Add "rootDir": ".." property to cypress tsconfig.json file.

User-facing documentation

  • CHANGELOG.md update is not needed
  • documentation PR is not needed

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

  1. npm run tsc in ui/apps/platform folder.
  2. npm run lint:fast-dev in ui/apps/platform folder.
  3. See change from presence to absense of errors in Visual Studio Code.

@pedrottimark pedrottimark requested a review from a team as a code owner February 26, 2026 21:38
@rhacs-bot
Copy link
Contributor

Images are ready for the commit at a3c37c4.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-193-ga3c37c4bf7.

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.56%. Comparing base (2862869) to head (a3c37c4).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19220      +/-   ##
==========================================
- Coverage   49.56%   49.56%   -0.01%     
==========================================
  Files        2675     2675              
  Lines      201838   201838              
==========================================
- Hits       100038   100035       -3     
- Misses      94343    94345       +2     
- Partials     7457     7458       +1     
Flag Coverage Δ
go-unit-tests 49.56% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pedrottimark pedrottimark merged commit 9df4c3a into master Feb 27, 2026
94 checks passed
@pedrottimark pedrottimark deleted the ROX-33387-cypress-tsconfig-rootDir branch February 27, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants