Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Use unnamed entry for project name when there is no package to infer from #15

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

mstrelex
Copy link
Member

@mstrelex mstrelex commented Jul 15, 2020

It's is not mandatory to place classes in a package, not under src > main neither under src > test.

If this is the case, infer logic using getPackageName() method on Class objects, will get an empty string that will be used for project name when opening a development session with the Agent.

This will result in a missing information for report creation and session will be initialized without reporting responding to SDK with 202 HTTP status. Any further reporting commands will result in error 406.

Added logic to use the unnamed entry (Unnamed Project) as project name when there is no package wrapping the class.

@mstrelex mstrelex requested a review from vitalybu as a code owner July 15, 2020 18:11
Copy link
Member

@vitalybu vitalybu left a comment

Choose a reason for hiding this comment

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

Excellent PR description!
The only request I have is to move this description into the commit message.
PRs are temporary, but commits are forever, so it's better to have this as part of commit itself.

…to infer from.

It's is not mandatory to place classes in a package, not under src > main neither under src > test.

If this is the case, infer logic using getPackageName() method on Class objects, will get an empty string that will be used for project name when opening a development session with the Agent.

This will result in a missing information for report creation and session will be initialized without reporting responding to SDK with 202 HTTP status. Any further reporting commands will result in error 406.

Added logic to use the unnamed entry ('Unnamed Project') as project name when there is no package wrapping the class.

Signed-off-by: Marat Strelets <marat@testproject.io>
@mstrelex
Copy link
Member Author

Copied PR description to the commit message.

@mstrelex mstrelex merged commit 9994050 into master Jul 15, 2020
@mstrelex mstrelex deleted the bugs/TP-11941 branch July 15, 2020 19:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants