-
Notifications
You must be signed in to change notification settings - Fork 9
fix: preflight error logging #789
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
base: main
Are you sure you want to change the base?
Conversation
📜 Docstring Coverage ReportRESULT: PASSED (minimum: 30.0%, actual: 75.5%) Detailed Coverage Report |
📦 Trivy Vulnerability Scan Results
Report Summary
Scan Result Details✅ No vulnerabilities found during the scan for |
📦 Trivy Secret Scan Results
Report Summary
Scan Result Details✅ No secrets found during the scan for |
|
🛠 Docs available at: https://k.atlan.dev/application-sdk/sdk-fixes |
| raise ValueError("Preflight check failed") | ||
| raise ValueError( | ||
| "Preflight check failed: " + str(result.get("error", "")) | ||
| ) |
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.
Bug: Calling .get() on potentially None result
When result is None (or another falsy value), the code attempts to call result.get("error", "") which raises an AttributeError since None doesn't have a .get() method. The condition if not result or "error" in result short-circuits and enters the if block when result is falsy, but then tries to access .get() on that falsy value.
| return match.group(1) | ||
| raise ValueError("Could not find valid AWS region from hostname") | ||
| logger.warning("Could not find valid AWS region from hostname") | ||
| return None |
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.
Bug: Returning None region breaks downstream boto3 clients
Changing get_region_name_from_hostname to return None instead of raising ValueError causes downstream issues. When callers like generate_aws_rds_token_with_iam_role and generate_aws_rds_token_with_iam_user use the expression region or get_region_name_from_hostname(host), they'll pass None to boto3's region_name parameter if both region is None and the hostname doesn't contain a valid region. This will cause AWS SDK errors since boto3 requires a valid region to make API calls.
Additional Locations (2)
inishchith
left a comment
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.
@abhishekagrawal-atlan - the unit tests are failing, PTAL
📦 Example workflows test results
|
📦 Example workflows test results
|
📦 Example workflows test results
|
…reflight logging
Changelog
Additional context (e.g. screenshots, logs, links)
Checklist
Copyleft License Compliance
Note
Enhances preflight error messaging and changes AWS region extraction to warn and return None instead of raising.
preflight_checkerror reporting by raisingValueErrorwith detailed message fromresult.get("error", "")when preflight fails.get_region_name_from_hostnameto returnNoneand log a warning when no region is found (was raising an exception).str | Noneaccordingly.Written by Cursor Bugbot for commit 3c7a111. This will update automatically on new commits. Configure here.