checkov
checkov copied to clipboard
feat(general): add env for dont check package update
User description
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
Hello!
I am using checkov in private cloud. I don't want the program to check for updates on pypi.org. It's a small pach solves my problem. I hope this is a good solution, if not, please suggest your alternatives.
Fixes # (issue)
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my feature, policy, or fix is effective and works
- [x] New and existing tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
Generated description
Dear maintainer, below is a concise technical summary of the changes proposed in this PR:
Introduce an environment variable CKV_SKIP_PACKAGE_UPDATE_CHECK to allow users to skip package update checks in checkov. Modify the check_for_update function in version_manager.py to accept a new parameter skip_check and return early if the check is skipped. Update banner.py to utilize this new parameter when checking for updates. Add the new environment variable to env_vars_config.py for configuration.
| Topic | Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Banner Update | Update banner.py to use the new skip check parameter when checking for updates.Modified files (1)
Latest Contributors(2)
| |||||||||
| Update Check Logic | Modify check_for_update to accept a skip check parameter and return early if set.Modified files (1)
Latest Contributors(2)
| |||||||||
| Env Var Addition | Introduce an environment variable CKV_SKIP_PACKAGE_UPDATE_CHECK to control package update checks.Modified files (1)
Latest Contributors(2)
|
Hi @isality , and thanks for the contribution! Out of curiosity, what would be the reason for that behaviour?
@Saarett hello!
I use checkov in the cloud where there is no Internet access. If I understood you correctly.
@Saarett Hello!
I'm sorry. Need i do something else? Keeping the branch up to date takes me a while.
can someone help me with integration tests? i don't know what's going on in your CI.
i ran tests locally all 10 tests - passed
alex@alex:~/Work/dev/checkov/checkov$ pipenv run pytest integration_tests -k 'not api_key'
==================================================================== test session starts =====================================================================
platform linux -- Python 3.10.12, pytest-8.0.0, pluggy-1.4.0
rootdir: /home/alex/Work/dev/checkov/checkov
configfile: pyproject.toml
plugins: xdist-3.5.0
2 workers [10 items]
.......... [100%]
===================================================================== 10 passed in 0.36s =====================================================================
alex@alex:~/Work/dev/checkov/checkov$ git branch -v
* feature/skip-update-check 772c88c8a Merge branch 'main' into feature/skip-update-checkale
@isality You can merge the PR :)
@pazbechor hello! i'm sorry, but i can not. "The base branch restricts merging to authorized users."