DIRACGrid / diracx

The neXt DIRAC generation
GNU General Public License v3.0
8 stars 19 forks source link

feat: send client version to server #267

Open natthan-pigoux opened 2 months ago

natthan-pigoux commented 2 months ago
natthan-pigoux commented 2 months ago

closes #258

natthan-pigoux commented 1 month ago
natthan-pigoux commented 1 month ago
  • Need to check why the send or send_request client method are not used to send the request.
  • It looks like the request goes through: client/aio/operations/_operations.py > self._client._pipeline.run when testing with userinfo

@chaen find how to add properly the header in the client: kwargs.setdefault("base_headers", {})[DiracX-Client-Version"] = self.client_version

natthan-pigoux commented 1 month ago

Do I need to add more unit tests ?

aldbr commented 1 month ago

Do I need to add more unit tests ?

natthan-pigoux commented 1 month ago

Do I need to add more unit tests ?

  • a test when the header is missing? (which might be the case if we interact with the server using the openapi or the web interface)
  • a test when the header is present but does not contain any value?
  • a test when something other than a version is provided? Making sure the server correctly handles weird strings or numbers and does not crash.

last commits add these tests: https://github.com/DIRACGrid/diracx/pull/267/commits/92fac943408770421973cc0f47e95a54efd9ab72