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

Replace osrd-project NGE fork by SBB NGE package #8349

Closed
4 tasks
louisgreiner opened this issue Aug 7, 2024 · 1 comment
Closed
4 tasks

Replace osrd-project NGE fork by SBB NGE package #8349

louisgreiner opened this issue Aug 7, 2024 · 1 comment
Assignees
Labels
area:front Work on Standard OSRD Interface modules component:nge Macroscopic mode of Operational Studies module kind:enhancement Improvement of existing features module:operational-studies Multi-train simulation with structured studies management

Comments

@louisgreiner
Copy link
Contributor

louisgreiner commented Aug 7, 2024

Who would benefit from this feature?

Software developers

What is this feature about?

Currently, the integration of NGE in OSRD requires a fork of NGE with several patches to use the NPM package that we can't apply for now directly in NGE official repo. It is mainly due to concepts that we can't implement for now, for functionnalities that require prior refactor to be used by the standalone environment (= backend disabled, no auth, some UI components disabled) that we are using.

However, this is time consuming to keep this fork up to date (thank you Simon!), as we have to manually integrate the latest updates form NGE, and also it can be dangerous as we could diverge very fast if we implement too much patches.

The forked and official NPM packages is published in NPM.

Here is the list of the patches implemented in the fork that we want to get rid of and handle directly upstream in NGE official repo (diff):

  • some UI functionnalities disabled:
    • Saved filters
    • Import of a Netzgrafik
    • Edit sidebar
    • Environment header ("standalone" ribbon on the top-left corner)
    • Use light theme by default
  • hiding the return travel for trains (making them one-way)
  • allow travel times to be unset (in which case they show up as "?")
  • node capacity

Why is this feature valuable?

  • Reduce fork divergence
  • Gain of time (no need to rebase fork, handle conflicts and so on)
  • Make our features available to other NGE users

Working with a custom NGE package

To work with a custom NGE package and publish a new version, available here

  • Outside osrd
$ git clone https://github.com/osrd-project/netzgrafik-editor-frontend
  • Modify and save
  • Build this new version of NGE
$ npm run build:standalone
  • Move the generated dist/ file into osrd/netzgrafik-editor-frontend/
$ cp -R ./dist ../osrd/netzgrafik-editor-frontend
  • Modify osrd/netzgrafik-editor-frontend/dist/package.json to keep only :
{
  "name": ...
  "version": ...
  "repository": ...
  "files": ...
}
  • Modify osrd/front/package.json:
{
  ...
  "@osrd-project/": "file:netzgrafik-editor-frontend",
  ...
}
  • Restart osrd-front container
$ docker compose restart -d osrd-front
  • Yarn install
$ cd front
$ yarn
  • Push your modifications, it will publish a new package on NPM, available here
  • Do not forget to update the version in osrd/front/package.json
@louisgreiner louisgreiner added kind:enhancement Improvement of existing features module:operational-studies Multi-train simulation with structured studies management area:front Work on Standard OSRD Interface modules labels Aug 7, 2024
@louisgreiner louisgreiner self-assigned this Aug 7, 2024
@louisgreiner louisgreiner added the component:nge Macroscopic mode of Operational Studies module label Sep 26, 2024
@louisgreiner
Copy link
Contributor Author

Unrelevant anymore, can re-open if any one feels the need to

@louisgreiner louisgreiner closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules component:nge Macroscopic mode of Operational Studies module kind:enhancement Improvement of existing features module:operational-studies Multi-train simulation with structured studies management
Projects
None yet
Development

No branches or pull requests

1 participant