forked from compiler-explorer/compiler-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] main from compiler-explorer:main #511
New issue
Have a ques 8000 tion about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pull
wants to merge
1,066
commits into
H1d3r:main
Choose a base branch
from
compiler-explorer:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+119,809
−35,688
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Summary This PR significantly improves type safety for GoldenLayout configurations, continuing work from issue #4490 "The War of The Types". This is an **incremental improvement** that establishes a solid foundation for future work. ## ✅ What We've Accomplished ### Core Type Infrastructure - **Created comprehensive type system** in `static/components.interfaces.ts` - **Added `ComponentConfig<K>`** with proper generic constraints for type-safe component configurations - **Added `GoldenLayoutConfig`** to replace unsafe `any[]` content with strongly-typed `ItemConfig[]` - **Created `ComponentStateMap`** mapping component names to their expected state types - **Added proper TypeScript component name constants** with `as const` for literal type inference ### Component Configuration Type Safety - **All component factory functions** now return strongly-typed configurations - **Clean type syntax**: `ComponentConfig<'compiler'>` using the exported constants - **Eliminated unsafe casts** in component creation and drag source setup - **Fixed hub method signatures** that incorrectly expected `ContentItem` instead of `ItemConfig` ### Bug Fixes and Code Quality - **Fixed Jeremy's TODO**: Improved `fixBugsInConfig` function typing - **Discovered and fixed hub type bug**: `addAtRoot`/`addInEditorStackIfPossible` now accept correct types - **Removed legacy conversion functions** that were no longer needed - **Replaced verbose TODO comments** with GitHub issue references for better organization ### Documentation and Planning - **Created GitHub issues** [#7807](#7807) and [#7808](#7808) for remaining work - **Documented type safety approach** with clear explanations of design decisions - **Added comprehensive implementation notes** for future contributors ## 🚧 What's Next (GitHub Issues) - **Issue #7807**: [Type-safe serialization/deserialization](#7807) - localStorage persistence and URL sharing - SerializedLayoutState implementation - Version migration support - **Issue #7808**: [Configuration validation and remaining type gaps](#7808) - Enable `fromGoldenLayoutConfig` validation - Fix upstream GoldenLayout TypeScript definitions - State type normalization (addresses #4490) ## 📊 Impact ### Type Safety Improvements - **No more `any` casts** in component configuration creation - **Compile-time validation** of component names and state types - **Better IDE support** with autocomplete and type checking - **Runtime safety** through proper TypeScript interfaces ### Code Quality - **~100 lines of verbose TODO comments** replaced with concise GitHub issue references - **Technical debt reduction** through elimination of unsafe casting patterns - **Improved maintainability** with centralized type definitions - **Better error messages** when component configurations are incorrect ### Files Modified - `static/components.interfaces.ts` - Core type definitions - `static/components.ts` - Component factory functions and utilities - `static/main.ts` - Layout initialization and configuration handling - `static/hub.ts` - Fixed method signatures - `static/panes/*.ts` - Updated component creation patterns ## ✅ Testing & Validation - **All existing tests pass** - no runtime regressions - **TypeScript compilation succeeds** with strict type checking - **Linting passes** with no new warnings - **Pre-commit hooks validated** all changes - **Manual testing confirmed** layout functionality works correctly ## 🎯 Ready to Merge This PR represents a **significant incremental improvement** that: - ✅ **Provides immediate value** through better type safety - ✅ **Maintains full backward compatibility** - ✅ **Establishes solid foundation** for future improvements - ✅ **Centralizes remaining work** in well-documented GitHub issues - ✅ **Ready for production use** with no runtime changes The remaining work is clearly tracked in the linked GitHub issues and can be tackled incrementally in future PRs. 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>
## Summary - Replace broken regex filter with proper `beforeSend` handler for Monaco Editor errors - Fixes noise from Monaco Editor hit testing bug in Firefox (190K+ occurrences) - Uses structured stack frame checking instead of string parsing ## Root Cause COMPILER-EXPLORER-AXA was caused by a known Monaco Editor bug in Firefox where hit testing fails with null reference errors during mouse operations. The existing regex filter `/i is null _doHitTestWithCaretPositionFromPoint/` was ineffective because Sentry's `ignoreErrors` only matches error messages, not stack traces. ## Solution Added a `beforeSend` callback that: - Checks if the top stack frame function is `_doHitTestWithCaretPositionFromPoint` - Filters out any error thrown directly from this Monaco Editor function - Uses Sentry's structured stack frames for reliable detection ## References - Fixes Sentry issue: COMPILER-EXPLORER-AXA (190K+ occurrences) - Related Monaco Editor bug: microsoft/monaco-editor#4527 ## Test plan - [x] TypeScript checks pass - [x] Test suite passes - [x] Pre-commit hooks pass 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
## Summary - Fixes unhandled promise rejections being logged as "Non-Error capture" in Sentry issue COMPILER-EXPLORER-BT9 - Converts all promise rejections to use proper Error objects instead of plain objects/strings/undefined - Adds defensive handling in Sentry's unhandled rejection listener ## Root Cause The Sentry issue was caused by services rejecting promises with non-Error objects: - `CompilerService.handleRequestError()` rejected with `{request, error}` plain objects - Various other services rejected with strings or undefined values - These triggered the global unhandled rejection handler, which logged them as "Non-Error capture" ## Changes Made 1. **CompilerService**: Modified `handleRequestError()` to reject with Error objects while preserving request context 2. **Sentry**: Enhanced unhandled rejection handler to defensively convert non-Error reasons to Error objects 3. **MultifileService**: Changed string rejections to Error objects 4. **SharingService**: Added descriptive Error objects for link failures 5. **TreePane**: Used Error objects for user cancellation scenarios 6. **CfgView**: Used Error objects for canvas blob creation failures ## Test Plan - [x] TypeScript compilation passes - [x] All tests pass (npm run test-min) - [x] Linter passes - [x] Pre-commit h 8000 ooks validated ## Impact - Reduces Sentry noise from "Non-Error capture" events - Provides better stack traces for debugging - Maintains backwards compatibility (consuming code handles both Error objects and other types) - More robust error handling throughout the application 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>
…XPLORER-CGQ (#7831) ## Summary - Adds `beforeSend` filter to suppress Monaco Editor clipboard cancellation errors from Sentry - Specifically targets "Canceled: Canceled" errors from `monaco-editor/esm/vs/platform/clipboard/browser/clipboardService.js` - Fixes Sentry issue COMPILER-EXPLORER-CGQ which has 20,139+ occurrences but 0 user impact ## Problem The Monaco Editor clipboard service generates cancellation errors when clipboard operations are interrupted (e.g., user navigates away during copy operation). These represent expected behavior rather than actionable bugs, but were creating noise in Sentry with thousands of error reports. ## Solution Following the pattern established in PR #7830, this adds a `beforeSend` filter that: 1. Checks if the error message is "Canceled: Canceled" 2. Verifies the stack trace contains the Monaco clipboard service file 3. Filters out the error if both conditions are met ## Test Plan - [x] TypeScript compilation passes (`npm run ts-check`) - [x] Linting passes (`npm run lint`) - [x] Minimal test suite passes (`npm run test-min`) - [x] Pre-commit hooks executed successfully 🤖 Generated with [Claude Code](https://claude.ai/code)
…MPILER-EXPLORER-AXA (#7833) ## Summary Fixed two Monaco Editor error filters that weren't working due to misunderstanding the Sentry event structure: • **COMPILER-EXPLORER-CGQ (Clipboard cancellation)**: Filter was checking for `'Canceled: Canceled'` but actual error value is just `'Canceled'` • **COMPILER-EXPLORER-AXA (Hit testing)**: Filter was checking `frames[0].function` but due to Sentry wrapping, the function name appears in the error message instead ## Root Cause The key insight was examining the actual JSON from Sentry UI rather than making assumptions: - Sentry UI displays "type: value" format but JSON has separate `type` and `value` fields - `frames[0]` is often Sentry's wrapper (`sentryWrapped`), not the original error source - Function names may appear in error messages rather than frame metadata ## Changes 1. **Fixed clipboard filter**: Changed error value check from `'Canceled: Canceled'` to `'Canceled'` 2. **Fixed hit testing filter**: Changed from checking `frames[0].function` to checking error message content 3. **Added debugging comments**: Comprehensive notes for future Sentry filter debugging ## Test Plan - [x] TypeScript type checking passes - [x] Minimal test suite passes - [x] Pre-commit hooks pass - [ ] Deploy and verify errors are filtered in production Both issues have 10k+ occurrences so this should significantly reduce Sentry noise. 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>
…EXPLORER-CGQ (#7834) ## Summary Fixed the clipboard cancellation filter that was deployed but not working due to `SentryCapture` context modification. ## Root Cause The filter was checking for exact equality: ```typescript event.exception.values[0].value === 'Canceled' ``` But `SentryCapture()` modifies error messages by adding context: - Original: `"Canceled"` - Modified: `"Canceled\nSentryCapture Context: Unhandled Promise Rejection"` ## Solution Changed to use `startsWith('Canceled')` which: - ✅ Catches original error: `"Canceled"` - ✅ Catches modified error: `"Canceled\nSentryCapture Context: ..."` - ✅ More precise than `includes()` - reduces false positives - ✅ Still combined with specific stack trace check for safety ## Test Plan - [x] TypeScript type checking passes - [x] Pre-commit hooks pass - [ ] Deploy and verify clipboard cancellation errors are filtered This should finally stop the 20k+ COMPILER-EXPLORER-CGQ occurrences. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
Adds Sentry debugging to capture actual runtime filter data including: - Error value and type received by filter - Frame filenames array - Boolean results of hasClipboardFrame and isCancellationError checks - Whether filter should have triggered This will help identify why the filter isn't working despite appearing correct. Will be removed once issue is identified. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…-EXPLORER-CGQ Root cause: Source mapping happens AFTER beforeSend/ignoreErrors processing, so frame.filename contains minified bundle paths, not readable source paths. Changes: - Add 'Canceled' to ignoreErrors array for clipboard cancellation errors - Remove frame-based clipboard filtering (doesn't work with minified code) - Add comprehensive comments explaining source mapping timing issue - Keep hit testing filter using error message content (works with minified code) - Document that frame-based filtering is unreliable for Monaco errors This should finally stop the 20k+ COMPILER-EXPLORER-CGQ clipboard cancellation errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This adds some unit tests for the front end. - configures "frontend tests" as a unit tests in `static/tests`, removing the old cypress-requiring "unit" tests - hack enough of a DOM to get things working - port motd and id tests - *adds* a golden layout checks (see #7807) - Updates READMEs etc --------- Co-authored-by: Claude <noreply@anthropic.com>
- removes config for firejail (unused, and doesn't exist on aarch64) - copies execution config to aarch64prod, aarch64staging (as that's the path that is looked for by the environment) - unifies c and c++ aarch64 config to "supportBinary" for aarch64 compilers
## Summary - Fixes EBADF error in HeaptrackWrapper by removing redundant file descriptor close operation - The net.Socket takes ownership of the FD and closes it during cleanup, making manual close unnecessary and dangerous ## Root Cause Analysis The issue occurred in `lib/runtime-tools/heaptrack-wrapper.ts:133` where the code attempted to manually close a file descriptor that was already owned by a `net.Socket`. When creating a socket with `new net.Socket({fd: fd})`, the socket takes ownership of the file descriptor and closes it during cleanup operations like `resetAndDestroy()`. Attempting to close the FD again results in: 1. EBADF errors when the FD hasn't been recycled 2. Potentially closing a different resource if the FD has been recycled by the OS ## Solution Removed the manual `oldfs.close(fd)` call since the socket handles FD cleanup automatically. This prevents both the EBADF error and the more dangerous scenario of closing recycled file descriptors. ## Verification Created tests to verify that `net.Socket` takes ownership of file descriptors: ```javascript // Test confirms that after socket.destroy(), the FD is no longer valid const fd = fs.openSync(pipePath, O_RDWR | O_NONBLOCK); const socket = new net.Socket({ fd: fd, readable: true, writable: true }); socket.destroy(); // fs.fstatSync(fd) throws EBADF - confirming FD was closed by socket ``` ## Test Plan - [x] TypeScript compilation passes - [x] Minimal test suite passes - [x] Pre-commit hooks pass - [x] Created unit test to verify net.Socket FD ownership behavior Fixes COMPILER-EXPLORER-EA7 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>
This PR updates a dozen regular expressions related to labels and demangling to allow quoted names which gcc trunk is now emitting:  Resolves #7729
forgot to do this
…es COMPILER-EXPLORER-BY1 (#7836)
This PR implements this part of the cutter graph layout algorithm:   
## Summary This PR improves the pre-commit hook performance by: - Using `vitest related` to run only tests affected by changed files - Adding ability to skip expensive tests (filter tests) during pre-commit - Providing a consistent mechanism for skipping expensive tests ## Changes - Modified `lint-staged.config.mjs` to run `vitest related` with `SKIP_EXPENSIVE_TESTS=true` - Updated `test/filter-tests.ts` to use idiomatic `describe.skipIf()` for conditional test execution - Changed `test-min` script to use `SKIP_EXPENSIVE_TESTS` environment variable instead of `--exclude` - Updated `CLAUDE.md` with documentation about the new test workflow ## Impact - Pre-commit hooks are now much faster as they: - Only run tests related to changed files - Skip 688 expensive filter tests - Use the same skipping mechanism as `npm run test-min` ## Testing - ✅ Verified `vitest related` correctly identifies and runs related tests - ✅ Confirmed filter tests are skipped when `SKIP_EXPENSIVE_TESTS=true` - ✅ Tested that full test suite still runs all tests when env var is not set - ✅ Pre-commit hooks work correctly with the new setup 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>
Seems I accidentally deleted this in the biome pr 🤔
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
⤵️ pull
documentation
Improvements or additions to documentation
lang-ada
lang-android-java
lang-android-kotlin
lang-asm
lang-c++-opencl
lang-c++
lang-c
lang-c3
lang-circle
lang-circt
lang-clean
lang-cmakescript
lang-cobol
lang-cppx
lang-crystal
lang-cuda
lang-d
lang-dart
lang-dotnet
lang-fortran
lang-gimple
lang-go
lang-haskell
lang-hlsl
lang-hook
lang-ispc
lang-jakt
lang-java
lang-julia
lang-kotlin
lang-llvm
lang-mlir
lang-modula2
lang-nim
lang-objc
lang-objc++
lang-ocaml
lang-opencl-c
lang-pascal
lang-pony
lang-python
lang-racket
lang-ruby
lang-rust
lang-scala
lang-snowball
lang-solidity
lang-spice
lang-swift
lang-tablegen
lang-toit
lang-typescript
lang-v
lang-vala
lang-zig
ui
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )