-
-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question 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
chore(connect): update device authenticity config #16903
chore(connect): update device authenticity config #16903
Conversation
WalkthroughThe change updates the flag used within the Suggested reviewers
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
scripts/ci/check-connect-data.ts (2)
30-36
: Consider enhancing error handling and adding request timeout.The fetch implementation could be more robust with:
- Request timeout to prevent hanging on slow responses
- More descriptive error messages including HTTP status codes
Consider this enhancement:
const fetchJSON = async (url: string) => { - const response = await fetch(url); + const controller = new AbortController(); + const timeout = setTimeout(() => controller.abort(), 30000); // 30s timeout + try { + const response = await fetch(url, { signal: controller.signal }); + if (!response.ok) { + throw new Error(`Failed to fetch ${url}: ${response.status} - ${response.statusText}`); + } + return response.json(); + } finally { + clearTimeout(timeout); + } - if (!response.ok) { - throw new Error(`Failed to fetch ${url}: ${response.statusText}`); - } - return response.json(); };
186-188
: Consider enhancing error handling with specific error types.The current error handling could be more granular to handle different types of failures (network, file system, Git operations) separately.
Consider this pattern:
} catch (error) { - console.error(`Error updating configuration: ${error.message}`); + if (error instanceof TypeError) { + console.error('Network or parsing error:', error.message); + process.exit(1); + } else if (error.code === 'ENOENT') { + console.error('File system error:', error.message); + process.exit(1); + } else { + console.error('Unexpected error:', error.message); + process.exit(1); + } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/ci/check-connect-data.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (17)
- GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
- GitHub Check: run-desktop-tests (@group=other, trezor-user-env-unix)
- GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
- GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
- GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
- GitHub Check: Analyze with CodeQL (javascript)
- GitHub Check: build-web
- GitHub Check: Setup and Cache Dependencies
- GitHub Check: build-web
- GitHub Check: e2e-test-suite-web (@group=other, trezor-user-env-unix)
- GitHub Check: e2e-test-suite-web (@group=metadata2, trezor-user-env-unix)
- GitHub Check: e2e-test-suite-web (@group=metadata1, trezor-user-env-unix)
- GitHub Check: e2e-test-suite-web (@group_wallet, trezor-user-env-unix bitcoin-regtest, 1)
- GitHub Check: e2e-test-suite-web (@group_passphrase, trezor-user-env-unix, 1)
- GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
- GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
- GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
🔇 Additional comments (2)
scripts/ci/check-connect-data.ts (2)
1-29
: LGTM! Well-structured imports and constants.The imports are appropriate for the task, and the constants are well-organized with proper typing. The authenticity paths align with the PR objectives for t2b1, t3t1, and t3b1 firmware versions.
182-182
: LGTM! Correct GitHub CLI flag update.The change from
--add-label
to--label
aligns with the current GitHub CLI command syntax.
This was a test. |
@trezor/connect check data for device Authenticity
This is an automatically created PR.