julep icon indicating copy to clipboard operation
julep copied to clipboard

#313 Update generate_openapi_code.sh

Open Piyushsahu99 opened this issue 1 year ago • 3 comments
trafficstars

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.

  • Modularity:
    • Refactor script into functions: log_action(), compile_typespec(), run_poetry_tasks(), and usage().
  • Logging:
    • Introduce log_action() to log actions to console and script.log.
    • Log start and end of script execution with timestamps.
  • Error Handling:
    • Add error handling with custom messages in compile_typespec() and run_poetry_tasks().
  • Features:
    • Add command-line flag --update-poetry to optionally update Poetry dependencies.
    • Track and log total execution time.
  • Misc:
    • Update script usage instructions in usage().

This description was created by Ellipsis for 9f5d9c841b804c7a7021b48a65a8ecfee7cd61c8. It will automatically update as commits are pushed.

Piyushsahu99 avatar Oct 02 '24 16:10 Piyushsahu99

@Piyushsahu99 have you tested the script? Try running bash scripts/generate_openapi_code.sh in the root of the repo, if everything is correct, it should not make any changes

creatorrr avatar Oct 02 '24 17:10 creatorrr

Can you pls explain what more changes need to implement to get my pr acceptd.

Piyushsahu99 avatar Oct 09 '24 15:10 Piyushsahu99

@Piyushsahu99 have you tested the script? Try running bash scripts/generate_openapi_code.sh in the root of the repo, if everything is correct, it should not make any changes

@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

creatorrr avatar Oct 10 '24 23:10 creatorrr

Closing due to inactivity

creatorrr avatar Oct 20 '24 16:10 creatorrr