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

1863 upgrade button #1951

Merged
merged 10 commits into from
Sep 9, 2024
Merged

1863 upgrade button #1951

merged 10 commits into from
Sep 9, 2024

Conversation

galethil
Copy link
Collaborator

@galethil galethil commented Aug 22, 2024

Checklist

  • I have followed (at least) the PR section of the contributing guide.
  • I fixed all necessary PR warnings
  • The commit history is clean
  • The E2E tests are passing
  • If possible, the issue has been divided into more subtasks
  • I did a self review before requesting a review from another team member

Description

How to test

  1. Start app using upgradable development script
  2. Create file upgradadble.txt in /api/trubudget-config
  3. Login as root and go to service status and click th upgrade button
  4. check if file is created in /api/trubudget-config folder
  5. Now we validated creation of file
  6. Now stop app and run it again via operation script (set older version e.g. v2.12.0 in env)
  7. Start app by start-upgradable-trubudget.sh script
  8. Now manually create the same file upgrade_version.txt with content "v2.14.0" (if the file was deleted in the meantime)
  9. Wait about 3 minutes
  10. App should restart with new version, v2.14.0
  11. File should be deleted
  12. Check if app is not restarting more then ones

Alternatively if app is started with start-upgradable-trubudget.sh script it has the ability to restart itself when stopped. The check is based on presence of running api container. If you stop it, the app should restart.
You can stop this process by stop-upgradable-trubudget.sh script.

Closes #1863

Copy link

github-actions bot commented Aug 22, 2024

Warnings
⚠️ No CHANGELOG added.
⚠️ There were changes in the frontend, but no E2E-test was added or modified!

Generated by 🚫 dangerJS against 07cb9db

@MartinJurcoGlina MartinJurcoGlina self-assigned this Aug 23, 2024
switch (bodyResult.apiVersion) {
case "1.0": {
axios
.get("https://hub.docker.com/v2/repositories/trubudget%2Fapi/tags?page_size=10")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would take this out at least to Constants file

@openkfwCI
Copy link

openkfwCI commented Aug 26, 2024

NotesTime
Note for Reviewer: E2E tests on pipeline 60291 on remote server failedThu, 05 Sep 2024 14:25:25 +0000

Generated by E2E-Test

const [latestVersion, setLatestVersion] = useState(null);

useEffect(() => {
axios
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would take backend calls to api file

}, []);

const upgradeApp = useCallback(() => {
axios
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here, should be in api file with other backend calls

@@ -136,6 +172,13 @@ const StatusTable = (props) => {
return (
<div data-test="status-dashboard" className="table-container">
<div className="custom-width">
<p>
New version of TruBudget is available. Backup your data and click{" "}
<Button onClick={upgradeApp} variant="contained">
Copy link
Collaborator

Choose a reason for hiding this comment

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

upgrade button should be probably visible only to root user

Copy link
Collaborator

Choose a reason for hiding this comment

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

missing error handling on api calls. Non root users are getting error overlay on opening this page, as well as on Upgrade button click

const [latestVersion, setLatestVersion] = useState(null);

useEffect(() => {
axios
Copy link
Collaborator

Choose a reason for hiding this comment

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

also, question here would be, if this request should be even called for non root users? If yes, should non root users alway get error in response?

@MartinJurcoGlina MartinJurcoGlina merged commit be4ca7f into main Sep 9, 2024
30 checks passed
@MartinJurcoGlina MartinJurcoGlina deleted the 1863-upgrade-button branch September 9, 2024 15:56
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.

"Update" button for simpler upgrades of TruBudget versions
3 participants