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

Tickets #43

Merged
merged 29 commits into from
Feb 15, 2024
Merged

Tickets #43

merged 29 commits into from
Feb 15, 2024

Conversation

dukris
Copy link
Collaborator

@dukris dukris commented Feb 8, 2024

@h1alexbel take a look, please
Closes #34
Closes #11
Closes #47


PR-Codex overview

This PR focuses on renaming tables and columns in the database schema. It also includes changes related to projects, tickets, and requests.

Detailed summary

  • Renamed projects.projects table to projects.project
  • Renamed projects.performers table to projects.performer
  • Renamed Projects.byUser method parameter from email to login
  • Added Projects.employ method with Scalar<Project> parameter
  • Added Projects.byId method with UUID parameter
  • Updated SQL queries in various files
  • Added new JSON data files for project, ticket, and request
  • Updated test classes and resources
  • Added new package-info files

The following files were skipped due to too many changes: src/main/resources/db/changelog/2024/004-performers-naming.sql, src/main/resources/sql/insert-ticket.sql, src/main/resources/db/changelog/2024/003-naming.sql, src/main/java/git/tracehub/pmo/platforms/Platform.java, src/main/java/git/tracehub/pmo/security/ExistsRole.java, src/main/java/git/tracehub/pmo/controller/request/RqProject.java, src/main/java/git/tracehub/pmo/project/Project.java, src/main/java/git/tracehub/pmo/controller/request/TicketFromReq.java, src/main/java/git/tracehub/pmo/controller/request/ProjectFromReq.java, src/main/resources/db/changelog/2024/002-tickets.sql, src/main/java/git/tracehub/pmo/ticket/Tickets.java, src/main/java/git/tracehub/pmo/project/DefaultProjects.java, src/test/java/git/tracehub/pmo/security/ExistsRoleTest.java, src/main/java/git/tracehub/pmo/controller/request/RqTicket.java, src/main/java/git/tracehub/pmo/ticket/TicketOf.java, src/test/java/git/tracehub/pmo/project/MockProject.java, src/test/java/git/tracehub/pmo/request/ProjectFromReqTest.java, src/test/java/git/tracehub/pmo/ticket/MockTicket.java, src/test/java/git/tracehub/pmo/request/TicketFromReqTest.java, src/test/java/it/web/RetrieveProjectByIdITCase.java, src/main/java/git/tracehub/pmo/platforms/github/Github.java, src/main/java/git/tracehub/pmo/ticket/Ticket.java, src/main/java/git/tracehub/pmo/controller/TicketController.java, src/main/java/git/tracehub/pmo/ticket/DefaultTickets.java, src/test/java/git/tracehub/pmo/ticket/TicketOfTest.java, src/test/java/git/tracehub/pmo/controller/ProjectControllerTest.java, src/test/java/it/database/DefaultProjectsIT.java, src/test/java/it/database/DefaultTicketsIT.java, src/test/java/it/web/RetrieveTicketByJobITCase.java, src/test/java/it/web/RetrieveTicketByNumberITCase.java, src/main/java/git/tracehub/pmo/controller/ProjectController.java, src/main/java/git/tracehub/pmo/controller/AdviceController.java, src/test/java/it/web/CreateTicketITCase.java, src/test/java/git/tracehub/pmo/controller/TicketControllerTest.java, src/test/java/git/tracehub/pmo/project/DefaultProjectsTest.java, src/test/java/git/tracehub/pmo/ticket/DefaultTicketsTest.java

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

Attention: 28 lines in your changes are missing coverage. Please review.

Comparison is base (fa5ef9e) 60.81% compared to head (cc0964d) 79.18%.

Files Patch % Lines
...java/git/tracehub/pmo/platforms/github/Github.java 0.00% 15 Missing ⚠️
.../git/tracehub/pmo/controller/AdviceController.java 45.45% 12 Missing ⚠️
src/main/java/git/tracehub/pmo/ticket/Ticket.java 95.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master      #43       +/-   ##
=============================================
+ Coverage     60.81%   79.18%   +18.37%     
- Complexity       59      104       +45     
=============================================
  Files            24       34       +10     
  Lines           245      370      +125     
  Branches          7        7               
=============================================
+ Hits            149      293      +144     
+ Misses           92       73       -19     
  Partials          4        4               

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dukris dukris requested a review from h1alexbel February 9, 2024 13:25
Copy link
Collaborator

@h1alexbel h1alexbel left a comment

Choose a reason for hiding this comment

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

@hizmailovich check my comments, please

src/main/java/git/tracehub/pmo/project/Project.java Outdated Show resolved Hide resolved
src/main/java/git/tracehub/pmo/ticket/Ticket.java Outdated Show resolved Hide resolved
src/test/java/git/tracehub/pmo/database/JdbcTest.java Outdated Show resolved Hide resolved
src/test/java/git/tracehub/pmo/database/JdbcTest.java Outdated Show resolved Hide resolved
Copy link
Collaborator

@h1alexbel h1alexbel left a comment

Choose a reason for hiding this comment

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

@hizmailovich regarding table naming

@dukris dukris requested a review from h1alexbel February 13, 2024 10:54
Copy link
Collaborator

@h1alexbel h1alexbel left a comment

Choose a reason for hiding this comment

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

@hizmailovich take a look at my comments, please

*
* @since 0.0.0
*/
public interface Platform {
Copy link
Collaborator

Choose a reason for hiding this comment

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

the design of this interface is not scalable, since you will add methods when something will be changed. All your methods are operating with 2 params: Scalar<String> token and Scalar<String> location, so first thing you can do is to introduce just one method that does all of that above:

final class Some implements Platform {
  private final Scalar<String> token;
  private final Scalar<String> location;
  void prepare() {
  // prepare some platform since we have location and token
  }
}

also, I suggest to encapsulate not a location and token but a whole platform itself, like Github -> RtGithub. I think we can something similar with GitLab, Bitbucket and so on

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 used that approach to create a map of beans (platforms) to avoid if-else, but your idea looks better.
Regarding platform encapsulation, it's not suitable here, because of CreateWebhook action, which uses http-requests instead of RtGithub, thus we have to encapsulate both location and token

src/main/resources/db/changelog/2024/003-naming.sql Outdated Show resolved Hide resolved
@@ -153,4 +201,17 @@ void throwsOnCreatingInvalidProject() throws SQLException {
).affirm();
}

private void mock(final Project project) throws SQLException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

how about introducing fake project?

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 don't need to retrieve a project as a result, I just want to inject this project into result set
But I removed this private method

@dukris dukris requested a review from h1alexbel February 14, 2024 10:57
Copy link
Collaborator

@h1alexbel h1alexbel left a comment

Choose a reason for hiding this comment

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

@hizmailovich just one comment

*
* @return Map of implemented platforms
*/
@Bean
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we automate this one using collection autowiring in spring?

@dukris dukris requested a review from h1alexbel February 15, 2024 11:05
@h1alexbel
Copy link
Collaborator

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Feb 15, 2024

@rultor merge

@h1alexbel Thanks for your request; @hizmailovich please confirm this.

@dukris
Copy link
Collaborator Author

dukris commented Feb 15, 2024

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Feb 15, 2024

@rultor merge

@hizmailovich OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit cc0964d into master Feb 15, 2024
8 checks passed
@rultor
Copy link
Collaborator

rultor commented Feb 15, 2024

@rultor merge

@hizmailovich Done! FYI, the full log is here (took me 3min)

@dukris dukris deleted the 34 branch February 15, 2024 13:01
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.

Change performer email to login Endpoints for ticket information Define a Liquibase schema for a database
4 participants