A type with two fields, text and base64, is returned for every binary string.
Any decode error in the text field will be ignored.
Details
- Reviewers
anlambert - Group Reviewers
Reviewers - Commits
- rDGQL0cabd8ee94b7: Add a schema type for handling binary strings
Diff Detail
- Repository
- rDGQL GraphQL API
- Branch
- binary-string
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 29515 Build 46120: Phabricator diff pipeline on jenkins Jenkins console · Jenkins Build 46119: arc lint + arc unit
Event Timeline
Build is green
Patch application report for D7874 (id=28423)
Rebasing onto d5010fd75f...
Current branch diff-target is up to date.
Changes applied before test
commit e03f4cac16f004ee03920aae032c429ef0b208e1 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Mon May 16 12:22:49 2022 +0200 Add a schema type for handling binary strings A type with two fields, text and base64, is returned for every binary string. Any decode error in the text field will be ignored.
See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/25/ for more details.
Build is green
Patch application report for D7874 (id=28424)
Rebasing onto d5010fd75f...
Current branch diff-target is up to date.
Changes applied before test
commit cb1f34271867484b8c25fe5d5dfdcb624d6ea369 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Mon May 16 12:22:49 2022 +0200 Add a schema type for handling binary strings A type with two fields, text and base64, is returned for every binary string. Any decode error in the text field will be ignored.
See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/26/ for more details.
swh/graphql/resolvers/resolvers.py | ||
---|---|---|
252 | Use swh.core.utils.decode_with_escape instead. This is what is currently used in REST API to attempt decoding UTF-8 strings from bytes. It has the advantage to escape bytes of invalid utf-8 sequences instead of discarding them so users can see | |
swh/graphql/utils/utils.py | ||
12 | I do not think you need a variable for this, just put the "utf-8" literal directly in the code. | |
18 | .decode("ascii") |
swh/graphql/schema/schema.graphql | ||
---|---|---|
379 | I don't know; probably not. On the other hand, it forces users to think about that case. |
swh/graphql/resolvers/resolvers.py | ||
---|---|---|
252 |
we might as well use .decode(utils.ENCODING, "replace") then; that's what it is for |
swh/graphql/utils/utils.py | ||
---|---|---|
12 | This is used in resolvers.py as well. |
Build is green
Patch application report for D7874 (id=28435)
Rebasing onto d5010fd75f...
Current branch diff-target is up to date.
Changes applied before test
commit 0cabd8ee94b7100b8ea3d3949f81f8529d34d971 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Mon May 16 12:22:49 2022 +0200 Add a schema type for handling binary strings A type with two fields, text and base64, is returned for every binary string. Any decode error in the text field will be ignored.
See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/27/ for more details.