Skip to content

Conversation

@EgorkaKulikov
Copy link
Collaborator

@EgorkaKulikov EgorkaKulikov commented Jun 13, 2023

Description

Fixes #2317

How to test

Should be tested as a part of full integration testing checks.

Self-check list

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.
@EgorkaKulikov EgorkaKulikov added ctg-enhancement New feature, improvement or change request comp-codegen Issue is related to code generator labels Jun 13, 2023
@EgorkaKulikov EgorkaKulikov force-pushed the egor/cg_annotations_for_integration_tests branch from 5a2eae1 to b35a614 Compare June 13, 2023 12:10
Copy link
Collaborator

@IlyaMuravjov IlyaMuravjov left a comment

Choose a reason for hiding this comment

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

It's also desirable to add @Transactional and @AutoConfigureTestDatabase if they are present on the test module class path.

@EgorkaKulikov EgorkaKulikov force-pushed the egor/cg_annotations_for_integration_tests branch from a101ee3 to de7c03f Compare June 26, 2023 13:38
@EgorkaKulikov EgorkaKulikov force-pushed the egor/cg_annotations_for_integration_tests branch from de7c03f to dadf0bf Compare June 26, 2023 13:49
Copy link
Member

@Damtev Damtev left a comment

Choose a reason for hiding this comment

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

There are a lot of possibly dangerous changes connected with CgJavaGetClass. I suggest removing these changes from this PR and moving them to another PR


// Annotations

enum class AnnotationTarget {
Copy link
Member

Choose a reason for hiding this comment

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

May we use kotlin.annotation.AnnotationTarget instead of creating our own type?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Bue... it may lead the user to a wrong concern that we support or going to support all items from it. Next, in current implementation we are able to do smth like Class(classId) to specify the scope of current or outer class, for example. After that, do not forget that we get salary for the changed lines...


/**
* NOTE: use `StatementConstructor.addAnnotation`
* instead of explicit constructor call.
Copy link
Member

Choose a reason for hiding this comment

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

I guess, it's more preferrable to replace all these warnings with TODOs for rearranging packages/classes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure it will be ever done in current codegen. We know about packaging in general. I added this warnings just for other users to avoid additional mess in the code.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure it will be ever done in current codegen
Perhaps it will not, but IMHO todo is much more notable than such a simple comment.

}

override fun createDataProviderAnnotations(dataProviderMethodName: String) = mutableListOf<CgAnnotation>()
override fun addDataProviderAnnotations(dataProviderMethodName: String) { }
Copy link
Member

Choose a reason for hiding this comment

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

Same as for TestNg

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is not an error, just annotation is not required.

@Damtev Damtev self-requested a review June 28, 2023 14:01
Copy link
Member

@Damtev Damtev left a comment

Choose a reason for hiding this comment

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

Mostly LGTM

@EgorkaKulikov EgorkaKulikov enabled auto-merge (squash) June 28, 2023 15:02
@EgorkaKulikov EgorkaKulikov merged commit 117f841 into main Jun 28, 2023
@EgorkaKulikov EgorkaKulikov deleted the egor/cg_annotations_for_integration_tests branch June 28, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-codegen Issue is related to code generator ctg-enhancement New feature, improvement or change request

5 participants