fix: pass context to all http requests in microcks and keycloak clients
all http requests in MicrocksClient and KeycloakClient were built with http.NewRequest, which doesn't accept a context. this means there's no way to cancel an in-flight request from the caller side — if a call hangs, it just hangs.
switched everything over to http.NewRequestWithContext and added context.Context as the first parameter to all interface methods that make http calls. callers in cmd/ pass context.Background() for now, which keeps behaviour identical while making it possible to wire up proper timeouts later (e.g. in the polling loop in cmd/test.go).
files changed:
pkg/connectors/microcks_client.go— updatedMicrocksClientinterface and all five method implementationspkg/connectors/keycloak_client.go— updatedKeycloakClientinterface and all three method implementationspkg/watcher/executor.go— updatedUploadArtifactcallcmd/importDir.go— updated localMicrocksClientinterface andImportDirectorysignaturecmd/importDir_test.go— updated mock and test calls to matchcmd/import.go,cmd/importURL.go,cmd/test.go— passcontext.Background()at call sitescmd/login.go— threadscmd.Context()through to all keycloak and microcks calls
note: this is a breaking change to the MicrocksClient and KeycloakClient interface signatures. any code outside this repo that implements or calls these interfaces will need to be updated.
This pull request has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 30 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.
There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. Microcks is a Cloud Native Computing Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart: