Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup Merlin Code #841

Merged
merged 16 commits into from
Apr 18, 2023
Merged

Conversation

Mythicaeda
Copy link
Contributor

@Mythicaeda Mythicaeda commented Apr 4, 2023

Description

Read the commit history for a detailed breakdown of exactly what was removed or changed. Overall, however, this PR:

  • Removes all unused classes and most unused methods present in merlin-server, merlin-driver, and merlin-worker.
  • Performs small tweaks to several other classes in those three folders (ie: removing unused imports or inverting a method whose return value is always negated when called)
  • Flattened the interface and implementation of interfaces that only had one implementation.
  • Removed the InMemoryStore option from the AerieAppDriver. This change was made as these classes are only functional insofar as they will pass tests. For example, since InMemoryMissionModelRepository isn't used in testing, nearly all of its methods are stubs.

Verification

Tests that didn't test live code were removed, as well as tests that have been disabled since November 2021.

#840 was created to address a gap I noticed in MerlinBindingsTests.

#871 was created to address a gap noticed in EventGraphEvaluator.

Documentation

No documentation changes should be necessary.

Future work

Most of the InMemory_ code is only used in tests of InMemory code, rather than being used to avoid having unit tests of things like the SimulationDriver turn into e2eTests. I'd like to take a finer tooth comb and see if we can either drop these classes entirely or actually use them in tests of live Merlin code.

@Mythicaeda Mythicaeda added the refactor A code change that neither fixes a bug nor adds a feature label Apr 4, 2023
@Mythicaeda Mythicaeda requested a review from a team as a code owner April 4, 2023 00:54
@Mythicaeda Mythicaeda self-assigned this Apr 4, 2023
@Mythicaeda Mythicaeda temporarily deployed to e2e-test April 4, 2023 00:54 — with GitHub Actions Inactive
@Mythicaeda Mythicaeda changed the title Remove vestigal classes from Merlin Remove vestigal code from Merlin Apr 4, 2023
@Mythicaeda Mythicaeda changed the title Remove vestigal code from Merlin Cleanup Merlin Code Apr 4, 2023
@Mythicaeda Mythicaeda force-pushed the refactor/remove-vestigal-classes-merlin-server branch from 4cb174e to 96940a2 Compare April 4, 2023 15:43
@Mythicaeda Mythicaeda temporarily deployed to e2e-test April 4, 2023 16:01 — with GitHub Actions Inactive
@Mythicaeda Mythicaeda force-pushed the refactor/remove-vestigal-classes-merlin-server branch from 96940a2 to 108d249 Compare April 17, 2023 18:51
@Mythicaeda Mythicaeda temporarily deployed to e2e-test April 17, 2023 18:51 — with GitHub Actions Inactive
Copy link
Member

@camargo camargo left a comment

Choose a reason for hiding this comment

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

LGTM based on your overview yesterday. Let's get sign off from @mattdailis as well.

* Replaced with Plan.java, which has identical behavior but tracked ActivityDirectiveIds
* Renamed InMemoryPlanRepository.createPlan to InMemoryPlanRepository.storePlan. Appears to be more accurate based on behavior with the replacement of NewPlan with Plan
- CreatedEntity
- NewMissionModel
- ActivityTransaction
- PostgresPlanTransaction
- AssociatePlanDatasetAction
- CreateDatasetPartitionsAction
- UpdatePlanAction
- Window
- BreadcrumbCursor
- DevAppDriver
- Fixtures
- TaskSource
- NoSuchActivityInstanceException
- UnexpectedMissingPlanException
- UnexpectedMissingMissionModelException
- UnexpectedJSONException
- NewMissionModelValidationException
- PostrgesMissionModelRepository.GetUnusedFilename
- PostgresResultsCellRepository.getPlan
- PlanRepository.getAllActivitiesInPlan
- Remove unneeded variable from PostgresPlanRepository.createPlanDataset
- Remove redundant 'final' modifier from ProfileRecord and InMemoryRevisionData
- Simplify 'if' in InMemoryCell.failWith
- Convert Worker into a record
- Remove unused import in SynchronousSimulationAgent, EffectExpressionDisplay, and CellRef
- Convert statement lambdas to expression lambdas in MerlinBindings
- Remove unthrown exceptions from InMemoryMissionModelRepository
- Simplify SchedulingInstant.compareTo
- Rename activityInstanceIdP to activityDirectiveIdP in MerlinParsers
- Remove unused empty constructor for IntegrationFailureException
- Remove isColumnNull() from GetModelConstraintsAction, GetPlanConstraintsAction, and GetSpanRecords
- Breadcrumb was only used by ValidationException, which has been moved to the parsers.
Its parent class had no other inheritors, so these tests were also effectively disabled
Deletion of Simulation Datasets should be initiated by the user. User defined automation of deletion should be done through the Aerie API, not Aerie Merlin
- Remove other unused code in MerlinBindingsTest
- Remove FakeFile, which is unused as of MerlinBindingsTest changes
The InMemory versions of the repositories are either stubs or only defined enough to be used in testing. Therefore, we should remove the ability to initiate Aerie using an InMemoryStore.

- Remove classes that are unused as of this pruning
@Mythicaeda Mythicaeda force-pushed the refactor/remove-vestigal-classes-merlin-server branch from 108d249 to c082e8c Compare April 18, 2023 22:28
@Mythicaeda Mythicaeda temporarily deployed to e2e-test April 18, 2023 22:28 — with GitHub Actions Inactive
@Mythicaeda Mythicaeda merged commit f9cfe6f into develop Apr 18, 2023
@Mythicaeda Mythicaeda deleted the refactor/remove-vestigal-classes-merlin-server branch April 18, 2023 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor A code change that neither fixes a bug nor adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove vestigial test classes from merlin-server
3 participants