This repository has been archived by the owner on Apr 2, 2021. It is now read-only.
forked from twitter/scrooge
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CHANGES
686 lines (522 loc) · 21.3 KB
/
CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
.. Author notes: this file is formatted with restructured text
(http://docutils.sourceforge.net/docs/user/rst/quickstart.html)
as it is included in Scoorge's user's guide.
3.x
-----
3.16.3
~~~~~~~
- scrooge-core: Add union metadata for reflection
- scrooge-doc: Clarify docs on CLI usage
- scrooge-generator: Fix error message for missing required field
- scrooge-generator: Modify compiler to accept a Scaladoc comment at the end of Thrift file
- scrooge-generator: Normalize scalatest versions between poms and 3rdparty
- scrooge-generator: Stricter checks for invalid Thrift filenames
- scrooge-ostrich: Default to using `Protocols.binaryFactory`
3.16.1
~~~~~~~
- release finagle v6.18.0
- release util v6.18.0
- scrooge-linter: Fix multiple arguments to linter + pants/mvn fixes
- scrooge: Separate flow for linter
- scrooge: Skip includes when linting
3.16.0
~~~~~~~
- Upgrade dependencies to latest versions
- scrooge: Move scrooge-linter into scrooge
- scrooge: Add SimpleID.originalName for enum fields.
3.15.0
~~~~~~~
- scrooge: Bumping finagle to 6.16.0
- scrooge: Bump util to 6.16.1-SNAPSHOT
3.14.1
~~~~~~~
- scrooge-generator: Allow union field names to match struct names
3.14.0
~~~~~~~
- scrooge: Use scala.Option in all com.twitter.scrooge files to avoid conflict with com.twitter.scrooge.Option
- scrooge: Allow for Longs as const values
- scrooge: Make mustache parser threadsafe
- scrooge: Removing scrooge-generated null checks for primitive Scala types
- scrooge-ostrich: Add a flag for enabling ThriftMux
3.13.2
~~~~~~~
scrooge: bump finagle + util versions
3.13.1
~~~~~~~
scrooge-generator: Use OutputSreamWriter to write non ascii characters correctly.
3.13.0
~~~~~~~
- scrooge: add sbt 0.13 variant of scrooge-sbt-plugin
- scrooge: Add scrooge/scrooge-generator/BUILD
- scrooge: enable structs for the RHS of consts in scala
- scrooge: handle all shapes of RHS structs
- scrooge: scrooge: expose IDL annotations in generated structs
- scrooge: scrooge: throw an error when reading a field with the wrong type
- scrooge: Test uses of scala.Product are fully qualified
- scrooge: Thrift structs with fields named "n" can't use productElement to get that field
- scrooge: upgrade finagle to 6.13.1
- scrooge: upgrade util to 6.13.2
3.12.3
~~~~~
- scrooge: add the thrift root to the list of includes for scrooge
- scrooge: Automatically whitelist all idl jar dependencies
- scrooge: fixed issue when default value is enum from other namespace where namespace is missing in generated code
- scrooge: Update mustache to 0.8.13
- scrooge: update util to 6.12.0
- scrooge: update finagle to 6.12.1
- scrooge: update util to 6.12.1
- scrooge: add extra fields to generated companion object for reflection use
- scrooge: capture unknown union values as its own value (THRIFT-99)
- scrooge: Update scrooge to remove date from Generated annotation so generated code is reproducible.
3.12.2
~~~~~
- scrooge: Added missing writeFieldEnd() for passthrough fields
- scrooge: Bump finagle to 6.11.1
- scrooge: Bump util to 6.11.1
- scrooge: WriteFieldStop during transfer
3.12.1
~~~~~
- scrooge: properly handle field annotations
3.12.0
~~~~~
- scrooge: use a TReusableMemoryTransport in finagle services
- Bump guava to 15.0
- scrooge-generator: trim some allocations from generated scala code
- scrooge: use scalatest, remove specs
- added scala namespace to demo
- Rm all imports of `scala.Some`
3.11.2
~~~~~
- scrooge-*: bump finagle to 6.10.1-SNAPSHOT, util to 6.10.1-SNAPSHOT
- scrooge-generator: Attach thrift annotations to generated AST
- scrooge-generator: Ensure enums with values of the same name will compile
- scrooge-maven-plugin: Overwrite and warn if the current file is older
3.11.1
~~~~~
- scrooge: bump finagle version to 6.8.0
- scrooge: bump util version to 6.8.0
- scrooge: secondary struct class constructors without _passthroughFields for backwards compatibility
- scrooge-generator: fixed comment parsing bug
3.11.0
~~~~~
- scrooge-generator: simplify synthesized structs For synthesized service method arg and results structs
- scrooge-generator: special, scrooge-only syntax for scala namespace
- scrooge-generator: don't backquote scala identifiers in Enum.valueOf string constants
3.10.2
~~~~~
- scrooge-generator: produce slimmer code, remove _passthroughFields from object apply method
3.10.1
~~~~~
- scrooge-generator: default passthrough value, valid method names.
3.10.0
~~~~~
- scrooge-serializer: simpler BinaryThriftStructSerializer builder
- scrooge-maven-plugin: check for null from Artifact.getDependencyTrail
3.9.2
~~~~~
- scrooge: support larger structs
- scrooge: allow oneway
- scrooge: always generate passthrough code
3.9.1
~~~~~
- scrooge-generator: remove deprecation warnings removed deprecation warnings for FutureIface, FinagledClient, and FinagledServer. Since Jeff is working on finagle-free code generation, there is no good reason to push people off of these classes onto the replacements I added, only to deprecate those classes in the near future.
- scrooge-generator: fixed imports for union
3.9.0
~~~~~
- scrooge use scala option in metadata
- provide type parameters in metadata
- automatically whitelist all idl jar dependencies
- fix scrooge build properties
- bump finagle to 6.6.3-SNAPSHOT
- scrooge: support backslash escapes
- bump poms to finagle 6.6.1-SNAPSHOT
- bump util to 6.5.1-SNAPSHOT
3.8.0
~~~~~
- scrooge: passthrough field improvements
- Scrooge doesn't title case extended services properly
- update scrooge demo
- fix test breakage on sbt
3.7.0
~~~~~
- scrooge-serializer: tighten up dependencies scrooge-serializer only needs to depend on scrooge-core, not scrooge-runtime (the pants BUILD file already did this).
- We think that mustache actually handles the escaping so that this additional escaping is not needed.
- bump util to 6.4.1-SNAPSHOT
- scrooge-runtime => scrooge-core
- properly qualify service parents
- scrooge-ostrich: add thriftProtocolFactory as val The generated ThriftServer class has a thriftProtocolFactory field that some subclasses use.
- scrooge: removed ostrich generation.
- remove use of deprecated generated ostrich ThriftServer
3.6.0
~~~~~
- scrooge-generator: fixed whitespace eating in strings ThriftParser extends RegexParsers.
- scrooge-generator: Fixup java codegen issues surfaced by converting ads:ad-review-tests in science to scrooge.
- scrooge-generator: add support for scala namepsace
- scrooge-generator: Need to filter out items that are not set when rendering default struct values.
- scrooge-maven-plugin: Make scrooge plugin find thrift files in idls when run only with reactor projects in a clean env
- scrooge-generator: Allow default struct values in the java generator.
- scrooge-ostrich: search harder for FutureIface
- scrooge-generator: rename Service$ThriftServer to Service$OstrichThriftServer - fixes breakage under scala 2.10 - also removed ostrichService.java which wasn't used
- scrooge-generator: allow trailing comma at the end of a map
3.5.0
~~~~~
- scrooge: breaking out finagle, higher-kinded-type interface
- use apply instead of cons for enum list all
- Cleanup around the TypeResolver
- update ostrich related docs
- scrooge-ostrich This review introduces a new, temporary scrooge subproject, which is intended to help in the migration away from generating ostrich code in scrooge.
3.4.0
~~~~~
- BREAKING: remove list generation from enums (was causing compile errors. will revisit)
- move TypeResolver and ParseException into the frontend package
- create scrooge-core leaving legacy finagle code in scrooge-runtime. (scrooge-runtime will be deprecated soon)
- treat non-letters as case-less
- update docs and release process for twitter-server, scrooge
- BREAKING: move serializer into its own project
- keep the order of the values in the constant map in the parser. Should be a no-op for scala that converts it to a map in the generator
- Remove the tracerFactory usage and use tracer instead.
- create scrooge documentation site
- tiny fix for oneway support
3.3.2
~~~~~
- bugfix: collections of enums now identify as i32 on the wire
3.3.1
~~~~~
- provide a mechanism for dynamicallly pluggable backends
- make enum list of values lazy
- remove the include mapping hack
- fix maven plugin references includes
3.3.0
~~~~~
- Documenation fixes
- fix ThriftStructMetaData use camelCase method names to match generated
code
- maven-plugin: skip file copy from references if existing file is the
same
- POTENTIALLY BREAKING CHANGES:
- Identify enum fields as TType.ENUM but maintain backward
compatibility by identifying them as I32 on the wire
- maven-plugin - do not extract dependencies into their own
subdirectories
3.2.1
~~~~~
- add list method to enums that lists all values
- bugfix: ThriftUtil was not being imported for services
- add ability to attach additional passthrough fields
3.2.0
~~~~~
- BREAKING CHANGE:
Make java gen experimental. There are changes coming down the pipe that
will dramatically refactor java's codegen.
3.1.10
~~~~~~
- do not use an intermedial `val` for passthroughs. Eliminates the possibility
of a name collision
- eliminate the possibility of namespace collision for "runtime"
- revert identification of Enums and TType.ENUM (back to I32)
- eliminate all use of ThriftUtil unless it's needed
3.1.9
~~~~~
- bump to util-6.3.6 / finagle-6.5.0
- [EXPERIMENTAL] add ability to pass through additional fields
enable with --enable-passthrough
- Create the ability to map includes to directories to bridge scrooge2 and
scrooge3 maven layouts
- show the filename of the file being parsed in error messages
- identify enums as TType.ENUM
3.1.8
~~~~~
- generator: thrift idl containing UTF-8 produces
java.nio.charset.UnmappableCharacterException
- generator: Replace backslash with forward slash in file URI
- sbt-plugin: Include (and optionally compile) external thrift files.
- generator: remove unnecessary apply method for decode (causes issues with
named args)
3.1.7
~~~~~
- Use explicit version numbers
3.1.6
~~~~~
- Depend on the latest patch version of util/finagle
3.1.5
~~~~~
- add back the --import-path flag as a deprecation step
- add sbt-plugin
- use maven as the build system for the maven plugin
3.1.2
~~~~~
- BREAKING CHANGE:
In the maven plugin: change the dependentConfigs param to dependentIncludes
- optimize empty collections on deserialization
- upgrade to finagle 6.4.0 and util 6.3.4
3.1.1
~~~~~
- BREAKING CHANGE:
We finally made scrooge-runtime to be backward with Scrooge 2. This requires
a name change for the ThriftStructCodec. From now on, all objects generated
by Scrooge 3 will use ThriftStructCodec3.
This will affect you only if your code is using ThriftStructCodec directly,
which is not common.
- scrooge now releases jar-with-dependencies
- add language option tag to scrooge-maven-plugin, thanks to @eirslett
- some directory reorganization of the demos
3.1.0
~~~~~
- Dependency changes: now on util/finagle 6.3.0
- demo project now shows how to construct finagle server and client using
generated code
- --ostrich flag implies --finagle flag
3.0.9
~~~~~
- Remove "provided" scope of finagle in scrooge-runtime. So it brings Finagle
6.1.0 as transit dependency to your project
- Make the generated Scala code backward compatible with Finagle 5. The impact
to users on Finagle 6 is that you will see a lot of warnings saying that
tracerFactory is deprecated.
3.0.8
~~~~~
- When scrooge-maven-plugin extracts Thrift files from a dependency artifact, it
now puts them in a sub folder named after the artifact id. This way, the user
project can use same-named Thrift files from different artifacts.
- Title case and camel case more consistent with previous version before 3.0.7
We still preserve consecutive upper cases but not in an all-up-case string, eg:
::
TBird (original) -> tBird (camel case) -> TBird (title case)
HTML (original) -> html (camel case) -> Html (title case)
Thanks to @erikvanoosten
- Finagle client can throw exception on void function. Thanks to @brancek
- Support documentation on enum values. Thanks to @erikvanoosten
- Reorganizing test folder, and add Apache standard test
3.0.7
~~~~~
- All on-wire names in the Thrift messages are now consistent with
Apache generated code. This allows Scrooge generated services to exchange
Thrift messages with Apache generated services.
- Title case ids now preserve consecutive upper case letters. Eg:
::
TBird (original) -> Tbird (old) -> TBird (now)
See test case in scrooge-generator/src/test/scala/com/twitter/scrooge/ASTSpec.scala
- scrooge-maven-plugin now enforces an explicit white list in <dependencyConfig>.
The old behavior is that if a dependency artifact has a "idl" classifier, we
will extract thrift files from it to compile. The new behavior is that the
artifact must be explicitly included in <dependencyConfig>. The dependencies
here include both direct dependencies(specified in project pom file) and
indirect dependencies (everything in the dependency tree).
- Now supports "scala" as a namespace scope. It is treated same as "java".
- Now supports "*" as a default namespace scope
3.0.6
~~~~~
- Released a scrooge-maven-plugin, for maven projects to integrate Scrooge in
their pom files. Also released a demo of how to use scrooge-maven-plugin
- scrooge-runtime is now backward compatible with scrooge-runtime 2.X.X. The
following classes and methods are deprecated:
- FinagleThriftClient
- FinagleThriftService
- ThriftStructCodec.decoder
- ThriftStructCodec.encoder
- scrooge-runtime now can introspect generated ThriftStruct. See the new
ThriftStructMetaData class.
- BREAKING: in scrooge-runtime, com.twitter.ScroogeOption is now renamed to
just Option. This is mainly for Java code. But if you need to use it in
Scala code, make sure to address ambiguity with scala.Option.
- Updated APIs of scrooge-generator. See com.twitter.scrooge.Compiler class
- Fix the stats reporting for the java scrooge thrift code generation
3.0.5
~~~~~
Bug fixes
- Constant definitions now can be of "set" type.
- Fix letter cases of enum fields(Java uses upper case; Scala uses title case)
Dependencies
- Remove dependency on org.scalatest, com.twitter.scalatest (not in Maven
Central)
- Update dependency of util/finagle/ostrich to 6.1.0
- Project dependencies are all in Maven Central now. You don't need to have
access to Twitter internal repository anymore.
3.0.4
~~~~~
Features:
- add --dry-run option to parse and validate source thrift files, reports any
errors, but does not emit any generated source code. It can be used with
--gen-file-mapping to get the file mapping
Bug fixes
- union types now can contain primitive types.
- constants defined in the same file now can be referenced.
Dependencies
- Update dependency of util/finagle/ostrich to 6.0.6
3.0.3
~~~~~
- Scrooge artifacts now deploys to Maven central via Sonatype
- Scrooge project builds in Travis CI
- Features
- Fully qualifying ids imported by "include" statements. We don't generate
"import" statements anymore.
- Remove unnecessary finagle jar dependencies for vanilla generated code.
- Add tests
- non-finagle usage; see NonFinagleSpec.scala
- struct immutability and deep copying; see ImmutableStructSpec.scala
- Bug fixes
- move "validate" method from Scala struct trait to object, so that the thrift
struct can define a "validate" field without name clashing.
3.0.2
~~~~~
- Adding a "--gen-file-map <path>" option to Scrooge command line. It tells
what output files each input Thrift files generates, in the following format:
::
inputPath/input.thrift -> outputPath/Constants.scala
inputPath/input.thrift -> outputPath/FooStruct.scala
- The generated enums now have a common trait ThriftEnum(defined in
scrooge-runtime), that allows you to query the name as well as the value of
the enum field.
- The generated Scala enums now are Java-serializable.
- The generated FinagledClient class takes val arguments to make "service",
"protocol" accessible:
::
class FinagledClient(
val service: ...,
val protocol: ...,
val serviceName: ...
stats: ...
)
3.0.1
~~~~~
Features and bug fixes
- Doc comments are included in the generated code.
- Generated exception structs now have getMessage() method
- Generate header that emits Scrooge version
- You can now import a directory or a Jar/Zip file through command line
argument, which will be stored in a chain of paths maintained by Scrooge.
Then refer to a file using relative path in the thrift "include" statement.
Scrooge will locate the file in the path chain.
- Introduce a "strict" mode that defaults to on. Unfavored syntax throws an
exception when "strict" mode is on and prints a warning when it's off. The
strict mode can be disabled by specifying the "--disable-strict" argument.
- The "oneway" modifier is treated as an OnewayNotSupportedException in strict
mode and a warning in non-strict mode.
- Support Union types. Given:
::
union Point {
1: double x
2: double y
3: Color color = BLUE
}
Scrooge generates:
sealed trait Point
object Point {
case class X(x: Double) extends Point
case class Y(y: Double) extends Point
case class Count(color: Color = Color.Blue) extends Point
}
The "required" and "optional" modifiers in a union type will throw
exceptions in strict mode and print warnings in non-strict mode.
- Have a common trait ThriftException for all the thrift exception structs.
- Support cross file service inheritance. Now you can do
include "foo.thrift"
service MyService extends foo.FooService { ... }
- Bug fix: It couldn't resolve a symbol imported through a relative path and
threw an UndefinedSymbolException
- Bug fix: namespace aliasing put the parentheses in the wrong place.
- Bug fix: services using binary fields wouldn't compile
- Bug fix: cross-file const referencing didn't work
Implementation updates
- Project structure:
- frontend: Importer and ThriftParser
- mustache: everything related to mustache, including template parser, loader
and handlebar
- ast: Thrift AST definition
- backend: code generation include various generators and dictionaries to
hydrate Mustache templates.
- Redefine clear and separate responsibilities of each components:
- Move ID manipulation(concatenation, case conversion, keyword rewriting etc)
to Generator phase.
- Utilizing Scala static type checking to enforce scoping correctness by
introducing SimpleID and QualifiedID to AST.
- Enforce dictionary key uniqueness for nested Mustache templates.
- Scrooge project is now on Maven
- Delete obsolete code and tests
Dependencies:
- Upgraded to util 5.3.13, finagle 5.3.30
- Removed dependency on sbt
- Add dependency on maven
3.0.0
~~~~~
- Java code generation is now supported!
- Scala code now generates a set of classes for each struct:
- a base trait
- an immutable case class (used as the default implementation)
- a proxy trait (to make it easy to build proxy classes)
- Moved scrooge-runtime into the same repo with scrooge, which is now called
scrooge-generator. Both projects will keep version numbers in sync now.
- Changed the way required/optional is treated on fields, and default values,
to more closely match the way Apache Thrift works. (This is described in
more detail in a new section of the README.)
- Fixed constant sets.
- Fixed thread safety in finagle ThriftServer.
- Fixed the resolution of #include directives that follow relative paths.
- Removed the finagle dependency from scrooge-runtime so that code generated
with scrooge can be loosely coupled with finagle, or optionally not depend
on finagle at all (if you don't build finagle bindings).
- Fixed typedef references that were relative to #included files.
- Made various improvements to the internal template system.
- Fixed test speed by using scrooge to generate code that the tests build
against, avoiding runtime evaluation.
Dependencies:
- Upgraded to thrift 0.8.0, util 4.0, and finagle 4.0.
- Upgraded to sbt 0.11.2.
- Upgraded to scala 2.9.2.
2.x
-----
2.5.4
~~~~~
- Addressed an issue where structs with the same name but from different
namespaces/packages would conflict. Now using a package alias to
disambiguate.
2.5.3
~~~~~
- Minor bug fix for serviceName name class with.
2.4.0
~~~~~
- added support for structs with more than 22 fields, which previously was the
limit as that is the max case-class size in scala. For structs larger than
this, instead of using case-classes, normal classes are used but with most of
the case-class boilerplate support code also generated, allowing these structs
to be used as if they were case-classes. The only exception is that there is
no unapply method; but do you really want to unapply 23+ fields in a match
statement?
2.3.1
~~~~~
- thriftProtocolFactory in generated ThriftServer now has
type of TProtocolFactory, so you can override it with other
protocol factories.
2.3.0
~~~~~
- You can now override serverBuilder in ThriftServer to provide
additional server configuration
- The protocol factory to the FinagledClient now has a default
value of TBinaryProtocol.Factory, which means you don't have
to specify it when using the default.
2.2.0
~~~~~
- tracerFactory support in ThriftServer.
2.1.0
~~~~~
- Support for tracing in server.
2.0.2
~~~~~
- fixes a bug in which namespace mapping was not applied
recursively to included documents.
2.0.1
~~~~~
- fixes a bug in which qualified service names from imported
thrift files were not resolved properly.
2.0.0
~~~~~
- fixes a bug with enum in which the first value was wrong.
1.x
-----
1.1.1
~~~~~
- scrooge-runtime-1.0.1
- Each thrift struct companion object now extends ThriftStructCodec
- Correctly resolving enum constants and Const values.
- Title-casing enum value names.
- Added support for namespace renaming from the command line.