Skip to content

Add project service module with key generation and existence checks#7

Open
angelmp01 wants to merge 5 commits intodevelopfrom
chore/project-service
Open

Add project service module with key generation and existence checks#7
angelmp01 wants to merge 5 commits intodevelopfrom
chore/project-service

Conversation

@angelmp01
Copy link
Collaborator

No description provided.

@angelmp01 angelmp01 requested a review from jorge-romero March 5, 2026 11:05
@angelmp01 angelmp01 changed the base branch from master to develop March 5, 2026 12:12
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

1 similar comment
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

@angelmp01 angelmp01 force-pushed the chore/project-service branch from 78c4242 to a7eaadf Compare March 11, 2026 14:33
@github-actions
Copy link

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

name: ODS Team
version: v0.0.1
servers:
- url: http://{baseurl}/api/v0
Copy link
Collaborator

Choose a reason for hiding this comment

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

The old API was /api/pub/v0, but maybe we can keep it in this way

@PostMapping
@Override
public ResponseEntity<CreateProjectResponse> createProject(@Valid @RequestBody CreateProjectRequest createProjectRequest) {
try {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add logs when the call is innitiate to start with the "auditory"
As an example:
log.info("Triggering membership request for account '{}' of user '{}' to project '{}' with role '{}'",
addUserToProjectRequest.getAccount(), addUserToProjectRequest.getUser(), projectKey, addUserToProjectRequest.getRole());

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you want to add a info message saying start in every method in all the controllers? In this case we can implement something with AOP. What do you think about it?

notFoundResponse.setError("NOT_FOUND");
notFoundResponse.setErrorKey("PROJECT_NOT_FOUND");
notFoundResponse.setMessage(String.format("Project with key '%s' not found", projectKey));
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(notFoundResponse);
Copy link
Collaborator

Choose a reason for hiding this comment

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

ResponseEntity.notFound().build()

Check if this make sense

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But I need to add a body content, I cannot use this mehtod.

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@SpringBootTest(classes = ProjectControllerIntegrationTest.TestConfig.class)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is not exactly an integration tests.
Here it is been tested that a post goes from the controller to the service without problems, but even the service is being mocked


@Service
@Slf4j
public class ProjectServiceImpl implements ProjectService {
Copy link
Collaborator

Choose a reason for hiding this comment

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

use:
@AllArgsConstructor instead of having the current constructor like you have in the controller.

import org.opendevstack.apiservice.externalservice.ocp.service.OpenshiftService;
import org.opendevstack.apiservice.serviceproject.service.GenerateProjectKeyService;

@ExtendWith(MockitoExtension.class)
Copy link
Collaborator

Choose a reason for hiding this comment

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

And the tests???????

<include>**/*Test.java</include>
</includes>
<systemPropertyVariables>
<spring.config.location>${SPRING_CONFIG_DIR}</spring.config.location>
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is needed, defining the variable is not enough?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you need this config if you try to execute an isolate test within the IDE to debug it.

Copy link
Collaborator

@jorge-romero jorge-romero left a comment

Choose a reason for hiding this comment

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

Pleas have a look at my comments

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.

2 participants