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

latest cht-conf fails to upgrade app settings to latest CHT endpoints #596

Closed
1yuv opened this issue Jan 5, 2024 · 4 comments · Fixed by #598
Closed

latest cht-conf fails to upgrade app settings to latest CHT endpoints #596

1yuv opened this issue Jan 5, 2024 · 4 comments · Fixed by #598
Assignees
Labels
released Type: Bug Fix something that isn't working as intended

Comments

@1yuv
Copy link
Member

1yuv commented Jan 5, 2024

Describe the bug
cht-conf fails to upgrade valid app-setting to valid endpoint with following error:

INFO Starting action: upload-app-settings… 
INFO TypeError: Invalid Version: null
ERROR Invalid Version: null 

To Reproduce
Steps to reproduce the behavior:

  1. Deploy 4.5.0 instance
  2. Prepare valid app settings
  3. Try to upload (cht-conf upload-app-settings) to instance on step 1 with cht-conf 3.19.0 or later
  4. See error

Expected behavior
We should be able to upload without any issue

Logs
If applicable, include the cht-conf output, server logs, and/or browser logs.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment

  • Instance: gandaki.dev
  • Client platform: (eg: Windows, MacOS, Linux)
  • cht-conf version: 3.21.1
  • cht-core version: 4.5.0

Additional context
This appears to be caused by this feature, which was released on 3.19.0.

This code tries to extract latest api version, which is 4.5.0.6922454971 for 4.5.0 instances and semver considers it invalid version while comparing it with semver.

@1yuv 1yuv added the Type: Bug Fix something that isn't working as intended label Jan 5, 2024
@1yuv 1yuv self-assigned this Jan 5, 2024
@1yuv
Copy link
Member Author

1yuv commented Jan 5, 2024

This is critical for one of our deployment to have this fixed and deployed, so I'll be working on it.

@tatilepizs
Copy link

I was trying to test this ticket but I was not able to reproduce the error in my local environment.
I followed the instructions added in the description of the ticket -> here, and the upload is working every time.

I am using:

  • cht-core version 4.5.0

    image

  • cht-conf version 3.21.1 (I also tried with version 3.20.0 and had the same result)

    ~ cht --version
     INFO 3.21.1

I tried these two configs:

default config

➜  default git:(4.5.x) ✗ cht --url=https://medic:******@127-0-0-1.local-ip.medicmobile.org:10446 upload-app-settings
INFO Checking that https://medic:****@127-0-0-1.local-ip.medicmobile.org:10446/medic/ is available...
INFO Processing config in default.
INFO Actions:
     - upload-app-settings
INFO Starting action: upload-app-settings…
WARN generate_patient_id_on_people transition is deprecated since 3.8.x. Please use "generate_shortcode_on_contacts" transition instead.
INFO Settings updated successfully
INFO upload-app-settings complete.

gandaki-province - (config suggested by Yuvraj

➜  gandaki-province git:(master) ✗ cht --url=https://medic:*****@127-0-0-1.local-ip.medicmobile.org:10446 upload-app-settings
INFO Checking that https://medic:****@127-0-0-1.local-ip.medicmobile.org:10446/medic/ is available...
INFO Processing config in gandaki-province.
INFO Actions:
     - upload-app-settings
INFO Starting action: upload-app-settings…
INFO Settings updated successfully
INFO upload-app-settings complete.

@1yuv Since this is an important ticket that needs to be released as soon as possible I think that it would be enough if you could add your testing showing the error and then how it was fixed using your branch (596_semver_fix).

Thank you! 😊

@1yuv
Copy link
Member Author

1yuv commented Jan 10, 2024

Hi @tatilepizs ,

You can see the failure in current version in these deployments on gandaki and echis ke.

Also, I've attached here the video of failure and pass.

Failing in 3.21.1

Issue.mov

Fix:

fixx.mov

1yuv added a commit that referenced this issue Jan 10, 2024
* #596 fix issue with semver validation for latest versions

* #596 add uunittest, update function call

* #596 add more tests
1yuv added a commit that referenced this issue Jan 10, 2024
@1yuv 1yuv closed this as completed in #598 Jan 10, 2024
1yuv added a commit that referenced this issue Jan 10, 2024
fix(#596): fix issue with semver in latest cht versions
@medic-ci
Copy link
Collaborator

🎉 This issue has been resolved in version 3.21.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Fix something that isn't working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants