Skip to content

Conversation

Tanmay-Bstack
Copy link
Collaborator

@Tanmay-Bstack Tanmay-Bstack commented Sep 15, 2025

Description [Cypress CLI Release] SDK Cypress Build Unification
Body Details of the change: Cypress Build Unification changes & Release Notes: Added support for linking reports generated through products on Common Automation Dashboard (CAD)
Relates To https://browserstack.atlassian.net/browse/SDK-492 .
Assign To automate-customer-ops (can be checked from help-automate)
Testing Completed Add Testing performedDev TestedRegression PassedQA TestedA TestedA Tested

Comment on lines +24 to +49
const options = {
hostname: '127.0.0.1',
port,
path: `/test-uuid?testIdentifier=${encodeURIComponent(testIdentifier)}`,
method: 'GET',
timeout: 2000
};
const req = http.request(options, (res) => {
let data = '';
res.on('data', (chunk) => data += chunk);
res.on('end', () => {
if(res.statusCode === 200) {
try {
const json = JSON.parse(data || '{}');
return resolve({ testRunUuid: json.testRunUuid || null });
} catch(e) {
return resolve(null);
}
} else if (res.statusCode === 404) {
// Server up but endpoint not responding as expected – stop retrying.
return resolve(null);
} else {
retryOrResolve();
}
});
});

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: problem-based-packs.insecure-transport.js-node.http-request.http-request Warning

Checks for requests sent to http:// URLs. This is dangerous as the server is attempting to connect to a website that does not encrypt traffic with TLS. Instead, only send requests to https:// URLs.
method: 'GET',
timeout: 2000
};
const req = http.request(options, (res) => {

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: problem-based-packs.insecure-transport.js-node.using-http-server.using-http-server Warning

Checks for any usage of http servers instead of https servers. Encourages the usage of https protocol instead of http, which does not have TLS and is therefore unencrypted. Using http can lead to man-in-the-middle attacks in which the attacker is able to read sensitive information.
}
}

module.exports = TestHubHandler; No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

EOF

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added

accessibility: accessibilityScanInfo[testData.name],
};
}
}; No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

EOF

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added

exports.isAccessibilityEnabled = () => {
if (process.env.BROWSERSTACK_TEST_ACCESSIBILITY !== undefined) {
return process.env.BROWSERSTACK_TEST_ACCESSIBILITY === "true";
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a log here for better clarity

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added

this.platformDetailsMap = {};
this.runStatusMarkedHash = {};
this.haveSentBuildUpdate = false;
this.startHttpServer();
Copy link
Collaborator

Choose a reason for hiding this comment

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

keep it in try catch if any how it fails to start and throw error

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added try catch block inside the function

if(this.httpServer !== null) return;

try {
this.httpServer = http.createServer(async(req, res) => {

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: problem-based-packs.insecure-transport.js-node.using-http-server.using-http-server Warning test

Checks for any usage of http servers instead of https servers. Encourages the usage of https protocol instead of http, which does not have TLS and is therefore unencrypted. Using http can lead to man-in-the-middle attacks in which the attacker is able to read sensitive information.
osho-20
osho-20 previously approved these changes Sep 19, 2025
osho-20
osho-20 previously approved these changes Sep 22, 2025
RutvikChandla
RutvikChandla previously approved these changes Sep 24, 2025
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.

4 participants