Skip to content
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

revert (partial): write compressed configuration [RHELDST-25461] #728

Merged

Conversation

rohanpm
Copy link
Member

@rohanpm rohanpm commented Aug 5, 2024

This commit partially reverts db4a344; specifically, it disables the writing of compressed config and reverts back to writing JSON config as before.

This is being reverted due to an issue noticed during testing. It seems that the written items are ending up with two layers of base64 encoding, which is not intended.
The boto docs[1] use base64 strings as example arguments, giving the impression the caller is expected to take care of base64 encoding, but in fact botocore internally does the encoding; if the client also encodes, we end up with two layers of encoding.

There is also a bug filed relating to this[2].

The code here still seems to "work" since the same mistake is made on both the writing and reading end, but the goal is to make the config smaller and having double-encoding works against that.

It should be easy enough to fix, but I'd like some time to confirm my understanding of how it works, check whether exodus-lambda needs a fix and also check whether localstack and AWS are behaving the same. Hence I'll revert this for now and keep writing the old style of config.

[1] https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/put_item.html
[2] aws/aws-cli#1097

This commit partially reverts db4a344; specifically, it
disables the writing of compressed config and reverts back to writing
JSON config as before.

This is being reverted due to an issue noticed during testing. It seems
that the written items are ending up with *two* layers of base64
encoding, which is not intended.
The boto docs[1] use base64 strings as example arguments, giving the
impression the caller is expected to take care of base64 encoding, but
in fact botocore internally does the encoding; if the client also
encodes, we end up with two layers of encoding.

There is also a bug filed relating to this[2].

The code here still seems to "work" since the same mistake is made
on both the writing and reading end, but the goal is to make the
config smaller and having double-encoding works against that.

It should be easy enough to fix, but I'd like some time to confirm my
understanding of how it works, check whether exodus-lambda needs a fix
and also check whether localstack and AWS are behaving the same.
Hence I'll revert this for now and keep writing the old style of config.

[1] https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/put_item.html
[2] aws/aws-cli#1097
@rohanpm rohanpm force-pushed the disable-compressed-config branch from 005d272 to 4e8cac6 Compare August 5, 2024 03:37
This error started to appear in github pylint runs:

    exodus_gw/models/dramatiq.py:19:8:
      E1136: Value 'Mapped' is unsubscriptable (unsubscriptable-object)

I'm not sure why, but the error is certainly wrong. Disable the check in
this file.
@rohanpm rohanpm marked this pull request as ready for review August 5, 2024 03:54
@rohanpm rohanpm merged commit 9b87b41 into release-engineering:master Aug 5, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants