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

fix(plugin-uploader): System ENV value check #3016

Merged
merged 5 commits into from
Oct 21, 2024

Conversation

charleslee0212
Copy link
Contributor

@charleslee0212 charleslee0212 commented Oct 10, 2024

env variable should not be empty.

Why

The isSet function check to see if the env value is a type string; however, in the cli flags for the env are all defined as type string defeating the purpose of the isSet function. This results in not prompting the user to fill out the necessary values to run the kintone plugin uploader. The code will throw an error. This is a bug.

What

I have updated the code to also check the value of the env. If the value is an empty string, isSet will return false.

How to test

Run the kintone plugin uploader without initializing env variables. Then see if the code will prompt the user.

Checklist

  • Read CONTRIBUTING.md
  • Updated documentation if it is required.
  • Added tests if it is required.
  • Passed pnpm lint and pnpm test on the root directory.

env variable should not be empty.
@github-actions github-actions bot added the pkg: plugin-uploader @kintone/plugin-uploader label Oct 10, 2024
@chihiro-adachi
Copy link
Contributor

@charleslee0212
Thank you!
Please check the following two points.

  • It looks like the CI is down, so could you check that?
  • Is it possible to create a unit test for this fix?

@chihiro-adachi
Copy link
Contributor

プロンプトが動作することを確認。

$ unset KINTONE_BASE_URL
$ unset KINTONE_USERNAME
$ unset KINTONE_PASSWORD
$ bin/cli.js /path/to/plugin.zip
? kintoneのベースURLを入力してください (https://example.cybozu.com): http://localhost
? ログイン名を入力してください: username
? パスワードを入力してください: password
Open http://localhost/login?saml=off
Trying to log in...
Navigate to http://localhost/k/admin/system/plugin/
Trying to upload /path/to/plugin.zip
/path/to/plugin.zip をアップロードしました!

@tasshi-me tasshi-me changed the title System ENV value check fix(plugin-uploader): System ENV value check Oct 21, 2024
@chihiro-adachi chihiro-adachi merged commit 1da8bb0 into kintone:main Oct 21, 2024
17 checks passed
@chihiro-adachi
Copy link
Contributor

@charleslee0212
Thank you! it's merged.

@charleslee0212 charleslee0212 deleted the plugin-uploader-fix branch October 31, 2024 00:26
@charleslee0212
Copy link
Contributor Author

Of course!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: plugin-uploader @kintone/plugin-uploader
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants