-
Notifications
You must be signed in to change notification settings - Fork 13
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
Migrate OSRM settings #1087
base: main
Are you sure you want to change the base?
Migrate OSRM settings #1087
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing major
packages/chaire-lib-backend/src/utils/processManagers/OSRMProcessManager.ts
Outdated
Show resolved
Hide resolved
[mode]: { | ||
defaultEngine: 'osrmRouting', | ||
engines: { | ||
osrmRouting: {enabled: false} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please run yarn format
before committing as it will change the formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran the command but it didn't change this part specifically
packages/chaire-lib-backend/src/utils/processManagers/OSRMProcessManager.ts
Show resolved
Hide resolved
@@ -188,13 +202,16 @@ describe('OSRM Service Manager', function() { | |||
const prepareResult = await OSRMServicePreparation.prepare(existingOsmFilePath, ['walking']); | |||
expect(prepareResult.status).toBe('prepared'); | |||
|
|||
const osrmModes = ServerConfig.getAllModesForEngine("osrmRouting"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you could make sure the returned modes are as expected and there is no unexpected modes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is already tested in another test. It also just returns all modes in the config that have the osrmROuting engine, regardless of whether they are disabled or not, so nothing done in this test should be capable of changing the excepted result
packages/chaire-lib-common/src/services/routing/OSRMRoutingService.ts
Outdated
Show resolved
Hide resolved
packages/chaire-lib-common/src/services/routing/OSRMRoutingService.ts
Outdated
Show resolved
Hide resolved
8551222
to
cbce23c
Compare
osrmServerPrefs.modes[routingMode].enabled === true && | ||
osrmServerPrefs.modes[routingMode].autoStart !== true | ||
) { | ||
const osrmModeConfig = ServerConfig.getRoutingEngineConfigForMode(routingMode, 'osrmRouting'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai oublié de le mentionner au premier review, mais il faudrait que tout reste compatible avec le fichier de config actuel (par exemple, la configuration de nos instances ne sera probablement pas mise à jour exactement en même temps que le prochain update de transition une fois cette PR mergée). Regarde ce qui a été fait pour la config trRoutingCacheAllScenarios
dans server.config.ts
, in the setProjectConfiguration
function, if the old way of configuring is set, but now the new way, it is merged to make sure old configs still work. You can do something similar for the osrm routing's default preferences
Migrate OSRM settings from the defaultPreferences.config.ts file in chaire-lib-common to server.config,ts file in chaire-lib-backend
Also adds some todos as a reminder to rework some settings that can't be moved at the moment.
Fix: #1084