Skip to content

[O2B-1631] Allow users to link logs to simulation passes - #2251

Merged
graduta merged 3 commits into
mainfrom
feature/O2B-1631/logs-linked-to-simulation-passes
Oct 19, 2026
Merged

graduta merged 3 commits into
mainfrom
feature/O2B-1631/logs-linked-to-simulation-passes

Conversation

@graduta

@graduta graduta commented Oct 19, 2026

Copy link
Copy Markdown
Member

I have a JIRA ticket

  • branch and/or PR name(s) include(s) JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected

Notable changes for users:

  • Users can no link log entries to simulation passes, similar to data passes.

Notable changes for developers:

  • endpoints updated accordingly

Changes made to the database:

  • added new table in the database migration files for keeping a one to many table

Add the log_simulation_passes join table (migration, table model and
repository) and the Log <-> SimulationPass many-to-many associations,
plus a seeder linking some logs to simulation passes.
…e API

POST /api/logs now accepts a `simulationPasses` list of names. Names are
resolved in a single query (an error lists every unknown name), the links
are stored when the log is created, and the created log and GET
/api/logs/:id return its simulation passes as { id, name }.

createLog and LogService.create take a new simulationPassNames argument.
Includes service, use case and API tests.
Add a "Simulation passes" field (comma separated names) to the log
creation page, sent as `simulationPasses[]`. Replying to a log pre-fills
it with the simulation passes of the parent log. Includes UI tests.
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.54321% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.49%. Comparing base (7df2a7b) to head (9e192ab).

Files with missing lines Patch % Lines
lib/public/views/Logs/Create/LogCreationModel.js 0.00% 12 Missing ⚠️
lib/public/views/Logs/Create/LogReplyModel.js 0.00% 3 Missing ⚠️
...b/public/views/Logs/Create/logCreationComponent.js 0.00% 3 Missing ⚠️
.../v1/20261019100000-create-log-simulation-passes.js 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2251      +/-   ##
==========================================
+ Coverage   46.35%   46.49%   +0.13%     
==========================================
  Files        1047     1051       +4     
  Lines       17268    17341      +73     
  Branches     3140     3156      +16     
==========================================
+ Hits         8004     8062      +58     
- Misses       9264     9279      +15     

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

🚀 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Collection responses omit saved associations, and the log display does not render them.

2 open issues
What changed in this PR

Adds simulation-pass associations to logs, extending the existing data-pass linking workflow.

Changes:

  • Adds database storage, associations, and adapters.
  • Extends log creation, individual retrieval, and reply inheritance.
  • Adds service, API, and browser tests.
File Description
test/​public/​logs/​create.test.js Tests form inheritance and creation.
test/​lib/​usecases/​log/​CreateLogUseCase.test.js Tests linking and unknown names.
test/​lib/​server/​services/​simulationPasses/​index.js Registers lookup tests.
test/​lib/​server/​services/​simulationPasses/​getAllSimulationPassesByNameOrFail.test.js Tests simulation-pass lookup.
test/​lib/​server/​services/​log/​LogService.test.js Tests service-level linking.
test/​api/​logs.test.js Tests creation and individual retrieval.
lib/​usecases/​log/​GetLogUseCase.js Loads simulation-pass associations.
lib/​usecases/​log/​CreateLogUseCase.js Deduplicates and forwards pass names.
lib/​server/​services/​simulationPasses/​getAllSimulationPassesByNameOrFail.js Resolves names and rejects missing passes.
lib/​server/​services/​run/​RunService.js Adjusts positional creation arguments.
lib/​server/​services/​run/​logEntriesCreation/​logSpecificRunTag.js Preserves transaction argument placement.
lib/​server/​services/​run/​logEntriesCreation/​logRunQualityChange.js Preserves transaction argument placement.
lib/​server/​services/​run/​logEntriesCreation/​logCalibrationStatusChange.js Preserves transaction argument placement.
lib/​server/​services/​log/​LogService.js Accepts and retrieves linked passes.
lib/​server/​services/​log/​createLog.js Persists simulation-pass links.
lib/​public/​views/​Logs/​Create/​LogReplyModel.js Inherits parent simulation passes.
lib/​public/​views/​Logs/​Create/​LogCreationModel.js Stores and submits pass names.
lib/​public/​views/​Logs/​Create/​logCreationComponent.js Adds simulation-pass input.
lib/​domain/​entities/​Log.js Documents linked passes.
lib/​domain/​dtos/​CreateLogDto.js Validates simulation-pass arrays.
lib/​database/​tables/​logsimulationpasses.js Defines the junction model.
lib/​database/​tables/​index.js Registers the junction model.
lib/​database/​seeders/​20240125141300-log-simulation-passes.js Seeds example associations.
lib/​database/​repositories/​LogSimulationPassesRepository.js Inserts association records.
lib/​database/​repositories/​index.js Exports the new repository.
lib/​database/​models/​typedefs/​SequelizeLog.js Documents the database association.
lib/​database/​models/​simulationPass.js Associates passes with logs.
lib/​database/​models/​log.js Associates logs with passes.
lib/​database/​migrations/​v1/​20261019100000-create-log-simulation-passes.js Creates the junction table.
lib/​database/​adapters/​SimulationPassAdapter.js Adds minimal pass serialization.
lib/​database/​adapters/​LogAdapter.js Serializes linked simulation passes.
lib/​database/​adapters/​index.js Wires the simulation-pass adapter.

Review effort: Balanced

Comment thread lib/database/adapters/LogAdapter.js
Comment thread lib/public/views/Logs/Create/logCreationComponent.js
@graduta
graduta merged commit 84122e4 into main Oct 19, 2026
26 checks passed
@graduta
graduta deleted the feature/O2B-1631/logs-linked-to-simulation-passes branch October 19, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants