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

[Tech Debt] Incorrect edge version shown in app #2939

Open
MatissJanis opened this issue Jun 25, 2024 · 3 comments
Open

[Tech Debt] Incorrect edge version shown in app #2939

MatissJanis opened this issue Jun 25, 2024 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed tech debt Technical debt we should pay down user interface Related to the user interface

Comments

@MatissJanis
Copy link
Member

We show the active version in the settings page. For demo.actualbudget.org this version number is correct.

For edge: we should show the commit hash there (or other unique identifier).

Screenshot 2024-06-25 at 20 39 39
@MatissJanis MatissJanis added good first issue Good for newcomers help wanted Extra attention is needed user interface Related to the user interface tech debt Technical debt we should pay down labels Jun 25, 2024
@matt-fidd
Copy link
Contributor

I took a stab at this as one of my first potential changes to actual.

I could either do it through express-actuator (already used for /info /health and /metrics) but it required a git.properties file be generated for every commit and I'm not sure how practical that is.

Alternatively I made a /info/git endpoint that did

execSync('git rev-parse HEAD', { cwd: config.projectRoot }).toString().trim();

Are we okay with exec calls?

@MatissJanis
Copy link
Member Author

For actual-server: ideally I wouldn't want to have usage of exec within the codebase. It can potentially lead to arbitrary code execution down the line (all it takes is for a junior to come in and add a variable in the shell command.. and 💣). What if we created a new file when running yarn start that wrote a new file with active commit hash? And then just read from that file to get the hash. Same thing could be applied for yarn build.

For actual: the hash here would be different. No quick ideas how to solve it.

@matt-fidd
Copy link
Contributor

matt-fidd commented Jun 25, 2024

Ah sorry! Slipped my mind that this was in actual not actual-server. Generating the file for the server on start is a great idea and would sort that out though!

actual gets its version information directly from package.json, but generating the same file on start and reading from it should do the trick? I'm going to have to think a bit about how builds work and how it would work bundled into actual-server. Maybe if the file isn't there we know it's been imported not directly started and we can fallback to the version in package.json. It wouldn't work for edge builds of actual packaged into actual-server though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed tech debt Technical debt we should pay down user interface Related to the user interface
Projects
None yet
Development

No branches or pull requests

2 participants