Skip to content

Conversation

hbalty
Copy link
Contributor

@hbalty hbalty commented Aug 1, 2025

No description provided.

@revu-bot revu-bot bot requested a review from revu-bot August 1, 2025 15:45
@hbalty hbalty force-pushed the feat-log-structure-user-activity branch from 4cfef76 to 0a01cfa Compare August 1, 2025 15:46
Copy link
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

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

This PR implements structured logging for user activity across admin and user operations. While the logging implementation is comprehensive, there are several critical issues: a console.log statement in production code, inconsistent action naming patterns, and architectural concerns with direct controller instantiation. The logging context types are well-structured, but some actions have misleading names and there's potential for logging sensitive operations without proper context.

@hbalty hbalty temporarily deployed to build-review-auto August 1, 2025 15:46 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 1, 2025 15:46 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 1, 2025 15:46 — with GitHub Actions Inactive
@hbalty hbalty had a problem deploying to build-review-auto August 1, 2025 15:46 — with GitHub Actions Failure
@hbalty hbalty force-pushed the feat-log-structure-user-activity branch from 0a01cfa to c7cebb9 Compare August 4, 2025 12:14
@hbalty hbalty temporarily deployed to build-review-auto August 4, 2025 12:14 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 4, 2025 12:14 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 4, 2025 12:14 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 4, 2025 12:14 — with GitHub Actions Inactive
@hbalty hbalty marked this pull request as draft August 8, 2025 14:07
@hbalty hbalty force-pushed the feat-log-structure-user-activity branch from c7cebb9 to 4d43fd0 Compare August 11, 2025 11:08
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 11:08 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 11:08 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 11:08 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 11:08 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 11:17 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 11:17 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 11:17 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 11:17 — with GitHub Actions Inactive
@hbalty hbalty requested a review from pYassine August 11, 2025 14:48
Copy link
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

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

This PR adds structured logging for user activity operations (create, delete, role changes) across both structure and admin contexts. The implementation includes proper log context types and integrates logging into existing user management flows. However, there are several critical issues that need attention: missing userId in log context for delete operations, inconsistent action naming in admin controller, and potential null reference errors in role change logging.

Copy link
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

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

This PR adds structured logging for user activity operations (create, delete, role changes) across both structure and admin contexts. The implementation includes proper log context types and integrates logging into existing user management flows. However, there are several critical issues that need attention: missing userId in log context for delete operations, inconsistent action naming in admin controller, and potential null reference errors in role change logging.

@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.70%. Comparing base (177fb1f) to head (dcaa216).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
.../controllers/admin-users/admin-users.controller.ts 50.00% 1 Missing ⚠️
.../src/modules/users/controllers/users.controller.ts 83.33% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3826      +/-   ##
==========================================
- Coverage   65.70%   65.70%   -0.01%     
==========================================
  Files         970      971       +1     
  Lines       16238    16245       +7     
  Branches     2245     2241       -4     
==========================================
+ Hits        10669    10673       +4     
- Misses       5224     5365     +141     
+ Partials      345      207     -138     
Files with missing lines Coverage Δ
...mmon/mocks/USER_SUPERVISOR_AUTHENTIFICATED.mock.ts 100.00% <100.00%> (ø)
.../controllers/admin-users/admin-users.controller.ts 49.33% <50.00%> (+0.68%) ⬆️
.../src/modules/users/controllers/users.controller.ts 59.49% <83.33%> (+1.38%) ⬆️

... and 61 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 177fb1f...dcaa216. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 15:04 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 15:04 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 15:04 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 15:04 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 17:14 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 17:14 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 17:14 — with GitHub Actions Inactive
@hbalty hbalty temporarily deployed to build-review-auto August 11, 2025 17:14 — with GitHub Actions Inactive
Copy link

@tokenbureau
Copy link

tokenbureau bot commented Aug 11, 2025

🎉 Deployment for commit dcaa216 :

Ingresses
Docker images
  • 📦 docker pull harbor.fabrique.social.gouv.fr/domifa/domifa/backend:sha-dcaa216fd33e0587dbd24ae3147c4038495c62ad
  • 📦 docker pull harbor.fabrique.social.gouv.fr/domifa/domifa/frontend:sha-dcaa216fd33e0587dbd24ae3147c4038495c62ad
  • 📦 docker pull harbor.fabrique.social.gouv.fr/domifa/domifa/portail-admins:sha-dcaa216fd33e0587dbd24ae3147c4038495c62ad
  • 📦 docker pull harbor.fabrique.social.gouv.fr/domifa/domifa/portail-usagers:sha-dcaa216fd33e0587dbd24ae3147c4038495c62ad
Debug

@pYassine pYassine merged commit be31de1 into master Aug 12, 2025
19 checks passed
@pYassine pYassine deleted the feat-log-structure-user-activity branch August 12, 2025 11:32
@tokenbureau
Copy link

tokenbureau bot commented Aug 12, 2025

🎉 This PR is included in version 2.213.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@tokenbureau tokenbureau bot added the released label Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants