Coder Social home page Coder Social logo

upmortem / slack-bot Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 3.0 940 KB

Haly AI Slack Bot. A GPT powered chatbot that can answer questions about your organization using semantic search.

Home Page: https://haly.ai

License: GNU Affero General Public License v3.0

Shell 3.36% Dockerfile 0.75% Python 95.75% Procfile 0.14%
ai chatbot bot flask python slack slack-bot buildinpublic slack-chatbot slackbot

slack-bot's People

Contributors

alkanet88 avatar fedeq avatar franco-peratta avatar istheway avatar joelbandi avatar juanmapuhl avatar nlake44 avatar saintparvy avatar sweep-ai[bot] avatar yuralukashik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

slack-bot's Issues

Sweep (slow): Take the original README.md file and translate it to add README files

This should be in Spanish, Hindi, Standard Arabin, French, German, Bengali, and Russian languages

Checklist
• Translate the original README.md file into Spanish and add the translated content to this file.
Sandbox Execution Logs
trunk init 1/15 ✓
⡿ Downloading Trunk 1.16.0...
⡿ Downloading Trunk 1.16.0...
⢿ Downloading Trunk 1.16.0...
⣻ Downloading Trunk 1.16.0...
⣽ Downloading Trunk 1.16.0...
⣾ Downloading Trunk 1.16.0...
⣷ Downloading Trunk 1.16.0...
✔ Downloading Trunk 1.16.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (25 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.37.0 (3 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (3 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (25 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt README_es.md 2/15 ✓

 ✔ Formatted README_es.md
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix README_es.md 3/15 ❌ (`1`)






  ISSUES  
README_es.md:5:0
  5:0  low  Trailing punctuation in heading  markdownlint/MD026
 29:0  low  Trailing punctuation in heading  markdownlint/MD026
Checked 1 file
✖ 2 new issues
trunk fmt README_es.md 4/15 ✓
 ✔ Formatted README_es.md
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix README_es.md 5/15 ❌ (`1`)

  ISSUES  
README_es.md:5:0
  5:0  low  Trailing punctuation in heading          markdownlint/MD026
 39:0  low  Multiple headings with the same content  markdownlint/MD024
Checked 1 file
✖ 2 new issues
trunk fmt README_es.md 6/15 ✓
 ✔ Formatted README_es.md
Re-checking autofixed files...



Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix README_es.md 7/15 ❌ (`1`)
  ISSUES  
README_es.md:5:0
  5:0  low  Trailing punctuation in heading          markdownlint/MD026
 39:0  low  Multiple headings with the same content  markdownlint/MD024
Checked 1 file
✖ 2 new issues
trunk fmt README_es.md 8/15 ✓
 ✔ Formatted README_es.md
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix README_es.md 9/15 ❌ (`1`)
  ISSUES  
README_es.md:7:0
  7:0  low  Multiple headings with the same content  markdownlint/MD024
 39:0  low  Multiple headings with the same content  markdownlint/MD024
Checked 1 file
✖ 2 new issues
trunk fmt README_es.md 10/15 ✓
 ✔ Formatted README_es.md
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix README_es.md 11/15 ❌ (`1`)
  ISSUES  
README_es.md:7:0
  7:0  low  Multiple headings with the same content  markdownlint/MD024
 36:0  low  Multiple headings with the same content  markdownlint/MD024
Checked 1 file
✖ 2 new issues
trunk fmt README_es.md 12/15 ✓
 ✔ Formatted README_es.md
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix README_es.md 13/15 ❌ (`1`)
  ISSUES  
README_es.md:7:0
  7:0  low  Multiple headings with the same content  markdownlint/MD024
 35:0  low  Multiple headings with the same content  markdownlint/MD024
Checked 1 file
✖ 2 new issues
trunk fmt README_es.md 14/15 ✓
 ✔ Formatted README_es.md
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix README_es.md 15/15 ✓
Checked 1 file
✔ No issues
  • README_hi.md ❌ Failed
• Translate the original README.md file into Hindi and add the translated content to this file.
  • README_ar.md ❌ Failed
• Translate the original README.md file into Standard Arabic and add the translated content to this file.
  • README_fr.md ❌ Failed
• Translate the original README.md file into French and add the translated content to this file.
  • README_de.md ❌ Failed
• Translate the original README.md file into German and add the translated content to this file.
  • README_bn.md ❌ Failed
• Translate the original README.md file into Bengali and add the translated content to this file.
  • README_ru.md ❌ Failed
• Translate the original README.md file into Russian and add the translated content to this file.

Sweep (slow): Add unit test framework and 'test' command

Add tests and framework so I can run "flask test" to execute the tests.

Prevent this from happening:
(myvenv) nchohan slack-bot % flask test
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'test'.
Also: Make it so that the OPENAI_API_KEY environment variable does not have to be set to run unit tests.

Also prevent the following error from happening:
(myvenv) nchohan slack-bot % flask test
Traceback (most recent call last):
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/bin/flask", line 8, in
sys.exit(main())
^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 1047, in main
cli.main()
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 357, in decorator
return __ctx.invoke(f, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/src/index.py", line 33, in test
tests = unittest.TestLoader().discover("tests")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 304, in discover
os.path.dirname((the_module.file)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

And also prevent this issue from happening:
ImportError: Failed to import test module: tests.test_openai_service
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
module = self._get_module_from_name(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
import(name)
File "/Users/nchohan/Dev/upmortem/slack-bot/src/tests/test_openai_service.py", line 4, in
from src.services import openai_service
ModuleNotFoundError: No module named 'src'

Also prevent this when pytest is run on the repo:
============================= test session starts ==============================
platform linux -- Python 3.10.13, pytest-7.4.2, pluggy-1.3.0
rootdir: /home/runner/work/slack-bot/slack-bot
collected 1 item / 1 error

==================================== ERRORS ====================================
______________ ERROR collecting src/tests/test_openai_service.py _______________
ImportError while importing test module '/home/runner/work/slack-bot/slack-bot/src/tests/test_openai_service.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
src/tests/test_openai_service.py:4: in
from src.services import openai_service
E ModuleNotFoundError: No module named 'src'
=========================== short test summary info ============================
ERROR src/tests/test_openai_service.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.20s ===============================
Error: Process completed with exit code 2.

Modify .github/workflows/build-push.yml with contents:

  • Change pytest to "flast test"
  • Prepend FLASK_APP=src/index.py before the flask test command.
Checklist
  • .github/workflows/test.yml ✅ Commit cd370fd
• Add a new workflow file to handle running tests. • Configure the workflow to use the "flask test" command.
Sandbox Execution Logs
trunk init 1/5 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done


























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (2 github-workflow files)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 4 yaml files)
  git-diff-check (24 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 4 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 4 yaml files)
  trufflehog 3.56.1 (24 files)
  yamllint 1.32.0 (4 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt .github/workflows/test.yml 2/5 ✓
Checked 1 file
✔ No issues
trunk check --fix .github/workflows/test.yml 3/5 ❌ (`1`)






























































































































































































































































































  ISSUES  
.github/workflows/test.yml:1:1
 1:1  high  Ensure top-level permissions are not set to write-all  checkov/CKV2_GHA_1
Checked 1 file
✖ 1 new issue
Run trunk upgrade to upgrade 1 linter
trunk fmt .github/workflows/test.yml 4/5 ✓
Checked 1 file
✔ No issues
trunk check --fix .github/workflows/test.yml 5/5 ✓














Checked 1 file
✔ No issues
  • .github/workflows/build-push.yml ✅ Commit 4585c61
• Change "pytest" to "flask test" in the workflow steps. • Add "FLASK_APP=src/index.py" before the "flask test" command.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done




























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (23 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (23 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt .github/workflows/build-push.yml 2/3 ✓

 ✔ Formatted .github/workflows/build-push.yml
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix .github/workflows/build-push.yml 3/3 ✓



































































































































































































































































































  ISSUES  
.github/workflows/build-push.yml:1:1
 1:1  high  Ensure top-level permissions are not set to write-all  checkov/CKV2_GHA_1
Checked 1 file
1 existing issue
Run trunk upgrade to upgrade 1 linter
• Add a unit test framework (e.g., pytest) import statement. • Add a "test" command that runs the tests using the unit test framework.
Sandbox Execution Logs
trunk init 1/4 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done





















✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (23 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (23 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/index.py 2/4 ❌ (`1`)










































































































































 ✔ Formatted src/index.py
Re-checking autofixed files...



  FAILURES  
 black  src/index.py  .trunk/out/nmRzt.yaml
 black  src/index.py  .trunk/out/cS4Lz.yaml
  NOTICES  
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt src/index.py 3/4 ✓
 ✔ Formatted src/index.py
Re-checking autofixed files...



 ✔ Formatted src/index.py
Re-checking autofixed files...


Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix src/index.py 4/4 ✓

 ✔ Auto-fixed src/index.py
Re-checking autofixed files...





  ISSUES  
src/index.py:27:0
 27:0  medium  Possible binding to all interfaces.                                                           bandit/B104
 27:0  high    A Flask app appears to be run with debug=True, which exposes the Werkzeug debugger and        bandit/B201
               allows the execution of arbitrary code.                                                                  
Checked 1 file
2 existing issues
• Update the code to handle the OPENAI_API_KEY environment variable properly.
Sandbox Execution Logs
trunk init 1/4 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done





















✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (23 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (23 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/index.py 2/4 ❌ (`1`)










































































































































 ✔ Formatted src/index.py
Re-checking autofixed files...



  FAILURES  
 black  src/index.py  .trunk/out/nmRzt.yaml
 black  src/index.py  .trunk/out/cS4Lz.yaml
  NOTICES  
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt src/index.py 3/4 ✓
 ✔ Formatted src/index.py
Re-checking autofixed files...



 ✔ Formatted src/index.py
Re-checking autofixed files...


Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix src/index.py 4/4 ✓

 ✔ Auto-fixed src/index.py
Re-checking autofixed files...





  ISSUES  
src/index.py:27:0
 27:0  medium  Possible binding to all interfaces.                                                           bandit/B104
 27:0  high    A Flask app appears to be run with debug=True, which exposes the Werkzeug debugger and        bandit/B201
               allows the execution of arbitrary code.                                                                  
Checked 1 file
2 existing issues
  • src/tests/test_openai_service.py ✅ Commit 18fcebd
• Fix the import statement for the "openai_service" module.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done





























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (11 python files)
  black 23.9.1 (10 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (24 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (11 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (11 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (24 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/tests/test_openai_service.py 2/3 ✓

































































































































Checked 1 file
✔ No issues
trunk check --fix src/tests/test_openai_service.py 3/3 ✓
































 ✔ Auto-fixed src/tests/test_openai_service.py
Re-checking autofixed files...





 ✔ Formatted src/tests/test_openai_service.py
Re-checking autofixed files...





Checked 1 file
✔ No issues
  • src/tests/test_openai_service.py ✅ Commit 18fcebd
• Update the test file path to ensure pytest discovers the tests correctly.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done





























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (11 python files)
  black 23.9.1 (10 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (24 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (11 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (11 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (24 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/tests/test_openai_service.py 2/3 ✓

































































































































Checked 1 file
✔ No issues
trunk check --fix src/tests/test_openai_service.py 3/3 ✓
































 ✔ Auto-fixed src/tests/test_openai_service.py
Re-checking autofixed files...





 ✔ Formatted src/tests/test_openai_service.py
Re-checking autofixed files...





Checked 1 file
✔ No issues

Sweep (slow): Add unit test framework

Add tests and framework so I can run "flask test" to execute the tests.

Prevent this from happening:
(myvenv) nchohan slack-bot % flask test
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'test'.

Also: Make it so that the OPENAI_API_KEY environment variable does not have to be set to run unit tests.

Checklist
  • src/tests/test_openai_service.py ✅ Commit 1ced929
• Import the necessary modules (unittest, unittest.mock, etc.) • Import the functions from 'openai_service.py' that need to be tested • Create a new test class that inherits from unittest.TestCase • Within this class, define test methods for each function in 'openai_service.py'. Use the 'unittest.mock.patch' decorator to mock the OPENAI_API_KEY environment variable where necessary.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (11 python files)
  black 23.9.1 (10 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (24 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (11 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (11 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (24 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/tests/test_openai_service.py 2/3 ✓







































































































































 ✔ Formatted src/tests/test_openai_service.py
Re-checking autofixed files...



 ✔ Formatted src/tests/test_openai_service.py
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix src/tests/test_openai_service.py 3/3 ✓


















Checked 1 file
✔ No issues
  • src/tests/test_slack_service.py ✅ Commit a2e00cd
• Import the necessary modules (unittest, unittest.mock, etc.) • Import the functions from 'slack_service.py' that need to be tested • Create a new test class that inherits from unittest.TestCase • Within this class, define test methods for each function in 'slack_service.py'. Use the 'unittest.mock.patch' decorator to mock the OPENAI_API_KEY environment variable where necessary.
Sandbox Execution Logs
trunk init 1/6 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done




























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (11 python files)
  black 23.9.1 (10 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (24 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (11 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (11 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (24 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/tests/test_slack_service.py 2/6 ❌ (`1`)














































































































































 ✔ Formatted src/tests/test_slack_service.py
Re-checking autofixed files...




  FAILURES  
 black  src/tests/test_slack_service.py  .trunk/out/DtXSn.yaml
 black  src/tests/test_slack_service.py  .trunk/out/hHElj.yaml
  NOTICES  
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt src/tests/test_slack_service.py 3/6 ❌ (`1`)
 ✔ Formatted src/tests/test_slack_service.py
Re-checking autofixed files...



  FAILURES  
 black  src/tests/test_slack_service.py  .trunk/out/xjmy4.yaml
 black  src/tests/test_slack_service.py  .trunk/out/WlzW1.yaml
  NOTICES  
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
trunk fmt src/tests/test_slack_service.py 4/6 ❌ (`1`)
 ✔ Formatted src/tests/test_slack_service.py
Re-checking autofixed files...



  FAILURES  
 black  src/tests/test_slack_service.py  .trunk/out/kHBH5.yaml
 black  src/tests/test_slack_service.py  .trunk/out/6Gflv.yaml
  NOTICES  
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
Run trunk upgrade to upgrade 1 linter
trunk fmt src/tests/test_slack_service.py 5/6 ✓
 ✔ Formatted src/tests/test_slack_service.py
Re-checking autofixed files...




 ✔ Formatted src/tests/test_slack_service.py
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix src/tests/test_slack_service.py 6/6 ✓
 ✔ Auto-fixed src/tests/test_slack_service.py
Re-checking autofixed files...








 ✔ Formatted src/tests/test_slack_service.py
Re-checking autofixed files...









Checked 1 file
✔ No issues
• Import the 'click' module at the beginning of the file • Define a new command 'test' using the '@flask_app.cli.command()' decorator. This command should discover and run the tests in the 'tests' directory.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done





























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (23 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (23 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/index.py 2/3 ✓

















































































































































 ✔ Formatted src/index.py
Re-checking autofixed files...



 ✔ Formatted src/index.py
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix src/index.py 3/3 ✓



 ✔ Auto-fixed src/index.py
Re-checking autofixed files...





  ISSUES  
src/index.py:38:0
 38:0  medium  Possible binding to all interfaces.                                                           bandit/B104
 38:0  high    A Flask app appears to be run with debug=True, which exposes the Werkzeug debugger and        bandit/B201
               allows the execution of arbitrary code.                                                                  
Checked 1 file
2 existing issues

Sweep (slow): Add README files in Spanish, Hindi, Standard Arabin, French, German, Bengali, and Russian languages

Checklist
  • src/lib/split_string.py ✅ Commit 667da06
No changes are necessary in the new_file.
  • src/services/slack_service.py ❌ Failed
In the file `src/services/slack_service.py`, make the following changes:
  1. Add the import statement for the split_string_into_chunks function from the lib.split_string module:

    from lib.split_string import split_string_into_chunks
  2. Update the handle_app_mention function:

    • Add the import statement for the respond_to_user function from the services.openai_service module:

      from services.openai_service import respond_to_user
    • Replace the line:

      chunks = split_string_into_chunks(response, MESSAGE_LENGTH_LIMIT)

      with:

      chunks = split_string_into_chunks(response, MESSAGE_LENGTH_LIMIT)
    • Replace the line:

      update_message(channel, thread_to_reply, msg_ts, chunks[0], slack_bot_token)

      with:

      update_message(channel, thread_to_reply, msg_ts, chunks[0], slack_bot_token)
    • Add the following loop after the previous line:

      for chunk in chunks[1:]:
          say(
              channel=channel,
              thread_ts=thread_to_reply,
              text=chunk,
              token=slack_bot_token
          )
  3. Add the import statement for the get_team_data, increment_request_count, and revoke_token functions from the services.api_service module:

    from .api_service import get_team_data, increment_request_count, revoke_token
  4. Update the handle_app_installed function:

    • Add the import statement for the get_team_data, increment_request_count, and revoke_token functions from the services.api_service module:

      from .api_service import get_team_data, increment_request_count, revoke_token
    • Replace the line:

      team_data = get_team_data(team_id)

      with:

      team_data = get_team_data(team_id)
    • Replace the line:

      if team_data["slack_bot_token"] is None:

      with:

      if team_data["slack_bot_token"] is None:
    • Replace the line:

      retry(
          lambda: slack_app.client.conversations_list(
              token=team_data["slack_bot_token"],
              types="public_channel",
              exclude_archived=True,
              limit=10
          )
      )

      with:

      retry(
          lambda: slack_app.client.conversations_list(
              token=team_data["slack_bot_token"],
              types="public_channel",
              exclude_archived=True,
              limit=10
          )
      )
    • Replace the line:

      retry(
          lambda: slack_app.client.conversations_join(
              token=team_data["slack_bot_token"],
              channel=conversation["id"]
          )
      )

      with:

      retry(
          lambda: slack_app.client.conversations_join(
              token=team_data["slack_bot_token"],
              channel=conversation["id"]
          )
      )
    • Replace the line:

      retry(
          lambda: slack_app.client.chat_postMessage(
              token=team_data["slack_bot_token"],
              channel=conversation["id"],
              text=WELCOME_MESSAGE
          )
      )

      with:

      retry(
          lambda: slack_app.client.chat_postMessage(
              token=team_data["slack_bot_token"],
              channel=conversation["id"],
              text=WELCOME_MESSAGE
          )
      )
      ```</blockquote>

Sweep: Update support button on App Home page to use https://www.haly.ai/support link instead of mailto

Checklist
  • src/services/slack_service.py ✅ Commit 3519c08
• In the "update_home_tab" function, modify the "go_to_dashboard_button" dictionary. • Update the "url" key to "https://www.haly.ai/support".
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done


















































































































































































































































































































































































































































































































































































































































































✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (23 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (23 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/services/slack_service.py 2/3 ✓
 ✔ Formatted src/services/slack_service.py
Re-checking autofixed files...



 ✔ Formatted src/services/slack_service.py
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix src/services/slack_service.py 3/3 ✓


  ISSUES  
src/services/slack_service.py:5:23
   5:23  high  `threading.Thread` imported but unused                          ruff/F401
 155:54  high  Comparison to `True` should be `cond is True` or `if cond:`     ruff/E712
 326:5   high  Redefinition of unused `handle_some_action` from line 320       ruff/F811
 332:5   high  Redefinition of unused `handle_some_action` from line 326       ruff/F811
 343:5   high  Redefinition of unused `handle_message_events` from line 338    ruff/F811
 370:65  high  Function definition does not bind loop variable `conversation`  ruff/B023
 376:29  high  Function definition does not bind loop variable `conversation`  ruff/B023
Checked 1 file
7 existing issues (2 auto-fixable)
Run trunk upgrade to upgrade 1 linter

Sweep (slow): Add a unit testing framework for Flask

Also add some initial unit tests.

Checklist
  • src/tests/test_index.py ✅ Commit 97f5939
• Create a new Python file named test_index.py in the src/tests directory. • Import the unittest module and the Flask application from index.py. • Define a new class named IndexTestCase that inherits from unittest.TestCase. • In the IndexTestCase class, define a setUp method that creates a test client for the Flask application. • In the IndexTestCase class, define a tearDown method that gets called after each test method to clean up any resources used during testing. • Write a test method for each route in the Flask application. Each test method should send a request to the route and assert that the response is as expected.
Sandbox Execution Logs
trunk init 1/3 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done



























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (11 python files)
  black 23.9.1 (10 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (24 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (11 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.289 (11 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.0 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.0 (24 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/tests/test_index.py 2/3 ✅
























































































































 ✔ Formatted src/tests/test_index.py
Re-checking autofixed files...



 ✔ Formatted src/tests/test_index.py
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix src/tests/test_index.py 3/3 ✅












 ✔ Auto-fixed src/tests/test_index.py
Re-checking autofixed files...






 ✔ Formatted src/tests/test_index.py
Re-checking autofixed files...







Checked 1 file
✔ No issues
• Add a new section named "Running the tests". • In this section, provide instructions on how to run the tests using the unittest module. For instance, the command to run the tests could be "python -m unittest discover -s src/tests".
Sandbox Execution Logs
trunk init 1/3 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done


























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (23 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.289 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.0 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.0 (23 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt README.md 2/3 ✅


 ✔ Formatted README.md
Re-checking autofixed files...






Checked 1 file
✔ No issues
trunk check --fix README.md 3/3 ✅

















  ISSUES  
README.md:5:0
   5:0  low  Trailing punctuation in heading                      markdownlint/MD026
  29:0  low  Trailing punctuation in heading                      markdownlint/MD026
  46:0  low  Trailing punctuation in heading                      markdownlint/MD026
  53:0  low  Ordered list item prefix                             markdownlint/MD029
  56:0  low  Fenced code blocks should have a language specified  markdownlint/MD040
 108:0  low  Ordered list item prefix                             markdownlint/MD029
 115:0  low  Ordered list item prefix                             markdownlint/MD029
 120:0  low  Ordered list item prefix                             markdownlint/MD029
 130:0  low  Fenced code blocks should have a language specified  markdownlint/MD040
Checked 1 file
9 existing issues

Sweep: Add emojis to when you list out a plan in the App Home page

Checklist
  • src/services/slack_service.py

• In the update_home_tab function, locate the current_plan_section dictionary. This is where the plan details are defined.
• Add relevant emojis to the text field of the current_plan_section dictionary. The emojis should be added as unicode characters. For example, if you want to add a check mark emoji next to the plan name, you can modify the text field as follows: "text": f"✅ *{product_name}* ".
• Similarly, add relevant emojis to other parts of the plan listing as needed.

Sweep (slow): Add unit test framework and 'test' command

Add tests and framework so I can run "flask test" to execute the tests.

Prevent this from happening:
(myvenv) nchohan slack-bot % flask test
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'test'.
Also: Make it so that the OPENAI_API_KEY environment variable does not have to be set to run unit tests.

Also prevent the following error from happening:
(myvenv) nchohan slack-bot % flask test
Traceback (most recent call last):
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/bin/flask", line 8, in
sys.exit(main())
^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 1047, in main
cli.main()
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 357, in decorator
return __ctx.invoke(f, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/src/index.py", line 33, in test
tests = unittest.TestLoader().discover("tests")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 304, in discover
os.path.dirname((the_module.file)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

And also prevent this issue from happening:
ImportError: Failed to import test module: tests.test_openai_service
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
module = self._get_module_from_name(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
import(name)
File "/Users/nchohan/Dev/upmortem/slack-bot/src/tests/test_openai_service.py", line 4, in
from src.services import openai_service
ModuleNotFoundError: No module named 'src'

Also prevent this when pytest is run on the repo:
============================= test session starts ==============================
platform linux -- Python 3.10.13, pytest-7.4.2, pluggy-1.3.0
rootdir: /home/runner/work/slack-bot/slack-bot
collected 1 item / 1 error

==================================== ERRORS ====================================
______________ ERROR collecting src/tests/test_openai_service.py _______________
ImportError while importing test module '/home/runner/work/slack-bot/slack-bot/src/tests/test_openai_service.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
src/tests/test_openai_service.py:4: in
from src.services import openai_service
E ModuleNotFoundError: No module named 'src'
=========================== short test summary info ============================
ERROR src/tests/test_openai_service.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.20s ===============================
Error: Process completed with exit code 2.

Checklist
  • test/index_test.py ✅ Commit 9f943c4
• Create a new file "test/index_test.py" to write unit tests for the index.py file. • Write unit tests for the "test" command in the index.py file.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done
























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (23 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (23 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt test/index_test.py 2/3 ✓


















































































































 ✔ Formatted test/index_test.py
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix test/index_test.py 3/3 ✓


































  ISSUES  
test/index_test.py:1:8
 1:8  high  `math` imported but unused                                                                       ruff/F401  
 5:5  high  Local variable `num` is assigned to but never used                                               ruff/F841  
 6:0  low   Use of assert detected. The enclosed code will be removed when compiling to optimised byte       bandit/B101
            code.                                                                                                       
Checked 1 file
3 existing issues (2 auto-fixable)
• Modify the "index.py" file to add a "test" command that runs the unit tests. • Import the necessary modules for running tests.
Sandbox Execution Logs
trunk init 1/5 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done




























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (23 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (23 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/index.py 2/5 ✓















































































































































 ✔ Formatted src/index.py
Re-checking autofixed files...




 ✔ Formatted src/index.py
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix src/index.py 3/5 ❌ (`1`)







 ✔ Auto-fixed src/index.py
Re-checking autofixed files...





  ISSUES  
src/index.py:6:2
  6:2   high    Undefined name `flask_app`                                                                   ruff/F821  
  7:2   high    Undefined name `shared_secret_guard`                                                         ruff/F821  
  9:12  high    Undefined name `handle_app_installed`                                                        ruff/F821  
 12:2   high    Undefined name `flask_app`                                                                   ruff/F821  
 13:2   high    Undefined name `shared_secret_guard`                                                         ruff/F821  
 14:5   high    Redefinition of unused `app_installed_route` from line 8                                     ruff/F811  
 15:12  high    Undefined name `handle_app_installed`                                                        ruff/F821  
 19:0   medium  Possible binding to all interfaces.                                                          bandit/B104
 19:0   high    A Flask app appears to be run with debug=True, which exposes the Werkzeug debugger and       bandit/B201
                allows the execution of arbitrary code.                                                                 
 19:5   high    Undefined name `flask_app`                                                                   ruff/F821  
Checked 1 file
2 existing issues
✖ 8 new issues
trunk fmt src/index.py 4/5 ✓
 ✔ Formatted src/index.py
Re-checking autofixed files...



 ✔ Formatted src/index.py
Re-checking autofixed files...



Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix src/index.py 5/5 ✓


 ✔ Auto-fixed src/index.py
Re-checking autofixed files...





  ISSUES  
src/index.py:25:0
 25:0  medium  Possible binding to all interfaces.  bandit/B104
Checked 1 file
1 existing issue
  • test/openai_service_test.py ✅ Commit 9d0a6c1
• Modify the "openai_service_test.py" file to remove the dependency on the OPENAI_API_KEY environment variable. • Use mocking or dependency injection to provide test data instead.
Sandbox Execution Logs
trunk init 1/5 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done




























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (11 python files)
  black 23.9.1 (10 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (24 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (11 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (11 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (24 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt test/openai_service_test.py 2/5 ✓










































































































 ✔ Formatted test/openai_service_test.py
Re-checking autofixed files...





 ✔ Formatted test/openai_service_test.py
Re-checking autofixed files...






Checked 1 file
✔ No issues
trunk check --fix test/openai_service_test.py 3/5 ❌ (`1`)














































  ISSUES  
test/openai_service_test.py:11:58
 11:58  high  Undefined name `MockChoices`  ruff/F821
 12:21  high  Undefined name `MockMessage`  ruff/F821
Checked 1 file
✖ 2 new issues
trunk fmt test/openai_service_test.py 4/5 ✓
 ✔ Formatted test/openai_service_test.py
Re-checking autofixed files...



 ✔ Formatted test/openai_service_test.py
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix test/openai_service_test.py 5/5 ✓
 ✔ Auto-fixed test/openai_service_test.py
Re-checking autofixed files...





Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
  • test/slack_service_test.py ✅ Commit 8c515f4
• Modify the "slack_service_test.py" file to remove the dependency on the OPENAI_API_KEY environment variable. • Use mocking or dependency injection to provide test data instead.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done


























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (11 python files)
  black 23.9.1 (10 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (24 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (11 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (11 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (24 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt test/slack_service_test.py 2/3 ✓



































































































































 ✔ Formatted test/slack_service_test.py
Re-checking autofixed files...



 ✔ Formatted test/slack_service_test.py
Re-checking autofixed files...


Checked 1 file
✔ No issues
trunk check --fix test/slack_service_test.py 3/3 ✓




























Checked 1 file
✔ No issues
  • test/api_service_test.py ✅ Commit d6a2c3e
• Modify the "api_service_test.py" file to remove the dependency on the OPENAI_API_KEY environment variable. • Use mocking or dependency injection to provide test data instead.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done



























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (11 python files)
  black 23.9.1 (10 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (24 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (11 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (11 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (24 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt test/api_service_test.py 2/3 ✓


































































































































 ✔ Formatted test/api_service_test.py
Re-checking autofixed files...





 ✔ Formatted test/api_service_test.py
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix test/api_service_test.py 3/3 ✓






















Checked 1 file
✔ No issues

Sweep (slow): Replace pytest with flask test

Add tests and framework so I can run "flask test" to execute the tests.

Prevent this from happening:
(myvenv) nchohan slack-bot % flask test
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'test'.

Also: Make it so that the OPENAI_API_KEY environment variable does not have to be set to run unit tests.

Also prevent the following error from happening:
(myvenv) nchohan slack-bot % flask test
Traceback (most recent call last):
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/bin/flask", line 8, in
sys.exit(main())
^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 1047, in main
cli.main()
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 357, in decorator
return __ctx.invoke(f, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/src/index.py", line 33, in test
tests = unittest.TestLoader().discover("tests")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 304, in discover
os.path.dirname((the_module.file)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

And also prevent this issue from happening:
ImportError: Failed to import test module: tests.test_openai_service
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
module = self._get_module_from_name(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
import(name)
File "/Users/nchohan/Dev/upmortem/slack-bot/src/tests/test_openai_service.py", line 4, in
from src.services import openai_service
ModuleNotFoundError: No module named 'src'

Also prevent this when pytest is run on the repo:
============================= test session starts ==============================
platform linux -- Python 3.10.13, pytest-7.4.2, pluggy-1.3.0
rootdir: /home/runner/work/slack-bot/slack-bot
collected 1 item / 1 error

==================================== ERRORS ====================================
______________ ERROR collecting src/tests/test_openai_service.py _______________
ImportError while importing test module '/home/runner/work/slack-bot/slack-bot/src/tests/test_openai_service.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
src/tests/test_openai_service.py:4: in
from src.services import openai_service
E ModuleNotFoundError: No module named 'src'
=========================== short test summary info ============================
ERROR src/tests/test_openai_service.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.20s ===============================
Error: Process completed with exit code 2.

Modify .github/workflows/build-push.yml with contents:

Change pytest to "flask test"
Prepend FLASK_APP=src/index.py before the flask test command

Checklist
  • src/__init__.py ✅ Commit 4e52be6
  • src/services/__init__.py ✅ Commit f1e5b1e
  • src/index.py ✅ Commit 1d7c167
  • src/services/openai_service.py ✅ Commit 6253425
  • .github/workflows/build-push.yml ✅ Commit ddef320

Sweep: Change any reference to upmortem.com domain to haly.ai domain

Checklist
  • src/services/api_service.py

• Replace 'upmortem.com' with 'haly.ai' in the BASE_URL variable.

  • src/services/slack_service.py

• Search for any URLs that are being used to redirect users. If they contain 'upmortem.com', replace it with 'haly.ai'.

  • README.md

• Replace any instances of 'upmortem.com' with 'haly.ai'.

  • src/services/openai_service.py

• If there are any instances of 'upmortem.com', replace them with 'haly.ai'.

  • cloudbuild.yml

• If there are any instances of 'upmortem.com', replace them with 'haly.ai'.

Sweep (slow): Add unit test framework

Add tests and framework so I can run "flask test" to execute the tests.

Checklist
  • requirements.txt ✅ Commit ebd602a
• Add pytest and Flask-Testing to the list of required packages.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done



























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (23 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (23 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt requirements.txt 2/3 ✓
Found no applicable linters for the requested path
trunk check --fix requirements.txt 3/3 ✓










































  ISSUES  
requirements.txt:1:0
 1:0  high  Vulnerability in 'flask': Cookie header. Current version is vulnerable:      trivy/CVE-2023-30861           
            2.2.2. Patch available: upgrade to 2.3.2, 2.2.5 or higher.                                                  
 1:0  high  'Flask' is a lightweight WSGI web application framework. When all of the     osv-scanner/GHSA-m2qf-hxjv-5gpq
            following conditions are met, a response containing data intended for one                                   
            client may be c... .trunk/out/MGb.txt                                                                       
Checked 1 file
2 existing issues
• Create a new directory named "tests" in the "src" directory. This directory will contain the test files.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done






















✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (24 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (24 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/tests 2/3 ✓
Found no applicable linters for the requested path
trunk check --fix src/tests 3/3 ✓




Checked 1 file
✔ No issues
  • src/tests/test_slack_service.py ❌ Failed
• Import the functions from slack_service.py. • Write tests for each function. Each test should call the function with some input and assert that the output is as expected.
  • src/tests/test_openai_service.py ❌ Failed
• Import the functions from openai_service.py. • Write tests for each function. Each test should call the function with some input and assert that the output is as expected.
• Import the pytest and Flask-Testing libraries. • Add a new command "flask test" that runs the tests. This command should call pytest.main() with the path to the "tests" directory as an argument.
Sandbox Execution Logs
trunk init 1/5 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done




















✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (23 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (23 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/index.py 2/5 ✓


























































































































































 ✔ Formatted src/index.py
Re-checking autofixed files...



 ✔ Formatted src/index.py
Re-checking autofixed files...



Checked 1 file
✔ No issues
trunk check --fix src/index.py 3/5 ❌ (`1`)



 ✔ Auto-fixed src/index.py
Re-checking autofixed files...






  ISSUES  
src/index.py:30:18
 30:18  high    Undefined name `sys`                                                                         ruff/F821  
 34:0   medium  Possible binding to all interfaces.                                                          bandit/B104
 34:0   high    A Flask app appears to be run with debug=True, which exposes the Werkzeug debugger and       bandit/B201
                allows the execution of arbitrary code.                                                                 
Checked 1 file
2 existing issues
✖ 1 new issue
trunk fmt src/index.py 4/5 ✓
 ✔ Formatted src/index.py
Re-checking autofixed files...



 ✔ Formatted src/index.py
Re-checking autofixed files...



Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix src/index.py 5/5 ✓
 ✔ Auto-fixed src/index.py
Re-checking autofixed files...




Checked 1 file
✔ No issues

Swap out pytest for flask test.

Add tests and framework so I can run "flask test" to execute the tests.

Prevent this from happening:
(myvenv) nchohan slack-bot % flask test
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'test'.
Also: Make it so that the OPENAI_API_KEY environment variable does not have to be set to run unit tests.

Also prevent the following error from happening:
(myvenv) nchohan slack-bot % flask test
Traceback (most recent call last):
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/bin/flask", line 8, in
sys.exit(main())
^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 1047, in main
cli.main()
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 357, in decorator
return __ctx.invoke(f, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/src/index.py", line 33, in test
tests = unittest.TestLoader().discover("tests")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 304, in discover
os.path.dirname((the_module.file)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

And also prevent this issue from happening:
ImportError: Failed to import test module: tests.test_openai_service
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
module = self._get_module_from_name(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
import(name)
File "/Users/nchohan/Dev/upmortem/slack-bot/src/tests/test_openai_service.py", line 4, in
from src.services import openai_service
ModuleNotFoundError: No module named 'src'

Also prevent this when pytest is run on the repo:
============================= test session starts ==============================
platform linux -- Python 3.10.13, pytest-7.4.2, pluggy-1.3.0
rootdir: /home/runner/work/slack-bot/slack-bot
collected 1 item / 1 error

==================================== ERRORS ====================================
______________ ERROR collecting src/tests/test_openai_service.py _______________
ImportError while importing test module '/home/runner/work/slack-bot/slack-bot/src/tests/test_openai_service.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
src/tests/test_openai_service.py:4: in
from src.services import openai_service
E ModuleNotFoundError: No module named 'src'
=========================== short test summary info ============================
ERROR src/tests/test_openai_service.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.20s ===============================
Error: Process completed with exit code 2.

Modify .github/workflows/build-push.yml with contents:

Change pytest to "flast test"
Prepend FLASK_APP=src/index.py before the flask test command.

Sweep (slow): Replace pytest with flask test and improve testing setup

Add tests for each file in src/services directory and add framework so I can run "flask test" to execute the tests.

Prevent this from happening:
(myvenv) nchohan slack-bot % flask test
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'test'.

Also: Make it so that the OPENAI_API_KEY environment variable does not have to be set to run unit tests.

Also prevent the following error from happening:
(myvenv) nchohan slack-bot % flask test
Traceback (most recent call last):
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/bin/flask", line 8, in
sys.exit(main())
^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 1047, in main
cli.main()
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 357, in decorator
return __ctx.invoke(f, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/src/index.py", line 33, in test
tests = unittest.TestLoader().discover("tests")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 304, in discover
os.path.dirname((the_module.file)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

And also prevent this issue from happening:
ImportError: Failed to import test module: tests.test_openai_service
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
module = self._get_module_from_name(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
import(name)
File "/Users/nchohan/Dev/upmortem/slack-bot/src/tests/test_openai_service.py", line 4, in
from src.services import openai_service
ModuleNotFoundError: No module named 'src'

Also prevent this when pytest is run on the repo:
============================= test session starts ==============================
platform linux -- Python 3.10.13, pytest-7.4.2, pluggy-1.3.0
rootdir: /home/runner/work/slack-bot/slack-bot
collected 1 item / 1 error

==================================== ERRORS ====================================
______________ ERROR collecting src/tests/test_openai_service.py _______________
ImportError while importing test module '/home/runner/work/slack-bot/slack-bot/src/tests/test_openai_service.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
src/tests/test_openai_service.py:4: in
from src.services import openai_service
E ModuleNotFoundError: No module named 'src'
=========================== short test summary info ============================
ERROR src/tests/test_openai_service.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.20s ===============================
Error: Process completed with exit code 2.

Modify .github/workflows/build-push.yml with contents:

Change pytest to "flask test"
Prepend FLASK_APP=src/index.py before the flask test command

Prevent this from happening: test build failed with the following errors:

2023-09-25T23:45:01.8827513Z ##[group]Run export FLASK_APP=src/index.py && flask test
2023-09-25T23:45:01.8895349Z ##[endgroup]
2023-09-25T23:45:02.2699042Z Error: While importing 'src.index', an ImportError was raised:
2023-09-25T23:45:02.2699669Z
2023-09-25T23:45:02.2700551Z Traceback (most recent call last):
2023-09-25T23:45:02.2706991Z File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/flask/cli.py", line 218, in locate_app
2023-09-25T23:45:02.2707652Z import(module_name)
2023-09-25T23:45:02.2708403Z File "/home/runner/work/slack-bot/slack-bot/src/index.py", line 7, in
2023-09-25T23:45:02.2709183Z from lib.guards import shared_secret_guard
2023-09-25T23:45:02.2709723Z ModuleNotFoundError: No module named 'lib'
2023-09-25T23:45:02.2709912Z
2023-09-25T23:45:02.2709922Z
2023-09-25T23:45:02.2710077Z Usage: flask [OPTIONS] COMMAND [ARGS]...
2023-09-25T23:45:02.2710387Z Try 'flask --help' for help.
2023-09-25T23:45:02.2710539Z
2023-09-25T23:45:02.2713606Z Error: No such command 'test'.

Checklist
  • src/tests/test_api_service.py ❌ Failed
  • src/tests/test_openai_service.py
  • src/tests/test_slack_service.py
  • src/index.py

Sweep (slow): Improve the README

Checklist
  • README.md

• Add a table of contents at the beginning of the README. The table of contents should include links to all the main sections of the README.
• Add a section titled "Setting Up the Project". In this section, provide detailed instructions for setting up the project. These instructions should be derived from the scripts and configuration files in the repository.
• Add a section titled "Running Tests". In this section, provide instructions for running tests.
• Add a section titled "Deploying the Application". In this section, provide instructions for deploying the application. These instructions can be found in the 'cloudbuild.yml' file.
• Add a section titled "Contributing to the Project". In this section, provide guidelines for potential contributors on how to submit issues and pull requests.
• Review the style and format of the README and update it to ensure consistency with other Markdown files in the repository. This includes consistent use of headings, subheadings, lists, code blocks, and other Markdown elements.
• Check all links in the README to ensure they are working correctly. Update any broken links.

Sweep (slow): Add unit test framework and 'test' command

Add tests and framework so I can run "flask test" to execute the tests.

Prevent this from happening:
(myvenv) nchohan slack-bot % flask test
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'test'.
Also: Make it so that the OPENAI_API_KEY environment variable does not have to be set to run unit tests.

Also prevent the following error from happening:
(myvenv) nchohan slack-bot % flask test
Traceback (most recent call last):
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/bin/flask", line 8, in
sys.exit(main())
^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 1047, in main
cli.main()
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 357, in decorator
return __ctx.invoke(f, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/src/index.py", line 33, in test
tests = unittest.TestLoader().discover("tests")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 304, in discover
os.path.dirname((the_module.file)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

And also prevent this issue from happening:
ImportError: Failed to import test module: tests.test_openai_service
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
module = self._get_module_from_name(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
import(name)
File "/Users/nchohan/Dev/upmortem/slack-bot/src/tests/test_openai_service.py", line 4, in
from src.services import openai_service
ModuleNotFoundError: No module named 'src'

Checklist
  • src/tests/__init__.py ✅ Commit 71116b2
• Create an empty __init__.py file to make the tests directory a package.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (11 python files)
  black 23.9.1 (10 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (24 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (11 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (11 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (24 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/tests/__init__.py 2/3 ✓






































































































































Checked 1 file
✔ No issues
trunk check --fix src/tests/__init__.py 3/3 ✓











































Checked 1 file
✔ No issues
  • src/tests/test_openai_service.py ✅ Commit 36a0369
• Import the unittest module and the openai_service module correctly. • Define a TestOpenAIService class that inherits from unittest.TestCase. • Inside this class, define test methods for each function in the openai_service module. Use the unittest.mock.patch decorator to mock the OPENAI_API_KEY environment variable and any other external dependencies.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done




























✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (11 python files)
  black 23.9.1 (10 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (24 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (11 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (11 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (24 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/tests/test_openai_service.py 2/3 ✓







































































































































































 ✔ Formatted src/tests/test_openai_service.py
Re-checking autofixed files...




 ✔ Formatted src/tests/test_openai_service.py
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix src/tests/test_openai_service.py 3/3 ✓



































Checked 1 file
✔ No issues
• Import the unittest module. • Define a new 'test' command for the Flask CLI using the @flask_app.cli.command() decorator. • Inside this command, discover and run the tests using unittest.TestLoader().discover() and unittest.TextTestRunner().run().
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done































✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (23 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (23 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/index.py 2/3 ✓






































































































































 ✔ Formatted src/index.py
Re-checking autofixed files...





 ✔ Formatted src/index.py
Re-checking autofixed files...




Checked 1 file
✔ No issues
trunk check --fix src/index.py 3/3 ✓









































  ISSUES  
src/index.py:40:0
 40:0  medium  Possible binding to all interfaces.                                                           bandit/B104
 40:0  high    A Flask app appears to be run with debug=True, which exposes the Werkzeug debugger and        bandit/B201
               allows the execution of arbitrary code.                                                                  
Checked 1 file
2 existing issues
  • src/services/openai_service.py ✅ Commit 54d526f
• Modify the code to handle the case where the OPENAI_API_KEY environment variable is not set. This could be done by setting a default value for the openai_key parameter in the respond_to_user function.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done















































✔ 18 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  bandit 1.7.5 (10 python files)
  black 23.9.1 (9 python files)
  checkov 2.4.9 (1 docker, 3 yaml files)
  git-diff-check (23 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (10 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (1 png file)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  ruff 0.0.290 (10 python files) (created ruff.toml)
  shellcheck 0.9.0 (2 shell files) (created .shellcheckrc)
  shfmt 3.6.0 (2 shell files)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 3 yaml files)
  trufflehog 3.56.1 (23 files)
  yamllint 1.32.0 (3 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt src/services/openai_service.py 2/3 ✓
























































































































































 ✔ Formatted src/services/openai_service.py
Re-checking autofixed files...






 ✔ Formatted src/services/openai_service.py
Re-checking autofixed files...





Checked 1 file
✔ No issues
trunk check --fix src/services/openai_service.py 3/3 ✓


















  ISSUES  
src/services/openai_service.py:6:24
 6:24  high  `lib.guards.time_tracker` imported but unused  ruff/F401
Checked 1 file
1 existing issue (1 auto-fixable)

Sweep (slow): Take the original README.md file and translate it to add README files in Spanish, Hindi, Standard Arabin, French, German, Bengali, and Russian languages

Checklist
  • src/services/openai_service.py ✅ Commit d407c0b
The code in the new_file does not need any changes.
  • src/services/slack_service.py ✅ Commit 18b5b9c
1. Import the `respond_to_user` function from `services.openai_service`. 2. Add the `respond_to_user` function as a parameter to the `update_message` function. 3. Add the necessary code to call the `respond_to_user` function and handle the response. 4. Update the `update_message` function to include the necessary code for handling the response from `respond_to_user`. 5. Update the `update_home_tab` function to include the necessary code for calling the `respond_to_user` function.

Sweep (slow): Create READMEs using README.md for Chinese, Spanish and Hindi #91

Checklist
• Translate the content of the original README.md into Chinese and add it to this file. • Ensure that any code snippets or technical terms are left in their original form.
  • README_ES.md ❌ Failed
• Translate the content of the original README.md into Spanish and add it to this file. • Ensure that any code snippets or technical terms are left in their original form.
  • README_HI.md ❌ Failed
• Translate the content of the original README.md into Hindi and add it to this file. • Ensure that any code snippets or technical terms are left in their original form.

Sweep (slow): Add unit test framework and 'test' command

Add tests and framework so I can run "flask test" to execute the tests.

Prevent this from happening:
(myvenv) nchohan slack-bot % flask test
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'test'.
Also: Make it so that the OPENAI_API_KEY environment variable does not have to be set to run unit tests.

Also prevent the following error from happening:
(myvenv) nchohan slack-bot % flask test
Traceback (most recent call last):
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/bin/flask", line 8, in
sys.exit(main())
^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 1047, in main
cli.main()
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 357, in decorator
return __ctx.invoke(f, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/src/index.py", line 33, in test
tests = unittest.TestLoader().discover("tests")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 304, in discover
os.path.dirname((the_module.file)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

And also prevent this issue from happening:
ImportError: Failed to import test module: tests.test_openai_service
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
module = self._get_module_from_name(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
import(name)
File "/Users/nchohan/Dev/upmortem/slack-bot/src/tests/test_openai_service.py", line 4, in
from src.services import openai_service
ModuleNotFoundError: No module named 'src'

Sweep (slow): Replace pytest with flask test and improve testing setup

Add tests for each file in src/services directory and add framework so I can run "flask test" to execute the tests.

Prevent this from happening:
(myvenv) nchohan slack-bot % flask test
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'test'.

Also: Make it so that the OPENAI_API_KEY environment variable does not have to be set to run unit tests.

Also prevent the following error from happening:
(myvenv) nchohan slack-bot % flask test
Traceback (most recent call last):
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/bin/flask", line 8, in
sys.exit(main())
^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 1047, in main
cli.main()
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/flask/cli.py", line 357, in decorator
return __ctx.invoke(f, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/myvenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nchohan/Dev/upmortem/slack-bot/src/index.py", line 33, in test
tests = unittest.TestLoader().discover("tests")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 304, in discover
os.path.dirname((the_module.file)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

And also prevent this issue from happening:
ImportError: Failed to import test module: tests.test_openai_service
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
module = self._get_module_from_name(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
import(name)
File "/Users/nchohan/Dev/upmortem/slack-bot/src/tests/test_openai_service.py", line 4, in
from src.services import openai_service
ModuleNotFoundError: No module named 'src'

Also prevent this when pytest is run on the repo:
============================= test session starts ==============================
platform linux -- Python 3.10.13, pytest-7.4.2, pluggy-1.3.0
rootdir: /home/runner/work/slack-bot/slack-bot
collected 1 item / 1 error

==================================== ERRORS ====================================
______________ ERROR collecting src/tests/test_openai_service.py _______________
ImportError while importing test module '/home/runner/work/slack-bot/slack-bot/src/tests/test_openai_service.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
src/tests/test_openai_service.py:4: in
from src.services import openai_service
E ModuleNotFoundError: No module named 'src'
=========================== short test summary info ============================
ERROR src/tests/test_openai_service.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.20s ===============================
Error: Process completed with exit code 2.

Modify .github/workflows/build-push.yml with contents:

Change pytest to "flask test"
Prepend FLASK_APP=src/index.py before the flask test command

Prevent this from happening: test build failed with the following errors:

2023-09-25T23:45:01.8827513Z ##[group]Run export FLASK_APP=src/index.py && flask test
2023-09-25T23:45:01.8895349Z ##[endgroup]
2023-09-25T23:45:02.2699042Z Error: While importing 'src.index', an ImportError was raised:
2023-09-25T23:45:02.2699669Z
2023-09-25T23:45:02.2700551Z Traceback (most recent call last):
2023-09-25T23:45:02.2706991Z File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/flask/cli.py", line 218, in locate_app
2023-09-25T23:45:02.2707652Z import(module_name)
2023-09-25T23:45:02.2708403Z File "/home/runner/work/slack-bot/slack-bot/src/index.py", line 7, in
2023-09-25T23:45:02.2709183Z from lib.guards import shared_secret_guard
2023-09-25T23:45:02.2709723Z ModuleNotFoundError: No module named 'lib'
2023-09-25T23:45:02.2709912Z
2023-09-25T23:45:02.2709922Z
2023-09-25T23:45:02.2710077Z Usage: flask [OPTIONS] COMMAND [ARGS]...
2023-09-25T23:45:02.2710387Z Try 'flask --help' for help.
2023-09-25T23:45:02.2710539Z
2023-09-25T23:45:02.2713606Z Error: No such command 'test'.

Checklist
  • src/index.py ✅ Commit 935b98e
  • src/services/api_service.py ❌ Failed
  • src/services/openai_service.py ✅ Commit e56542f
  • src/services/slack_service.py
  • src/tests/test_api_service.py
  • src/tests/test_openai_service.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.