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

Allow mapping-constructor-expr to be optional in annotations #28938

Merged
merged 14 commits into from Mar 8, 2021

Conversation

lasinicl
Copy link
Contributor

@lasinicl lasinicl commented Mar 1, 2021

Purpose

$title.

Fixes #28885
Fixes #27498

Approach

Describe how you are implementing the solutions along with the design details.

Samples

Provide high-level details about the samples related to this feature.

Remarks

List any other known issues, related PRs, TODO items, or any other notes related to the PR.

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

grainier
grainier previously approved these changes Mar 2, 2021
@rdhananjaya
Copy link
Member

@lasinicl can you please create an issue to update BBEs with this change

@MaryamZi MaryamZi added this to the Ballerina Swan Lake - Alpha3 milestone Mar 3, 2021
@lasinicl
Copy link
Contributor Author

lasinicl commented Mar 3, 2021

Created #28986 to update the BBEs and rest of the comments have been addressed via 4467ec7

@lasinicl lasinicl requested a review from MaryamZi March 4, 2021 06:29
Copy link
Member

@MaryamZi MaryamZi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lasinicl, shall we also add content about this change to the release note file?

@lasinicl
Copy link
Contributor Author

lasinicl commented Mar 5, 2021

@lasinicl, shall we also add content about this change to the release note file?

Added in ballerina-platform/ballerina-release#101

@lasinicl lasinicl requested a review from MaryamZi March 5, 2021 08:51
@@ -367,4 +369,89 @@ public void testAnnotsWithConstLists() {
Assert.assertEquals(element.getKind(), NodeKind.LITERAL);
Assert.assertEquals(((BLangLiteral) element).value, "test");
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, missed this previously. But shall we add some runtime tests too? See org.ballerinalang.test.annotations.AnnotationRuntimeTest. The data provider at https://github.com/ballerina-platform/ballerina-lang/blob/master/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/annotations/AnnotationRuntimeTest.java#L87 doesn't seem to be used though (the test that used that seems to have gotten removed :/), so we'll have to add that back too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically let's test the following,

  1. map type
  2. record type with required fields that have defaults (at runtime we can check if the default was set)
  3. array of maps or records

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added runtime tests in b75e5a2.
testServiceAnnotAccess1 test is disabled since it was failing. Created #29033 to track it.

@codecov
Copy link

codecov bot commented Mar 5, 2021

Codecov Report

Merging #28938 (fc7efd0) into master (acdad31) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #28938      +/-   ##
============================================
+ Coverage     66.36%   66.37%   +0.01%     
- Complexity    33569    33590      +21     
============================================
  Files          2747     2747              
  Lines        149095   149112      +17     
  Branches      17996    18004       +8     
============================================
+ Hits          98943    98977      +34     
+ Misses        44249    44237      -12     
+ Partials       5903     5898       -5     
Impacted Files Coverage Δ Complexity Δ
...lerinalang/compiler/desugar/AnnotationDesugar.java 91.42% <100.00%> (+2.50%) 101.00 <0.00> (+5.00)
...g/wso2/ballerinalang/compiler/desugar/Desugar.java 84.09% <100.00%> (+0.01%) 871.00 <8.00> (+4.00)
.../compiler/semantics/analyzer/SemanticAnalyzer.java 77.81% <100.00%> (+0.10%) 620.00 <5.00> (+9.00)
...alang/compiler/semantics/analyzer/SymbolEnter.java 80.15% <0.00%> (+0.04%) 686.00% <0.00%> (+1.00%)
...ava/io/ballerina/runtime/internal/TypeChecker.java 73.62% <0.00%> (+0.15%) 611.00% <0.00%> (+1.00%)
...llerina/runtime/internal/scheduling/Scheduler.java 74.60% <0.00%> (+1.58%) 50.00% <0.00%> (+1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update acdad31...b75e5a2. Read the comment docs.

@lasinicl lasinicl requested a review from MaryamZi March 5, 2021 11:44
@MaryamZi MaryamZi merged commit c9852c8 into ballerina-platform:master Mar 8, 2021
@lasinicl lasinicl deleted the fix-annots branch September 11, 2021 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants