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

Release v1.30.0 #567

Merged
merged 44 commits into from
Apr 4, 2023
Merged

Release v1.30.0 #567

merged 44 commits into from
Apr 4, 2023

Conversation

r-hang
Copy link
Contributor

@r-hang r-hang commented Apr 4, 2023

This release contains the following changes:

  • AddTemplate template option.
  • thriftbreak: support for changed types, new files, and optional JSON output.
  • String() performance improvements for string type definitions.

witriew and others added 30 commits September 9, 2021 13:19
These pieces haven't been touched in a while so I'm fixing a number of issues:

1. `make clean` did not delete the thriftrw binary previously, so if you ran
   `make clean && make` inside gen/internal/tests, it would use the old binary
   to generate the test code.
2. `make` with no arguments in the root of the repository built just the
   development tools, not ThriftRW. Changed it to build ThriftRW.
3. We had vendored an old copy of github.com/fatih/struccttag in this
   repository for reasons; those reasons are no longer valid and we can just
   declare the dependency now.
4. gomock was severly out of date and didn't play nicely with some Go module
   corner cases. This caused a couple random error messages to be printed when
   we ran `make generate`. To fix this, I had to update gomock, and change the
   version of Go in the go.mod to 1.15.
5. CI wasn't yet testing against Go 1.17.
Now that all generated types support streaming, there's no reason to
separate thriftType and streamingThriftType.
Backport tests inside gen/ that (de)serialize structs to wire or back,
gto also test with streaming.

The following tests were affected:

- [x] collision_test
    - [x] TestStruct
    - [x] TestWithDefault
- [x] container_test
    - [x] TestCollectionsOfPrimitives
    - [x] TestEnumContainers
    - [x] TestListOfStructs
    - [x] TestCrazyTown
    - [x] TestContainerValidate
    - [x] TestEmptyContainersRoundTrip
- [x] service_test
    - [x] TestServiceArgsAndResult
    - [x] TestServiceTypesEnveloper
    - [x] TestArgsAndResultValidation
- [x] struct_test
    - [x] TestStructRoundTripAndString
    - [x] TestPrimitiveRequiredMissingFields
    - [x] TestBasicException
    - [x] TestCollisionException
    - [x] TestStructFromWireUnrecognizedField
    - [x] TestUnionFromWireInconsistencies
    - [x] TestStructWithDefaults
    - [x] TestStructValidation
    - [x] TestEmptyPrimitivesRoundTrip
- [x] typedef_test
    - [x] TestTypedefI64
    - [x] TestTypedefString
    - [x] TestTypedefBinary
    - [x] TestTypedefStruct
    - [x] TestTypedefContainer
    - [x] TestUnhashableSetAlias
    - [x] TestUnhashableMapKeyAlias
    - [x] TestBinarySet
    - [x] TestTypedefAnnotatedSetToSlice
- [x] list_test
    - [x] TestListRequiredToWire
    - [x] TestListRequiredFromWire
    - [x] TestRoundtripOptionalListFields
    - [x] TestListOptionalFromWire
- [x] enum_test
    - [x] TestEnumDefaultWire
    - [x] TestEnumWithDuplicateValuesWire
    - [x] TestUnknownEnumValue
    - [x] TestOptionalEnum

This gives us a much higher level of confidence
in the streaming implementation.

Co-authored-by: Abhinav Gupta <[email protected]>
Added thriftbreak, a linter that integrates with git by comparing HEAD and HEAD~, finding a list of all changed .thrift files and detecting the following changes:
- a required field was added to an existing struct
- a field was changed from optional to required for an existing struct
- a service was deleted
- one of service's methods was deleted

Note, one of the limitations of this linter is that we cannot yet detect changes if a struct was renamed and then a required field was added.

Ref GO-835
shirchen and others added 14 commits October 22, 2021 14:33
…ile (#550)

Before this change, if a new file is added in addition to other thrift changes, the detector would cause a panic when trying to find all Thrift changes.

Ref GO-963
Adding --json flag to thriftbreak to output results as JSON. This enables integration with tools like Phabricator.

Ref GO-938
Returning `FilePath` instead of `File` for better integration with CI tooling. 

Also addressing feedback from #551.

Co-authored-by: Abhinav Gupta <[email protected]>
Co-authored-by: Sung Yoon Whang <[email protected]>
If the underlying type is a string, we can optimize `String()` by
returning the string as-is instead of `fmt.Sprintf`-ing it.
This is a proactive change to remove noise from future work that needs
`make generate`'s output.
Test ThriftRW Go with the latest two Go minor releases.
Update the go.mod directive to require at least Go 1.17,
(this changes how `go mod tidy` behaves),
and update linters and fix issues.
* Add check for changed types

* Update error message

* Update struct name
* idl: Fix parsing of hex integer values

* Address comments

* Fix literal space in Makefile
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20211015210444-4f30a5c0130f to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add new TemplateOption AddTemplate

This enables consumers to split their template across multiple files and reference define blocks from other files.

* Update plugin/template.go

Address PR feedback

Co-authored-by: Moises Vega <[email protected]>

* Turn additionalTmpl into a map so users can provide a name

* Update documentation

---------

Co-authored-by: Moises Vega <[email protected]>
Update changelog for the v1.30.0 release.
The thriftrw release instructions call for running `make generate` and
seeing no changes to verify the state of dev before creating a release
commit PR on master. This change is the result of running `make generate`.
@r-hang r-hang requested a review from sywhang April 4, 2023 19:19
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
9 out of 10 committers have signed the CLA.

✅ witriew
✅ abhinav
✅ shirchen
✅ kishoresenji
✅ jparise
✅ KarboniteKream
✅ clayne11
✅ moisesvega
✅ r-hang
❌ dependabot[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov
Copy link

codecov bot commented Apr 4, 2023

Codecov Report

Merging #567 (8837a25) into master (e322a82) will increase coverage by 0.77%.
The diff coverage is 78.99%.

@@            Coverage Diff             @@
##           master     #567      +/-   ##
==========================================
+ Coverage   67.32%   68.09%   +0.77%     
==========================================
  Files         135      139       +4     
  Lines       23531    23838     +307     
==========================================
+ Hits        15842    16233     +391     
+ Misses       4593     4544      -49     
+ Partials     3096     3061      -35     
Impacted Files Coverage Δ
ast/annotation.go 91.66% <ø> (ø)
ast/basetypeid_string.go 75.00% <ø> (ø)
ast/constant.go 46.42% <ø> (ø)
ast/definition.go 74.50% <ø> (ø)
ast/header.go 40.00% <ø> (ø)
ast/position.go 100.00% <ø> (ø)
ast/program.go 66.66% <ø> (ø)
ast/type.go 33.84% <ø> (ø)
ast/visitor.go 0.00% <ø> (ø)
ast/walk.go 87.50% <ø> (ø)
... and 117 more

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@r-hang r-hang merged commit 51abcb3 into master Apr 4, 2023
@r-hang r-hang deleted the rhang/release branch April 4, 2023 21:47
r-hang added a commit that referenced this pull request Apr 6, 2023
The commit merged in (#567) was never tagged and released as v1.30.0 as
a bug was found in that commit before we officially cut a release for it.

This commit serves as the v1.30.0 release.

This release contains the following changes:
- AddTemplate template option.
- thriftbreak: support for changed types, new files, and optional JSON output.
- String() performance improvements for string type definitions.
r-hang added a commit that referenced this pull request Apr 6, 2023
The commit merged in (#567) was never tagged and released as v1.30.0 as
a bug was found in that commit before we officially cut a release for it.

This commit serves as the v1.30.0 release.

This release contains the following changes:
- AddTemplate template option.
- thriftbreak: support for changed types, new files, and optional JSON output.
- String() performance improvements for string type definitions.
@r-hang r-hang mentioned this pull request Apr 6, 2023
r-hang added a commit that referenced this pull request Apr 6, 2023
This commit serves as the v1.30.0 release.

The commit merged in (#567) was never tagged and released as v1.30.0 as
a bug was found in that commit before we tagged a release for it. This commit
contains the fix for the aforementioned bug.

This release contains the following changes:
- AddTemplate template option.
- thriftbreak: support for changed types, new files, and optional JSON output.
- String() performance improvements for string type definitions.
r-hang added a commit that referenced this pull request Apr 6, 2023
This commit serves as the v1.30.0 release.

The commit merged in (#567) was never tagged and released as v1.30.0 as
a bug was found in that commit before we tagged a release for it. This commit
contains the fix for the aforementioned bug.

This release contains the following changes:
- AddTemplate template option.
- thriftbreak: support for changed types, new files, and optional JSON output.
- String() performance improvements for string type definitions.
r-hang added a commit that referenced this pull request Apr 6, 2023
This commit serves as the v1.30.0 release.

The commit merged in (#567) was never tagged and released as v1.30.0 as
a bug was found in that commit before we tagged a release for it. This commit
contains the fix for the aforementioned bug.

This release contains the following changes:
- AddTemplate template option.
- thriftbreak: support for changed types, new files, and optional JSON output.
- String() performance improvements for string type definitions.
r-hang added a commit that referenced this pull request Apr 6, 2023
This commit serves as the v1.30.0 release.

The commit merged in (#567) was never tagged and released as v1.30.0 as
a bug was found in that commit before we tagged a release for it. This commit
contains the fix for the aforementioned bug.

This release contains the following changes:
- AddTemplate template option.
- thriftbreak: support for changed types, new files, and optional JSON output.
- String() performance improvements for string type definitions.
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.