-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[CI] Fix xharness local run. #22236
[CI] Fix xharness local run. #22236
Conversation
In PR #22154 in an attempt to fix some CodeQL warnings we broke the local execution of xharness. The reason is the following, CodeQL complained about sanitizing the local path and in an attempt to remove the warning a test to make sure that the local path does not have a '/' was added. The issue is that our requests, when we run xharness locally, will return localpaths of the form: '/20250221_181807/index.html' that is because the request is for 'http://localhost:51234/20250221_181807/index.html'. In webapps, the path of the request ALWAYS starts with '/' even when the request is for 'http://localhost:51234' (which returns '/'). In an attemp to fix xharness AND keep CodeQL happy I have made the following changes: 1. Ensure that the full path is one of the allowed ones. 2. If the path is not one of the allowed ones, check if it is and allowed file. 2. Do not try to check for '/' or '\' but verify that the path instead get the path directory and ensure that is the one for the logs and no other. This should fix xharness and keep CodeQL happy.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #089b301] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #089b301] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #089b301] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🔥 Failed to compare API and create generator diff 🔥 Error: 'make' failed for the hash 12d38e2. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [PR Build #089b301] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💻 [PR Build #534457d] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [PR Build #089b301] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [PR Build #089b301] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #089b301] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 112 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ops... my bad, I thought I'd tested this.
"/", | ||
"/index.html", | ||
"/set-option", | ||
"/select", | ||
"/deselect", | ||
"/stop", | ||
"/run", | ||
"/build", | ||
"/reload-devices", | ||
"/reload-simulators", | ||
"/quit", | ||
"/favicon.ico", | ||
"/index.html", | ||
}; | ||
|
||
static IReadOnlySet<string> AllowedFiles = new HashSet<string> (StringComparer.Ordinal) { | ||
"index.html", | ||
"xharness.css", | ||
"xharness.js", | ||
}; | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is off here, and there are a few extra blank lines.
In PR #22154 in an attempt to fix some CodeQL warnings we broke the local execution of xharness.
The reason is the following, CodeQL complained about sanitizing the local path and in an attempt to remove the warning a test to make sure that the local path does not have a '/' was added.
The issue is that our requests, when we run xharness locally, will return localpaths of the form: '/20250221_181807/index.html' that is because the request is for 'http://localhost:51234/20250221_181807/index.html'.
In webapps, the path of the request ALWAYS starts with '/' even when the request is for 'http://localhost:51234' (which returns '/').
In an attemp to fix xharness AND keep CodeQL happy I have made the following changes:
This should fix xharness and keep CodeQL happy.