-
Notifications
You must be signed in to change notification settings - Fork 0
fix: testing improvements #102
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
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
|
/gemini review |
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.
Code Review
This pull request primarily refactors the documentation by moving developer-specific instructions from the main README.md to docs/DEVELOPING.md, which improves clarity for end-users. Additionally, it enhances the robustness of the check_entitlements.sh script by adding error handling for token acquisition and adopting shell scripting best practices. My review includes a suggestion to make the error handling in the shell script more concise and idiomatic. Overall, these are good improvements to the repository.
| if [ -z "$BEARER" ]; then | ||
| echo "❌ Failed to get access token." | ||
| exit 1 | ||
| fi |
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.
This check is great for robustness! To make it more concise and idiomatic to shell scripting, you can use a short-circuit || operator. This also provides an opportunity to redirect the error message to stderr (>&2), which is a best practice for error reporting.
| if [ -z "$BEARER" ]; then | |
| echo "❌ Failed to get access token." | |
| exit 1 | |
| fi | |
| [ -n "$BEARER" ] || { echo "❌ Failed to get access token." >&2; exit 1; } |
|
/gemini review |
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.
Code Review
This pull request introduces several improvements across the repository. The documentation has been refactored for better clarity by moving developer-specific information into its own file. The Python SDK's API has been simplified by consolidating two decryption methods into one, making it more intuitive to use. Additionally, a shell script has been made more robust. My feedback focuses on further enhancing the error handling in this script.
| if [ -z "$BEARER" ]; then | ||
| echo "❌ Failed to get access token." | ||
| exit 1 | ||
| fi |
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.
The check for an empty BEARER token is a good addition. However, it doesn't account for the case where the curl command succeeds but the JSON response from the token endpoint does not contain an access_token. In that scenario, jq -r '.access_token' will output the string "null", causing the BEARER variable to be assigned this string. The current check [ -z "$BEARER" ] would pass, and the script would proceed with an invalid token.
To make this check more robust, you should also test if $BEARER is equal to the string "null".
| if [ -z "$BEARER" ]; then | |
| echo "❌ Failed to get access token." | |
| exit 1 | |
| fi | |
| if [ -z "$BEARER" ] || [ "$BEARER" == "null" ]; then | |
| echo "❌ Failed to get access token." | |
| exit 1 | |
| fi |
No description provided.