-
Notifications
You must be signed in to change notification settings - Fork 65
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
Sync feature/stream-mode branch with v2.7.0 #640
Open
fxamacker
wants to merge
320
commits into
feature/stream-mode
Choose a base branch
from
fxamacker/update-stream-mode-with-v2.7
base: feature/stream-mode
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Sync feature/stream-mode branch with v2.7.0 #640
fxamacker
wants to merge
320
commits into
feature/stream-mode
from
fxamacker/update-stream-mode-with-v2.7
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UnmarshalFirst parses the first CBOR data item using the decoding mode. Any remaining bytes are returned in rest.
…o-DecMode-interface Add UnmarshalFirst to DecMode interface
…ons/setup-go-4 Bump actions/setup-go from 3 to 4
Co-authored-by: Faye Amacker <33205765+fxamacker@users.noreply.github.com>
Signed-off-by: Yan Qing <txr1883@gmail.com>
Signed-off-by: Yan Qing <txr1883@gmail.com>
Implements diagnostic notation (#384)
Reduced min coverage to 96% (was 98%) since the Diagnose() and DiagnoseFirst() functions reduced code coverage because of error path . These two functions return diagnostic notation for debugging, so CBOR encoding/decoding funcs are unaffected (still >= 98% coverage). Added triggers: - pull_request - workflow_dispatch Co-authored-by: Faye Amacker <33205765+fxamacker@users.noreply.github.com>
Add more tests for Diagnose and DiagnoseFirst
Update README to separately mention support for: - CBOR (IETF RFC 8949, STD 94) - CBOR Sequences (IETF RFC 8742)
…c8742 Update README for CBOR Sequences RFC 8742
Document new CBOR codec functions: - UnmarshalFirst() - Diagnose() - DiagnoseFirst() UnmarshalFirst() makes it easier to use CBOR Sequences (RFC 8742). Diagnose() and DiagnoseFirst() produces human-readable Extended Diagnostic Notation (RFC 8610 Appendix G).
….5.0-beta3 Update README.md for v2.5.0-beta3
Bump golangci-lint to 1.52.2. Bump Go to 1.20.
Remove deprecated linters. Temporarily disable revive to reduce noise in golangci-lint 1.52.2.
Specify DDR4 in benchmark system because faster RAM (DDR5 or overclocked DDR4) makes a difference in this specific comparison.
Bump safer-golangci-lint to 1.52.2 Update README to mention DDR4 in benchmark comparison.
…ata-error Fix Diagnose to return io.EOF error on empty data. This was detected while updating CBOR fuzz tests for v2.5.0-beta3.
Add Whats New section to mention: - Features already present in v2.4 are release quality. - Newly added functions require more fuzzing & docs.
….5.0-beta4 Update README.md for cbor v2.5.0-beta4
Temp CI change to regenerate code coverage badge for old releases that passed with 98% coverage. Master branch passes with 96% coverage because adding Diagnose() functions dropped coverage a bit. Name of badge URL includes coverage percent, so this doesn't affect master.
Revert temp changes that were used for regenerating coverage badge (>98%) for older releases. Master branch and newer releases use >96% coverage badge due to Diagnose() functions reducing coverage a bit.
Buffered returns an io.Reader for data remaining in Decoder's buffer. The returned reader is valid until the next call to Decode or Skip. This basically matches the Decoder.Buffered() in Go's encoding/json.
Disable conflicting encode options when marshaling cbor.Tag.
…ub/codeql-action-3.25.7 Bump github/codeql-action from 3.25.6 to 3.25.7
Add go1.21 to ci.yml. It was omitted because local tests use it and test matrix on GitHub is too large. Very old versions like go1.17 can be removed from ci.yml after fxamacker/cbor v1.27.0 is released.
…o-1.56.2 Bump golangci-lint to 1.56.2
While at it, also improve docs.
Currently *errors.errorString is returned when unmarshalling built-in tags (tag 0-3 and 21-23) with inadmissible content type. This commit adds InadmissibleTagContentTypeError and returns this error with the same error message as before when unmarshalling build-in tags with inadmissible content type.
…rmat-dec-mode Improve byte string format decoding options
…ontentTypeError Replace `*errors.errorString` with `InadmissibleTagContentTypeError`
This commit adds features related to allowing user to specify a buffer rather than using built-in buffer pool: - cbor.MarshalToBuffer() uses codec's default options to encode to user provided buffer instead of using built-in buffer pool. - UserBufferEncMode interface extends EncMode interface with MarshalToBuffer() so user can provide buffer for encoding instead of using built-in buffer pool. - EncOptions.UserBufferEncMode() returns UserBufferEncMode - EncOptions.UserBufferEncModeWithTags() returns UserBufferEncMode - EncOptions.UserBufferEncModeWithSharedTags() returns UserBufferEncMode
Also renamed related options to be consistent.
…e-interface Allow user to specify buffer by adding `cbor.MarshalToBuffer()`, `UserBufferEncMode` interface, etc.
Rename ByteSliceMode to ByteSliceLaterFormatMode, etc
Signed-off-by: Ben Luddy <bluddy@redhat.com>
Fix panic using SortFastShuffle (unreleased new feaure) to encode a struct with no fields.
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@a5ac7e5...692973e) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.7 to 3.25.10. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@f079b84...23acc5c) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…ub/codeql-action-3.25.10 Bump github/codeql-action from 3.25.7 to 3.25.10
…ons/checkout-4.1.7 Bump actions/checkout from 4.1.6 to 4.1.7
Add Kubernetes to list of users, update Quick Start, etc.
….7.0 Update README.md for v2.7.0 release
@turbolent PTAL (not urgent yet since we can continue testing atree using this before merge). For context, a project using atree had external dependency using cbor v2.7.0 and ran into build error because atree uses this feature branch based on cbor v2.4. Eventually, I intend to add streaming feature to main branch of cbor along with some improvements. |
This is needed for backward compatibility with a project that sets this limit to math.MaxInt64.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #638
This PR merges v2.7.0 into
feature/stream-mode
which was based on v2.4.0.Merged changes include:
Encoder
fields are removed to be consistent with v2.7.0:e *encoderBuffer
andstream bool
StreamEncoder
fieldbuf *bytes.Buffer
(removed fromEncoder
) is added to store encoded data before flushingStreamEncoder.Encode()
is added to simplifyEncoder.Encode()
, soEncoder.Encode()
doesn't need to handle stream mode (consistent with v2.7.0).For info about other changes from v2.4.0 to v2.7.0, see fxamacker/cbor/releases.
Conflict Resolution
git log -1 -p -w --remerge-diff 62b894b173ee5531f6b7e3ee5ba0e7f8c639f521