This pull request includes several changes aimed at improving timeout handling, updating documentation, and refining the codebase. The most important changes include adding timeout contexts for various request types, removing redundant timeout logic, and updating documentation for clarity.
Timeout Handling Improvements:
internal/helpers/contexts.go: Added enterTimeoutContext function to handle timeouts for different request types, such as CreateRequest, ReadRequest, UpdateRequest, and DeleteRequest.
README.md and docs/index.md: Removed the suggestion to test the code in production environments, emphasizing caution due to potential bugs and issues. [1][2]
docs/index.md: Corrected the numbering in the certificate generation steps to provide a clearer and more logical sequence. [1][2]
Codebase Refinements:
internal/api/api_client.go: Simplified status code checks by removing the http.StatusUnauthorized condition.
internal/mocks/mocks.go: Added a new responder for the WhoAmI API endpoint to mock responses for environment access checks.
Testing and Formatting:
makefile: Added go fmt command to the build and install targets to ensure code formatting consistency.
This pull request includes several changes aimed at improving timeout handling, updating documentation, and refining the codebase. The most important changes include adding timeout contexts for various request types, removing redundant timeout logic, and updating documentation for clarity.
Timeout Handling Improvements:
internal/helpers/contexts.go
: AddedenterTimeoutContext
function to handle timeouts for different request types, such asCreateRequest
,ReadRequest
,UpdateRequest
, andDeleteRequest
.internal/services/environment/api_environment.go
: IntroduceddoWaitForAccess
method to ensure proper access before proceeding with environment creation.Documentation Updates:
README.md
anddocs/index.md
: Removed the suggestion to test the code in production environments, emphasizing caution due to potential bugs and issues. [1] [2]docs/index.md
: Corrected the numbering in the certificate generation steps to provide a clearer and more logical sequence. [1] [2]Codebase Refinements:
internal/api/api_client.go
: Simplified status code checks by removing thehttp.StatusUnauthorized
condition.internal/mocks/mocks.go
: Added a new responder for theWhoAmI
API endpoint to mock responses for environment access checks.Testing and Formatting:
makefile
: Addedgo fmt
command to thebuild
andinstall
targets to ensure code formatting consistency.internal/helpers/contexts_test.go
: Commented out the existing test code, indicating a need for future updates or replacements.