-
Notifications
You must be signed in to change notification settings - Fork 917
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
#313 Update generate_openapi_code.sh #547
Conversation
The script has been enhanced by organizing the tasks into functions for improved readability and modularity. A logging system was introduced to capture and store actions in both the console and a log file for better traceability. Error handling was added to ensure that any failures are caught with custom error messages, improving the robustness of the script. Additionally, an optional feature allows updating Poetry dependencies via a command-line flag, adding flexibility. The script now tracks the total execution time, providing insights into performance. Overall, the improvements make the script more structured, flexible, and user-friendly.
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.
👍 Looks good to me! Reviewed everything up to 9f5d9c8 in 10 seconds
More details
- Looked at
104
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. scripts/generate_openapi_code.sh:4
- Draft comment:
Consider making the-x
option conditional based on a debug flag to reduce verbosity in production use. - Reason this comment was not posted:
Confidence changes required:50%
The script usesset -xe
which combines both-x
and-e
options. The-x
option is for debugging and prints each command before executing it, while-e
causes the script to exit immediately if a command exits with a non-zero status. This is a good practice for debugging and ensuring the script stops on errors, but it might be too verbose for production use. Consider making the-x
option conditional based on a debug flag.
2. scripts/generate_openapi_code.sh:18
- Draft comment:
Uselog_action
for error messages to ensure they are logged to the file as well. - Reason this comment was not posted:
Confidence changes required:50%
The error messages in the script are directly echoed to the console. It would be more consistent to use thelog_action
function for logging errors as well, which would ensure all messages are logged to the file as well as the console.
3. scripts/generate_openapi_code.sh:20
- Draft comment:
Ensurecd - > /dev/null
is used consistently to suppress output when returning to the previous directory. - Reason this comment was not posted:
Confidence changes required:50%
The script usescd - > /dev/null
to return to the previous directory and suppress output. This is a good practice to keep the console output clean, but it should be consistent across the script.
4. scripts/generate_openapi_code.sh:19
- Draft comment:
Uselog_action
for all error messages for consistency. This applies to all similar cases in the script. - Reason this comment was not posted:
Confidence changes required:50%
The script usesecho
for error messages, which should be consistent with the logging mechanism used for other messages. This applies to all error messages in the script.
Workflow ID: wflow_yPaRLbnsTLQPw7jN
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@Piyushsahu99 have you tested the script? Try running |
Can you pls explain what more changes need to implement to get my pr acceptd. |
@Piyushsahu99 have you tested the script? Try running bash scripts/generate_openapi_code.sh in the root of the repo, if it run without errors, happy to accept repo. Until then, turning this into a draft pr |
Closing due to inactivity |
The script has been enhanced by organizing the tasks into functions for improved readability and modularity. A logging system was introduced to capture and store actions in both the console and a log file for better traceability. Error handling was added to ensure that any failures are caught with custom error messages, improving the robustness of the script. Additionally, an optional feature allows updating Poetry dependencies via a command-line flag, adding flexibility. The script now tracks the total execution time, providing insights into performance. Overall, the improvements make the script more structured, flexible, and user-friendly.
Important
Refactor
generate_openapi_code.sh
to improve modularity, add logging, error handling, and optional Poetry updates.log_action()
,compile_typespec()
,run_poetry_tasks()
, andusage()
.log_action()
to log actions to console andscript.log
.compile_typespec()
andrun_poetry_tasks()
.--update-poetry
to optionally update Poetry dependencies.usage()
.This description was created by for 9f5d9c8. It will automatically update as commits are pushed.