Skip to content

Conversation

@david-monichi
Copy link
Contributor

No description provided.

@david-monichi david-monichi requested review from clepski and Copilot July 16, 2025 20:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a soft-delete mechanism for SCL files by adding an is_deleted flag, updating repository implementations to respect it, and making the feature togglable via configuration.

  • Add is_deleted column to the scl_file table with a Flyway migration.
  • Introduce SoftDeleteCompasSclDataPostgreSQLRepository and a producer to switch implementations based on a feature flag.
  • Update all queries to exclude soft-deleted records and document the new column.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
repository/pom.xml Added quarkus-arc dependency to support CDI in Quarkus configuration.
repository-postgresql/src/main/resources/.../V1_5__add_soft_delete_flag.sql Migration to add the is_deleted boolean column with default false.
repository-postgresql/src/main/java/.../SoftDeleteCompasSclDataPostgreSQLRepository.java New repository variant overriding delete to set the soft-delete flag instead of hard delete.
repository-postgresql/src/main/java/.../CompasSclDataPostgreSQLRepositoryConfiguration.java CDI producer that selects between the default and soft-delete repository based on a config property.
repository-postgresql/src/main/java/.../CompasSclDataPostgreSQLRepository.java Added AND scl_file.is_deleted = false to existing queries to filter out soft-deleted records.
doc/postgresql.md Documented the new is_deleted column in the table schema.
doc/development.md New guide for running the application locally with Keycloak and PostgreSQL.
app/src/test/resources/docker-compose.yml Docker Compose setup for Keycloak and PostgreSQL to support local development/testing.
app/src/main/resources/application.properties Declared the soft-delete-enabled feature flag property.
app/src/main/resources/application-local.properties Enabled soft delete and Flyway migrations for local development profile.
app/src/main/resources/application-dev-postgresql.properties Changed default DB credentials for the dev PostgreSQL profile to compas/compas.
README.md Added link to the new development documentation.
Comments suppressed due to low confidence (2)

doc/postgresql.md:40

  • The 'Null' column is marked as 'False', but the migration does not enforce NOT NULL. Either update this to 'True' or add NOT NULL in the migration.
| is_deleted    | boolean      | False    | Flag indicating whether the record is marked as deleted            |

repository-postgresql/src/main/java/org/lfenergy/compas/scl/data/repository/postgresql/SoftDeleteCompasSclDataPostgreSQLRepository.java:27

  • [nitpick] Consider adding unit or integration tests to verify that the delete method correctly sets is_deleted and that filtered queries exclude soft-deleted records.
    public void delete(SclFileType type, UUID id) {

@david-monichi david-monichi force-pushed the feature/464_add-soft-delete-feature branch from 3f78132 to fc68569 Compare July 16, 2025 20:30
@david-monichi david-monichi force-pushed the feature/464_add-soft-delete-feature branch from 066fcc0 to f8c6b88 Compare July 21, 2025 12:27
@sonarqubecloud
Copy link

@david-monichi david-monichi merged commit 3b8b496 into main Jul 21, 2025
9 checks passed
@david-monichi david-monichi deleted the feature/464_add-soft-delete-feature branch July 21, 2025 13:40
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.

3 participants