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

Migrate OSRM settings #1087

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GabrielBruno24
Copy link
Collaborator

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

Copy link
Collaborator

@tahini tahini left a comment

Choose a reason for hiding this comment

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

Nothing major

[mode]: {
defaultEngine: 'osrmRouting',
engines: {
osrmRouting: {enabled: false}
Copy link
Collaborator

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

Copy link
Collaborator Author

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

@@ -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");
Copy link
Collaborator

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

Copy link
Collaborator Author

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

osrmServerPrefs.modes[routingMode].enabled === true &&
osrmServerPrefs.modes[routingMode].autoStart !== true
) {
const osrmModeConfig = ServerConfig.getRoutingEngineConfigForMode(routingMode, 'osrmRouting');
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate OSRM settings from Preferences to Config
2 participants