medic/cht-conf

upload-extension-libs action throws error when folder doesn't exist

1yuv opened this issue ยท 4 comments

1yuv commented

Describe the bug
We recently added upload-extension-libs action on cht-conf and this is the default action as well. So, when user doesn't specify any parameters and runs cht --url=..., this action is also in

To Reproduce
Steps to reproduce the behavior:

  1. Have latest cht-conf installed
  2. Go to CHT project where extension-libs folder doesn't exist.
  3. Run cht --local or cht --local upload-extension-libs
  4. See error.

Expected behavior
Like other actions, it should throw a warning and continue. For example upload-privacy-policies or upload-partners.

Logs

INFO TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Object.execute (/usr/local/lib/node_modules/cht-conf/src/fn/upload-extension-libs.js:17:17)
    at executeAction (/usr/local/lib/node_modules/cht-conf/src/lib/main.js:258:40)
    at module.exports (/usr/local/lib/node_modules/cht-conf/src/lib/main.js:193:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /usr/local/lib/node_modules/cht-conf/src/bin/index.js:16:5 
ERROR Cannot convert undefined or null to object 

Environment

  • Client platform: MacOS M1
  • cht-conf version: 3.18
  • cht-core version: 3.17.1

Ready for AT on yrimal:main (on @yrimal 's fork).

Make sure that the feature still works, but doesn't throw an error when there's no config folder.

Test details

Config: Default
Environment: Local
Platform: WebApp
Browser: Chrome


Reproducible on master

cht --local

image

cht --local upload-extension-libs

image

Fixed on yrimal:main

cht --local

image

cht --local upload-extension-libs

image

extension-libs functionality is still working as expected.

Images attached

image
image


Test passed successfully. โœ…
Moving the ticket to Ready to Merge
@yrimal

๐ŸŽ‰ This issue has been resolved in version 3.18.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version 3.19.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€