Skip to content

Replace echo missions with just using mission definitions - #2694

Merged
andchiind merged 6 commits into
equinor:mainfrom
andchiind:2693-goodbye-mission-planner
May 19, 2026
Merged

Replace echo missions with just using mission definitions#2694
andchiind merged 6 commits into
equinor:mainfrom
andchiind:2693-goodbye-mission-planner

Conversation

@andchiind

@andchiind andchiind commented May 5, 2026

Copy link
Copy Markdown
Contributor

Things to do after merging this PR:

  • Update the IsarMissionDefinition.cs constructor for IsarTaskDefinition so that we send the analysistype to ISAR. At the same time ISAR should have a PR where we make use of this value
  • Start migrating echo missions to mission definitions. The missions will not be available to run until we do this. The analysistype defaults to NoAnalysis, but until SARA makes use of this value that doesn't matter

Ready for review checklist:

  • A self-review has been performed
  • All commits run individually
  • Temporary changes have been removed, like console.log, TODO, etc.
  • The PR has been tested locally
  • A test has been written
    • This change doesn't need a new test
  • Relevant issues are linked
  • Remaining work is documented in issues
    • There is no remaining work from this PR that require new issues
  • The changes does not introduce dead code as unused imports, functions etc.

@andchiind andchiind self-assigned this May 5, 2026
@andchiind andchiind added backend Backend related functionality breaking-change A breaking change which introduces changes to the public APIs database-change Will require migration labels May 5, 2026
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown

🔔 Changes in database files detected 🔔
Do these changes require adding new migrations? 🤔 In that case follow these steps.
If you are uncertain, ask a database admin on the team 😄

@andchiind
andchiind force-pushed the 2693-goodbye-mission-planner branch 3 times, most recently from fe6fde7 to 1f606d3 Compare May 5, 2026 06:19
Comment thread backend/api.test/Controllers/InspectionAreaControllerTests.cs Outdated
Comment thread backend/api/Database/Models/MissionTaskDefinition.cs
@andchiind
andchiind force-pushed the 2693-goodbye-mission-planner branch 2 times, most recently from d30604f to 54646fe Compare May 5, 2026 08:41
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown

🔔 Migrations changes detected 🔔
📣 Remember to comment "/UpdateDatabase" after review approval for migrations to take effect!

@andchiind
andchiind force-pushed the 2693-goodbye-mission-planner branch 6 times, most recently from 3f72478 to 44d7719 Compare May 6, 2026 10:41
@andchiind andchiind changed the title Secret PR Replace echo missions with just using mission definitions May 6, 2026
@andchiind
andchiind marked this pull request as ready for review May 6, 2026 10:41
@andchiind
andchiind force-pushed the 2693-goodbye-mission-planner branch 3 times, most recently from 8b2fe8a to 8563f5e Compare May 6, 2026 10:51
Comment thread backend/api/Controllers/Models/MissionDefinitionResponse.cs
Comment thread backend/api/Controllers/Models/PlantInfo.cs
Comment thread backend/api/Database/Models/MissionTask.cs Outdated
Comment thread backend/api/Database/Models/TaskDefinition.cs Outdated
Comment thread backend/api/Database/Models/MissionDefinition.cs
Comment thread backend/api/Database/Context/FlotillaDbContext.cs
Comment thread backend/api/Controllers/MissionDefinitionController.cs Outdated
Comment thread backend/api/Controllers/MissionDefinitionController.cs Outdated
Comment thread backend/api/Database/Models/MissionTask.cs
Comment thread backend/api/Controllers/Models/MissionDefinitionResponse.cs Outdated
Comment thread frontend/src/models/MissionDefinition.ts Outdated
@andchiind
andchiind force-pushed the 2693-goodbye-mission-planner branch 3 times, most recently from a0a7b1a to 0966d88 Compare May 11, 2026 09:32
@andchiind
andchiind force-pushed the 2693-goodbye-mission-planner branch 4 times, most recently from f24e72f to 28b6d5d Compare May 12, 2026 08:42
@andchiind
andchiind requested a review from aeshub May 12, 2026 09:54
Comment thread frontend/src/components/Dialogs/MissionEditDialog.tsx Outdated
Comment thread frontend/src/models/Inspection.ts Outdated
Comment thread frontend/src/models/MissionDefinition.ts Outdated
Comment thread backend/api/Database/Models/TaskDefinition.cs
Comment thread backend/api/Services/MissionDefinitionService.cs
@andchiind
andchiind force-pushed the 2693-goodbye-mission-planner branch 6 times, most recently from 436a6c5 to 40f2fa5 Compare May 12, 2026 14:16
@andchiind
andchiind requested a review from Christdej May 12, 2026 14:19

@Christdej Christdej left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@andchiind
andchiind force-pushed the 2693-goodbye-mission-planner branch 3 times, most recently from 56f6e00 to a23a008 Compare May 13, 2026 11:05
@aeshub

aeshub commented May 17, 2026

Copy link
Copy Markdown
Contributor

Added: wire analysis_types through to ISAR

Two commits on top of this PR to finish the wiring from the new AnalysisTypes model into the ISAR start-mission contract:

  • Add analysis_types to ISAR mission definition (4465eb7) — adds the analysis_types field to the IsarInspectionDefinition JSON struct so the per-inspection analysis list is included in the body of the POST to ISAR's /schedule/start-mission. Flotilla enum values are mapped to the keys SARA understands (Fencilla"fencilla", CLOE"cloe", ThermalReading"thermal-reading", CO2"co2"). Empty / null input serialises as null, which makes SARA fall back to its file-extension default. Pairs with Add analysis_types passthrough from Flotilla to SARA isar#1133 and Rebuild SARA around generic Analysis pipeline sara#363.

  • Set AnalysisTypes on MissionTask in ToMissionRunTask (155a2d6) — drive-by: MissionTask.AnalysisTypes was added in this PR but never populated by TaskDefinition.ToMissionRunTask() (only the nested Inspection.AnalysisTypes was set). That made the field silently empty for every scheduled mission and zeroed it out on the round-trip through ToMissionTaskDefinition. Now populated from the same source.

Two new unit tests in IsarMissionDefinitionTests.cs cover the snake_case wire format and the drive-by.

andchiind and others added 6 commits May 19, 2026 09:13
Wire AnalysisTypes from the per-run Inspection into the JSON
contract ISAR expects on /schedule/start-mission, so SARA can
read it from the resulting MQTT inspection-result payload.

Flotilla AnalysisType enum values are mapped to the strings SARA
recognises (fencilla, cloe, thermal-reading, co2). Null or empty
input serialises as null, in which case SARA falls back to its
file-extension default.
The AnalysisTypes field on MissionTask was added alongside the
analysis-types model but was never populated when a TaskDefinition
template was turned into a runtime MissionTask. The data was only
copied onto the nested Inspection. This left MissionTask.AnalysisTypes
silently empty for every scheduled mission, and meant the round-trip
back through ToMissionTaskDefinition zeroed out the analysis types.

Populate both fields from the same source so the model is
internally consistent.
@andchiind
andchiind force-pushed the 2693-goodbye-mission-planner branch from 1766809 to c9d03e1 Compare May 19, 2026 07:13
@andchiind
andchiind merged commit 6e07168 into equinor:main May 19, 2026
12 checks passed
@andchiind

Copy link
Copy Markdown
Contributor Author

/UpdateDatabase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend related functionality breaking-change A breaking change which introduces changes to the public APIs database-change Will require migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store mission definition tasks in the source object directly instead of linking to echo

3 participants