-
Notifications
You must be signed in to change notification settings - Fork 88
Fission benchmark #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…s-benchmarks into feature_fission
| @@ -0,0 +1,31 @@ | |||
| const path = require('path'), fs = require('fs'); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all wrappers, we need to compare them against newest implementation in OpenWhisk/Knative - there have been changes. In particular, storage triggers received few bugfixes.
config/systems.json
Outdated
| "languages": { | ||
| "python": { | ||
| "base_images": { | ||
| "env":"fission/python-env:latest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should verify here that we are using the correct language versions. If the user selects Python 3.10, we should use Docker image with Python 3.10 etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that is done.,
sebs/fission/config.py
Outdated
| pass | ||
|
|
||
| @staticmethod | ||
| def initialize(config: dict, cache: Cache) -> Credentials: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check here how Fission deployment works for containers - maybe we need to pass Docker credentials?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now, I am more focused on code package rahtner than contaienr deployment.
sebs/fission/config.py
Outdated
|
|
||
| def __init__(self, config: dict, cache: Cache): | ||
| self.name = config["name"] | ||
| self.shouldShutdown = config["shouldShutdown"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can completely remove the support for "shutdown" option.
sebs/fission/fission.py
Outdated
| if config is None: | ||
| config = {} | ||
|
|
||
| check_if_minikube_installed() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above -> we should assume Fission is configured and run by the user. Here, we should only initialize storage connection (see how it work in OpenWhisk).
sebs/fission/fission.py
Outdated
| self.shouldCallBuilder = True | ||
| f = open(scriptPath, "w+") | ||
| f.write( | ||
| "#!/bin/sh\npip3 install -r ${SRC_PKG}/requirements.txt -t \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed - our build image should handle that. OpenWhisk shows an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I create the zip package using the build image.,
sebs/fission/fission.py
Outdated
| Fission.add_port_forwarding() | ||
| sleep(5) | ||
|
|
||
| def package_code(self, benchmark: Benchmark) -> Tuple[str, int]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if fission supports both code packages and containers - you can use your new PR here :-)
sebs/fission/fission.py
Outdated
| def create_env_if_needed(self, name: str, image: str, builder: str): | ||
| self.envName = name | ||
| try: | ||
| fission_env_list = subprocess.run( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we create resources like environments, they should be added to the sebs.fission.config.FissionResources. No need to query again and again, we should keep that list in memory, and store in the cache to reload on the next run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, these are moved to config
sebs/fission/fission.py
Outdated
| stderr=subprocess.DEVNULL, | ||
| ) | ||
| subprocess.run( | ||
| f"grep {name}".split(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be easier to do with just a Python loop parsing the output, instead of calling Linux process again.
sebs/fission/fission.py
Outdated
| logging.info(f"Deleting fission package...") | ||
| subprocess.run(f"fission package delete --name {packageName}".split()) | ||
|
|
||
| def createFunction(self, packageName: str, name: str) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class should implement the abstract functions from sebs.faas.system.System
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I have changed that
sebs/fission/fission.py
Outdated
| self.initialize() | ||
| self.create_env_if_needed(name, image, builder) | ||
|
|
||
| def create_function(self, name: str, env_name: str, path: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what is the relation between package and function in Fission?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages hold everything that a function needs like the code package, function are wrappers outside of the package where we provide that package the function runs, what is the entry point, memoery and timeout configs etc
sebs/fission/fissionFunction.py
Outdated
| super().__init__(name) | ||
|
|
||
| def sync_invoke(self, payload: dict): | ||
| url = "http://localhost:5051/benchmark" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ports should not be hardcoded - we either invoke functions as LibraryTrigger (fission fn test?) or HTTP trigger - we have a class for that, we just need the URL to make it work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as of now I have implemented Http trigger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change the hardcoded URL
sebs/fission/minio.py
Outdated
| import os | ||
|
|
||
|
|
||
| class Minio(PersistentStorage): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should replace it with a generic implementation of Minio - look at OpenWhisk. There should be no need to specialize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
sebs/fission/readme.md
Outdated
| @@ -0,0 +1,43 @@ | |||
| # Fission | |||
|
|
|||
| ### Requirements | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation should go directly to docs/platforms.md :-)
WalkthroughThe changes significantly enhance support for the Fission platform within an existing system, focusing on serverless function management and storage integration. Key updates include the introduction of new handler functions for both Python and Node.js, Docker configurations, and comprehensive logging mechanisms. These modifications aim to streamline interactions with MinIO storage and improve overall deployment capabilities, making the system more robust and adaptable for modern cloud applications. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 51
Outside diff range, codebase verification and nitpick comments (4)
dockerfiles/fission/python/Dockerfile.function (1)
5-5: Consider removing or uncommenting the COPY command.The commented-out COPY command might be intentional for future use, but it could be confusing. Consider removing it or adding a comment explaining its purpose.
sebs/fission/storage.py (1)
1-1: Consider organizing imports.While not critical, organizing imports (standard library, third-party, local) can improve readability.
config/systems.json (1)
237-269: Verify and update the base images and versions.The specified base images and versions for Python and Node.js in the Fission configuration do not match the tags found in the Fission Docker Hub repository. The tags appear to be versioned by the Fission release version rather than the language version. Please verify and update the configuration to reflect the correct tagging convention used by Fission.
- Python base images:
fission/python-builder(versions:1.34.0,1.33.1,1.32.2, etc.)- Node.js base images:
fission/node-builder(versions:1.32.2,1.32.1,1.31.1, etc.)Analysis chain
Verify the correctness of the base images and versions.
Ensure that the specified base images and versions for Python and Node.js are correct and up-to-date. This is crucial to avoid compatibility issues.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the base images and versions for Python and Node.js in the Fission configuration. # Test: Search for the base images in the Fission Docker Hub repository. Expect: The specified images should exist and be up-to-date. curl -s https://hub.docker.com/v2/repositories/fission | jq '.results[].name' # Test: Verify the specified versions are available for the base images. Expect: The specified versions should be listed. curl -s https://hub.docker.com/v2/repositories/fission/python-builder-3.7/tags | jq '.results[].name' curl -s https://hub.docker.com/v2/repositories/fission/node-builder-12/tags | jq '.results[].name'Length of output: 477
Script:
#!/bin/bash # Description: Verify the existence and versions of the base images for Python and Node.js in the Fission Docker Hub repository. # Test: Search for the exact base images in the Fission Docker Hub repository. curl -s https://hub.docker.com/v2/repositories/fission/python-builder/tags | jq '.results[].name' curl -s https://hub.docker.com/v2/repositories/fission/node-builder/tags | jq '.results[].name'Length of output: 373
sebs/fission/config.py (1)
17-18: Ensure consistency in the serialization format.The
serializemethod insebs/fission/config.pyreturns an empty dictionary. This is inconsistent with otherserializemethods in the codebase that return more detailed dictionaries. If additional attributes are added toFissionCredentialsin the future, ensure they are included in the serialization.
sebs/fission/config.py(lines 17-18)Analysis chain
Ensure consistency in the serialization format.
The
serializemethod returns an empty dictionary. If additional attributes are added toFissionCredentialsin the future, ensure they are included in the serialization.
Let's re-run the verification with a corrected search pattern to ensure we capture the usage of the
serializemethod.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the serialization method for consistency. # Test: Search for the serialize method usage. Expect: Consistent use of serialization format. rg --type python -A 5 $'def serialize'Length of output: 70
Script:
#!/bin/bash # Description: Verify the serialization method for consistency. # Test: Search for the serialize method usage. Expect: Consistent use of serialization format. rg 'def serialize' -t py -A 5Length of output: 17548
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (34)
- .gitignore (1 hunks)
- benchmarks/100.webapps/110.dynamic-html/python/function.py (1 hunks)
- benchmarks/wrappers/fission/nodejs/handler.js (1 hunks)
- benchmarks/wrappers/fission/nodejs/storage.js (1 hunks)
- benchmarks/wrappers/fission/python/main.py (1 hunks)
- benchmarks/wrappers/fission/python/build.sh (1 hunks)
- benchmarks/wrappers/fission/python/handler.py (1 hunks)
- benchmarks/wrappers/fission/python/setup.py (1 hunks)
- benchmarks/wrappers/fission/python/storage.py (1 hunks)
- config/example.json (2 hunks)
- config/fission.json (1 hunks)
- config/systems.json (1 hunks)
- dockerfiles/fission/python/Dockerfile.build (1 hunks)
- dockerfiles/fission/python/Dockerfile.function (1 hunks)
- install.py (2 hunks)
- out_storage.json (1 hunks)
- sebs.py (1 hunks)
- sebs/aws/aws.py (1 hunks)
- sebs/benchmark.py (1 hunks)
- sebs/faas/config.py (1 hunks)
- sebs/faas/system.py (1 hunks)
- sebs/fission/init.py (1 hunks)
- sebs/fission/config.py (1 hunks)
- sebs/fission/fission.py (1 hunks)
- sebs/fission/fissionFunction.py (1 hunks)
- sebs/fission/function.py (1 hunks)
- sebs/fission/minio.py (1 hunks)
- sebs/fission/readme.md (1 hunks)
- sebs/fission/storage.py (1 hunks)
- sebs/fission/triggers.py (1 hunks)
- sebs/sebs.py (1 hunks)
- sebs/storage/minio.py (1 hunks)
- tools/build_docker_images.py (2 hunks)
- tools/fission_preparation.py (1 hunks)
Files skipped from review due to trivial changes (4)
- .gitignore
- benchmarks/wrappers/fission/python/build.sh
- config/fission.json
- sebs/fission/init.py
Additional context used
Gitleaks
out_storage.json
4-4: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
5-5: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
config/example.json
83-83: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
84-84: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
104-104: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
105-105: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
Ruff
benchmarks/wrappers/fission/python/__main__.py
5-5:
minioimported but unusedRemove unused import:
minio(F401)
benchmarks/wrappers/fission/python/storage.py
3-3:
jsonimported but unusedRemove unused import:
json(F401)
tools/fission_preparation.py
25-25: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
135-135: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
sebs/fission/minio.py
148-148: Loop control variable
inot used within loop bodyRename unused
ito_i(B007)
150-150: Loop control variable
inot used within loop bodyRename unused
ito_i(B007)
sebs/fission/config.py
146-146: f-string without any placeholders
Remove extraneous
fprefix(F541)
172-172: f-string without any placeholders
Remove extraneous
fprefix(F541)
182-182: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
sebs/fission/fission.py
8-8:
jsonimported but unusedRemove unused import:
json(F401)
9-9:
time.sleepimported but unusedRemove unused import:
time.sleep(F401)
10-10: Redefinition of unused
Dictfrom line 5Remove definition:
Dict(F811)
10-10: Redefinition of unused
Tuplefrom line 5Remove definition:
Tuple(F811)
10-10: Redefinition of unused
Listfrom line 5Remove definition:
List(F811)
24-24:
tools.fission_preparation.check_if_minikube_installedimported but unusedRemove unused import
(F401)
25-25:
tools.fission_preparation.run_minikubeimported but unusedRemove unused import
(F401)
26-26:
tools.fission_preparation.check_if_k8s_installedimported but unusedRemove unused import
(F401)
27-27:
tools.fission_preparation.check_if_helm_installedimported but unusedRemove unused import
(F401)
28-28:
tools.fission_preparation.stop_minikubeimported but unusedRemove unused import
(F401)
60-60: Do not use mutable data structures for argument defaults
Replace with
None; initialize within function(B006)
284-284: Local variable
package_configis assigned to but never usedRemove assignment to unused variable
package_config(F841)
348-348: f-string without any placeholders
Remove extraneous
fprefix(F541)
355-355: f-string without any placeholders
Remove extraneous
fprefix(F541)
546-546: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
551-551: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
575-575: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
580-580: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
656-656: f-string without any placeholders
Remove extraneous
fprefix(F541)
681-681: Undefined name
response(F821)
685-685: Undefined name
HTTPTrigger(F821)
696-696: Undefined name
LibraryTrigger(F821)
Biome
benchmarks/wrappers/fission/nodejs/storage.js
[error] 55-55: Using this in a static context can be confusing.
this refers to the class.
Unsafe fix: Use the class name instead.(lint/complexity/noThisInStatic)
[error] 56-56: Using this in a static context can be confusing.
this refers to the class.
Unsafe fix: Use the class name instead.(lint/complexity/noThisInStatic)
[error] 58-58: Using this in a static context can be confusing.
this refers to the class.
Unsafe fix: Use the class name instead.(lint/complexity/noThisInStatic)
LanguageTool
sebs/fission/readme.md
[grammar] ~31-~31: The word ‘deploy’ is a verb. Did you mean the noun “deployment” (= release, placement)?
Context: ...tailed information that goes beyond the deploy hello world function. Many important fu...(PREPOSITION_VERB)
[typographical] ~31-~31: The word “therefore” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...istics regarding the performance of the function, therefore the only certain benchmarks are time me...(THUS_SENTENCE)
[uncategorized] ~31-~31: Use a comma before ‘but’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...ing with Fission in the same napespace but we were unable to obtain it therefore, ...(COMMA_COMPOUND_SENTENCE)
[grammar] ~34-~34: Use the plural noun, or add a word such as ‘the’ or ‘some’ in front of ‘other’.
Context: ...sources (for example, requirements.txt, other file, other script) we must create a package...(OTHER_NN)
[uncategorized] ~37-~37: You might be missing the article “the” here.
Context: ...file using environment variables inside Fission namespace. ```sh pip3 install...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
Markdownlint
sebs/fission/readme.md
3-3: Expected: h2; Actual: h3
Heading levels should only increment by one level at a time(MD001, heading-increment)
11-11: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
14-14: Punctuation: ':'
Trailing punctuation in heading(MD026, no-trailing-punctuation)
Additional comments not posted (29)
dockerfiles/fission/python/Dockerfile.function (1)
1-4: Ensure proper base image and environment variable usage.The Dockerfile sets the base image and Python version correctly. Ensure that
$BASE_IMAGEand${VERSION}are provided during the build process.sebs/fission/storage.py (3)
9-12: LGTM!The
deployment_namemethod correctly returns the deployment name.
14-21: LGTM!The constructor correctly initializes the
Minioclass with the provided parameters.
23-27: LGTM!The
deserializemethod correctly deserializes the cached configuration.benchmarks/100.webapps/110.dynamic-html/python/function.py (2)
12-12: LGTM!The new import statement is necessary for the changes made to the
handlerfunction.
15-15: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
handlermatch the new usage ofrequest.get_json(force=True).Verification successful
Verification successful: All function calls to
handlermatch the new usage ofrequest.get_json(force=True).The
handlerfunction inbenchmarks/100.webapps/110.dynamic-html/python/function.pycorrectly usesrequest.get_json(force=True)as expected.
benchmarks/100.webapps/110.dynamic-html/python/function.py: Verified usage ofrequest.get_json(force=True)in thehandlerfunction.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `handler` match the new usage. # Test: Search for the function usage. Expect: Only occurrences of the new usage. rg --type python -A 5 $'handler'Length of output: 62
Script:
#!/bin/bash # Description: Verify all function calls to `handler` match the new usage. # Test: Search for the function usage. Expect: Only occurrences of the new usage. rg --type py -A 5 'handler'Length of output: 61880
Script:
#!/bin/bash # Description: Verify the `handler` function usage in the specific file where the change was made. # Test: Search for the `handler` function in the specific file. Expect: Only occurrences of the new usage. rg 'handler' benchmarks/100.webapps/110.dynamic-html/python/function.py -A 5Length of output: 225
benchmarks/wrappers/fission/nodejs/handler.js (1)
1-1: LGTM!The new file and its contents are appropriate.
dockerfiles/fission/python/Dockerfile.build (1)
1-26: LGTM!The Dockerfile is well-constructed and includes the necessary dependencies and setup steps.
sebs/fission/fissionFunction.py (1)
39-40: LGTM!The code changes are approved.
config/example.json (1)
9-9: LGTM!The update to Python version 3.8 is appropriate.
sebs/fission/readme.md (1)
11-11: LGTM!The command to run the benchmark is clear and correctly formatted.
Tools
Markdownlint
11-11: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
tools/build_docker_images.py (2)
13-13: LGTM!The addition of the
fissionchoice to the--deploymentargument is correctly formatted.
53-53: LGTM!The addition of the print statement before the
client.images.buildcall is helpful for debugging.sebs/fission/triggers.py (11)
11-15: LGTM!The
__init__method is correctly implemented.
17-19: LGTM!The
trigger_typemethod is correctly implemented.
21-24: LGTM!The
fission_cmdproperty is correctly implemented.
26-28: LGTM!The
fission_cmdsetter is correctly implemented.
31-37: LGTM!The
get_commandmethod is correctly implemented.
66-69: LGTM!The
async_invokemethod is correctly implemented.
84-87: LGTM!The
__init__method is correctly implemented.
90-91: LGTM!The
typenamemethod is correctly implemented.
94-95: LGTM!The
trigger_typemethod is correctly implemented.
97-99: LGTM!The
sync_invokemethod is correctly implemented.
101-104: LGTM!The
async_invokemethod is correctly implemented.install.py (2)
66-68: LGTM! But verify the environment variable handling.The code changes are approved.
However, ensure that the environment variables for "fission" are handled correctly.
Verification successful
Environment variable handling verified.
The environment variable
SEBS_WITH_FISSIONis correctly set in theactivatescript and unset in thedeactivatescript. There are no other references to this variable in the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the handling of environment variables for "fission". # Test: Search for all references to "SEBS_WITH_FISSION". Expect: Consistent handling similar to other environment variables. rg --type python -A 5 $'SEBS_WITH_FISSION'Length of output: 72
Script:
#!/bin/bash # Description: Verify the handling of environment variables for "fission". # Test: Search for all references to "SEBS_WITH_FISSION". Expect: Consistent handling similar to other environment variables. rg -t py -A 5 'SEBS_WITH_FISSION'Length of output: 472
10-10: Verify usage of the new deployment option.Ensure that the new deployment option "fission" is handled correctly throughout the codebase.
Verification successful
The new deployment option "fission" is handled correctly throughout the codebase.
The references to "fission" are consistent with other deployment options in various contexts, such as argument parsing, function calls, and configuration settings.
sebs.pyinstall.pytools/fission_preparation.pytools/build_docker_images.pysebs/sebs.pysebs/benchmark.pysebs/fission/*sebs/faas/config.pyScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to the new deployment option "fission". # Test: Search for all references to "fission". Expect: Consistent handling similar to other deployment options. rg --type python -A 5 $'fission'Length of output: 62
Script:
#!/bin/bash # Description: Verify all references to the new deployment option "fission". # Test: Search for all references to "fission". Expect: Consistent handling similar to other deployment options. rg --glob '*.py' -A 5 'fission'Length of output: 34049
benchmarks/wrappers/fission/python/storage.py (1)
8-8: LGTM! Verify the usage of the class.The class
storageand its methods are implemented correctly.However, ensure that the class is used correctly throughout the codebase.
Verification successful
The usage of the
storageclass is correct throughout the codebase.The class
storageand its methods are implemented and used correctly in various contexts across the codebase.
sebs.pyinstall.pytools/openwhisk_preparation.pytests/aws/invoke_function_sdk.pytests/aws/invoke_function_http.pytests/aws/create_function.pysebs/sebs.pysebs/fission/storage.pysebs/fission/minio.pysebs/fission/function.pysebs/fission/fission.pysebs/fission/config.pysebs/benchmark.pysebs/types.pysebs/storage/minio.pysebs/openwhisk/storage.pysebs/openwhisk/openwhisk.pysebs/openwhisk/function.pysebs/openwhisk/config.pysebs/local/local.pysebs/local/storage.pysebs/local/deployment.pysebs/local/config.pysebs/gcp/storage.pysebs/gcp/gcp.pysebs/gcp/function.pysebs/gcp/config.pysebs/faas/system.pysebs/faas/config.pysebs/faas/storage.pysebs/experiments/perf_cost.pysebs/experiments/network_ping_pong.pysebs/experiments/invocation_overhead.pysebs/experiments/config.pysebs/azure/azure.pysebs/azure/config.pysebs/azure/blob_storage.pysebs/aws/aws.pysebs/aws/s3.pysebs/aws/function.pyscripts/cloud_results.pyscripts/run_experiments.pydockerfiles/local/runner.pybenchmarks/400.inference/411.image-recognition/input.pybenchmarks/500.scientific/504.dna-visualisation/python/function.pybenchmarks/400.inference/411.image-recognition/python/function.pybenchmarks/wrappers/fission/python/storage.pybenchmarks/wrappers/openwhisk/python/storage.pybenchmarks/wrappers/azure/python/storage.pybenchmarks/wrappers/aws/python/handler.pybenchmarks/wrappers/local/python/storage.pybenchmarks/300.utilities/311.compression/input.pybenchmarks/300.utilities/311.compression/python/function.pybenchmarks/wrappers/aws/python/storage.pybenchmarks/wrappers/azure/python/handler.pybenchmarks/wrappers/gcp/python/handler.pybenchmarks/wrappers/gcp/python/storage.pybenchmarks/000.microbenchmarks/020.network-benchmark/python/function.pybenchmarks/200.multimedia/220.video-processing/input.pybenchmarks/000.microbenchmarks/030.clock-synchronization/python/function.pybenchmarks/200.multimedia/220.video-processing/python/function.pybenchmarks/200.multimedia/210.thumbnailer/input.pybenchmarks/100.webapps/120.uploader/python/function.pybenchmarks/200.multimedia/210.thumbnailer/python/function.pyScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the `storage` class. # Test: Search for all references to the `storage` class. Expect: Correct usage throughout the codebase. rg --type python -A 5 $'storage'Length of output: 62
Script:
#!/bin/bash # Description: Verify the usage of the `storage` class. # Test: Search for all references to the `storage` class. Expect: Correct usage throughout the codebase. rg -t py -A 5 'storage'Length of output: 134924
sebs/fission/config.py (1)
37-39: Ensure thetypenamemethod is consistent with class name.The
typenamemethod returns a string representing the class type. Ensure this is consistent with the class name to avoid confusion.Verification successful
The
typenamemethod insebs/fission/config.pyis consistent with the class name.The
typenamemethod returns "Fission.Resources", which matches the class nameFissionResources.
sebs/fission/config.py: class FissionResources(Resources)Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the typename method consistency with class name. # Test: Search for the typename method usage. Expect: Consistent use of class name. rg --type python -A 5 $'def typename'Length of output: 69
Script:
#!/bin/bash # Description: Verify the typename method consistency with class name. # Test: Search for the typename method usage. Expect: Consistent use of class name. rg --glob '*.py' -A 5 'def typename'Length of output: 10688
Script:
#!/bin/bash # Description: Verify the class name in sebs/fission/config.py to ensure consistency with the typename method. # Test: Search for the class definition in sebs/fission/config.py. Expect: Class name matches "Fission.Resources". rg --glob 'sebs/fission/config.py' -A 5 'class 'Length of output: 1011
sebs.py (1)
91-91: LGTM!The addition of the "fission" option in the
common_paramsfunction is correct and aligns with the PR objectives.
out_storage.json
Outdated
| "access_key": "kBc9m5lA7Knej-ZDf9I6KRgm9mBAendq3AvriBvDEEI", | ||
| "secret_key": "c475e70264063e366f74a63fae338c0ed51eccca2a1d2c79b43945eaa242d355", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid hardcoding sensitive information.
The access key and secret key are hardcoded, which is a security risk. Use environment variables or a secrets management system to manage these keys securely.
- "access_key": "kBc9m5lA7Knej-ZDf9I6KRgm9mBAendq3AvriBvDEEI",
- "secret_key": "c475e70264063e366f74a63fae338c0ed51eccca2a1d2c79b43945eaa242d355",
+ "access_key": "${MINIO_ACCESS_KEY}",
+ "secret_key": "${MINIO_SECRET_KEY}",Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "access_key": "kBc9m5lA7Knej-ZDf9I6KRgm9mBAendq3AvriBvDEEI", | |
| "secret_key": "c475e70264063e366f74a63fae338c0ed51eccca2a1d2c79b43945eaa242d355", | |
| "access_key": "${MINIO_ACCESS_KEY}", | |
| "secret_key": "${MINIO_SECRET_KEY}", |
Tools
Gitleaks
4-4: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
5-5: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
| @@ -0,0 +1,14 @@ | |||
| from distutils.core import setup | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using setuptools instead of distutils.
setuptools is more commonly used and offers more features and flexibility compared to distutils.
- from distutils.core import setup
+ from setuptools import setupCommittable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| from distutils.core import setup | |
| from setuptools import setup |
sebs/fission/fissionFunction.py
Outdated
| # TODO: this part is form AWS, need to be rethink | ||
| # self._deployment.get_invocation_error( | ||
| # function_name=self.name, | ||
| # start_time=int(begin.strftime("%s")) - 1, | ||
| # end_time=int(end.strftime("%s")) + 1, | ||
| # ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove or complete the TODO comment.
The TODO comment indicates incomplete code. Either complete the implementation or remove the comment.
- # TODO: this part is form AWS, need to be rethink
- # self._deployment.get_invocation_error(
- # function_name=self.name,
- # start_time=int(begin.strftime("%s")) - 1,
- # end_time=int(end.strftime("%s")) + 1,
- # )
+ # TODO: Implement error handling for FissionCommittable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # TODO: this part is form AWS, need to be rethink | |
| # self._deployment.get_invocation_error( | |
| # function_name=self.name, | |
| # start_time=int(begin.strftime("%s")) - 1, | |
| # end_time=int(end.strftime("%s")) + 1, | |
| # ) | |
| # TODO: Implement error handling for Fission |
| # PK: To do: Marcin Need to add this docker image with fission to the dockerhub | ||
| # image_name = image_name.replace('fission', 'aws') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code.
The commented-out code should be removed if it is not needed.
- # PK: To do: Marcin Need to add this docker image with fission to the dockerhub
- # image_name = image_name.replace('fission', 'aws')Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # PK: To do: Marcin Need to add this docker image with fission to the dockerhub | |
| # image_name = image_name.replace('fission', 'aws') |
sebs/benchmark.py
Outdated
| print("are we in the else Block") | ||
| repo_name = self._system_config.docker_repository() | ||
| print("THE REPO NAME IS", repo_name) | ||
| print("The deployment name we get here is", self._deployment_name) | ||
| image_name = "build.{deployment}.{language}.{runtime}".format( | ||
| deployment=self._deployment_name, | ||
| language=self.language_name, | ||
| runtime=self.language_version, | ||
| ) | ||
| # PK: To do: Marcin Need to add this docker image with fission to the dockerhub | ||
| # image_name = image_name.replace('fission', 'aws') | ||
| print("THE Iage NAME IS", image_name) | ||
| print("THE repo name ", repo_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove debugging print statements.
The print statements are generally used for debugging and should be replaced with proper logging or removed.
- print("are we in the else Block")
- print("THE REPO NAME IS", repo_name)
- print("The deployment name we get here is", self._deployment_name)
- print("THE Iage NAME IS", image_name)
- print("THE repo name ", repo_name)Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| print("are we in the else Block") | |
| repo_name = self._system_config.docker_repository() | |
| print("THE REPO NAME IS", repo_name) | |
| print("The deployment name we get here is", self._deployment_name) | |
| image_name = "build.{deployment}.{language}.{runtime}".format( | |
| deployment=self._deployment_name, | |
| language=self.language_name, | |
| runtime=self.language_version, | |
| ) | |
| # PK: To do: Marcin Need to add this docker image with fission to the dockerhub | |
| # image_name = image_name.replace('fission', 'aws') | |
| print("THE Iage NAME IS", image_name) | |
| print("THE repo name ", repo_name) | |
| repo_name = self._system_config.docker_repository() | |
| image_name = "build.{deployment}.{language}.{runtime}".format( | |
| deployment=self._deployment_name, | |
| language=self.language_name, | |
| runtime=self.language_version, | |
| ) | |
| # PK: To do: Marcin Need to add this docker image with fission to the dockerhub | |
| # image_name = image_name.replace('fission', 'aws') |
sebs/fission/minio.py
Outdated
| outputNumber = buckets[1] | ||
| for i in range(inputNumber): | ||
| self.add_input_bucket(benchmark) | ||
| for i in range(outputNumber): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename unused loop control variable.
Rename the unused loop control variable i to _i to indicate that it is intentionally unused.
- for i in range(outputNumber):
+ for _i in range(outputNumber):Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| for i in range(outputNumber): | |
| for _i in range(outputNumber): |
Tools
Ruff
150-150: Loop control variable
inot used within loop bodyRename unused
ito_i(B007)
sebs/fission/minio.py
Outdated
| def allocate_buckets(self, benchmark: str, buckets: Tuple[int, int]): | ||
| inputNumber = buckets[0] | ||
| outputNumber = buckets[1] | ||
| for i in range(inputNumber): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename unused loop control variable.
Rename the unused loop control variable i to _i to indicate that it is intentionally unused.
- for i in range(inputNumber):
+ for _i in range(inputNumber):Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| for i in range(inputNumber): | |
| for _i in range(inputNumber): |
Tools
Ruff
148-148: Loop control variable
inot used within loop bodyRename unused
ito_i(B007)
sebs/fission/readme.md
Outdated
| - cleanup after benchmark | ||
|
|
||
| ### About | ||
| Fission has very simplified [documentation][df1]. It is difficult to find detailed information that goes beyond the deploy hello world function. Many important functionalities are omitted and others have been implemented in a very non-intuitive way (limiting the display of function logs to 20 lines). *Fission* functions as a black box, making it difficult to extract information about what is happening with the function being performed. The documentation does not explain the folder structure on which the function is deployed. *Fission* does not require configuration in the form of login data because in our case it is run locally. The user does not receive any statistics regarding the performance of the function, therefore the only certain benchmarks are time measures. *Fission* works on *Kubernetes* so it is possible to access the metrics for the given application. However, these statistics will apply to the specific pod / pods and not the function itself. In addition, these are other than those required by the statistics interface from other benchmarks (*AWS*). It is possible to obtain records from *Prometheus* existing with *Fission* in the same napespace but we were unable to obtain it therefore, the values for memory benchmarks have not been implemented. *Fission* does not provide access to storage service, which is why we implemented storage based on *MinIO*. *Fission* uses *Flask* to handle requests in *Python*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix Grammatical Issues and Improve Clarity
There are several grammatical issues and unclear sentences in this section. Suggested fixes:
- ...tailed information that goes beyond the deploy hello world function. Many important fu...
+ ...tailed information that goes beyond deploying a hello world function. Many important fu...
- ...istics regarding the performance of the function, therefore the only certain benchmarks are time me...
+ ...istics regarding the performance of the function. Therefore, the only certain benchmarks are time me...
- ...ing with *Fission* in the same napespace but we were unable to obtain it therefore, ...
+ ...ing with *Fission* in the same namespace, but we were unable to obtain it. Therefore, ...
- ...sources (for example, requirements.txt, other file, other script) we must create a package...
+ ...sources (for example, requirements.txt, other files, other scripts) we must create a package...
- ...file using environment variables inside *Fission* namespace.
+ ...file using environment variables inside the *Fission* namespace.Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Fission has very simplified [documentation][df1]. It is difficult to find detailed information that goes beyond the deploy hello world function. Many important functionalities are omitted and others have been implemented in a very non-intuitive way (limiting the display of function logs to 20 lines). *Fission* functions as a black box, making it difficult to extract information about what is happening with the function being performed. The documentation does not explain the folder structure on which the function is deployed. *Fission* does not require configuration in the form of login data because in our case it is run locally. The user does not receive any statistics regarding the performance of the function, therefore the only certain benchmarks are time measures. *Fission* works on *Kubernetes* so it is possible to access the metrics for the given application. However, these statistics will apply to the specific pod / pods and not the function itself. In addition, these are other than those required by the statistics interface from other benchmarks (*AWS*). It is possible to obtain records from *Prometheus* existing with *Fission* in the same napespace but we were unable to obtain it therefore, the values for memory benchmarks have not been implemented. *Fission* does not provide access to storage service, which is why we implemented storage based on *MinIO*. *Fission* uses *Flask* to handle requests in *Python*. | |
| Fission has very simplified [documentation][df1]. It is difficult to find detailed information that goes beyond deploying a hello world function. Many important functionalities are omitted and others have been implemented in a very non-intuitive way (limiting the display of function logs to 20 lines). *Fission* functions as a black box, making it difficult to extract information about what is happening with the function being performed. The documentation does not explain the folder structure on which the function is deployed. *Fission* does not require configuration in the form of login data because in our case it is run locally. The user does not receive any statistics regarding the performance of the function. Therefore, the only certain benchmarks are time measures. *Fission* works on *Kubernetes* so it is possible to access the metrics for the given application. However, these statistics will apply to the specific pod / pods and not the function itself. In addition, these are other than those required by the statistics interface from other benchmarks (*AWS*). It is possible to obtain records from *Prometheus* existing with *Fission* in the same namespace, but we were unable to obtain it. Therefore, the values for memory benchmarks have not been implemented. *Fission* does not provide access to storage service, which is why we implemented storage based on *MinIO*. *Fission* uses *Flask* to handle requests in *Python*. |
Tools
LanguageTool
[grammar] ~31-~31: The word ‘deploy’ is a verb. Did you mean the noun “deployment” (= release, placement)?
Context: ...tailed information that goes beyond the deploy hello world function. Many important fu...(PREPOSITION_VERB)
[typographical] ~31-~31: The word “therefore” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...istics regarding the performance of the function, therefore the only certain benchmarks are time me...(THUS_SENTENCE)
[uncategorized] ~31-~31: Use a comma before ‘but’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...ing with Fission in the same napespace but we were unable to obtain it therefore, ...(COMMA_COMPOUND_SENTENCE)
sebs/fission/readme.md
Outdated
| - automatic Fission instalation if nessesary | ||
| - Fission environment preparation | ||
| - config for Fission | ||
| - packaging code with support requirement file (python) | ||
| - deploying function (python, node) | ||
| - adding http trigger | ||
| - cache usage implementation | ||
| - automatic sync function invoke | ||
| - measurement executions times | ||
| - if cold start checking | ||
| - storage service usage - Minio | ||
| - wrapper-handler for Python, Node | ||
| - wrapper-storage for Python | ||
| - cleanup after benchmark | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix Typographical and Grammatical Errors
There are several typographical and grammatical errors in this section. Suggested fixes:
- - automatic Fission instalation if nessesary
+ - automatic Fission installation if necessary
- - if cold start checking
+ - cold start checkingCommittable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - automatic Fission instalation if nessesary | |
| - Fission environment preparation | |
| - config for Fission | |
| - packaging code with support requirement file (python) | |
| - deploying function (python, node) | |
| - adding http trigger | |
| - cache usage implementation | |
| - automatic sync function invoke | |
| - measurement executions times | |
| - if cold start checking | |
| - storage service usage - Minio | |
| - wrapper-handler for Python, Node | |
| - wrapper-storage for Python | |
| - cleanup after benchmark | |
| - automatic Fission instalation if nessesary | |
| - Fission environment preparation | |
| - config for Fission | |
| - packaging code with support requirement file (python) | |
| - deploying function (python, node) | |
| - adding http trigger | |
| - cache usage implementation | |
| - automatic sync function invoke | |
| - measurement executions times | |
| - if cold start checking | |
| - storage service usage - Minio | |
| - wrapper-handler for Python, Node | |
| - wrapper-storage for Python | |
| - cleanup after benchmark | |
| + automatic Fission installation if necessary | |
| + Fission environment preparation | |
| + config for Fission | |
| + packaging code with support requirement file (python) | |
| + deploying function (python, node) | |
| + adding http trigger | |
| + cache usage implementation | |
| + automatic sync function invoke | |
| + measurement executions times | |
| + cold start checking | |
| + storage service usage - Minio | |
| + wrapper-handler for Python, Node | |
| + wrapper-storage for Python | |
| + cleanup after benchmark |
| def sync_invoke(self, payload: dict) -> ExecutionResult: | ||
| command = self.fission_cmd + self.get_command(payload) | ||
| error = None | ||
| try: | ||
| begin = datetime.datetime.now() | ||
| response = subprocess.run( | ||
| command, | ||
| stdout=subprocess.PIPE, | ||
| stderr=subprocess.DEVNULL, | ||
| check=True, | ||
| ) | ||
| end = datetime.datetime.now() | ||
| parsed_response = response.stdout.decode("utf-8") | ||
| except (subprocess.CalledProcessError, FileNotFoundError) as e: | ||
| end = datetime.datetime.now() | ||
| error = e | ||
|
|
||
| fission_result = ExecutionResult.from_times(begin, end) | ||
| if error is not None: | ||
| self.logging.error("Invocation of {} failed!".format(self.fname)) | ||
| fission_result.stats.failure = True | ||
| return fission_result | ||
|
|
||
| return_content = json.loads(parsed_response) | ||
| fission_result.parse_benchmark_output(return_content) | ||
| return fission_result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Log error output
Redirecting stderr to DEVNULL might hide useful error information. Consider logging the error output for better debugging.
- stderr=subprocess.DEVNULL,
+ stderr=subprocess.PIPE,Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| def sync_invoke(self, payload: dict) -> ExecutionResult: | |
| command = self.fission_cmd + self.get_command(payload) | |
| error = None | |
| try: | |
| begin = datetime.datetime.now() | |
| response = subprocess.run( | |
| command, | |
| stdout=subprocess.PIPE, | |
| stderr=subprocess.DEVNULL, | |
| check=True, | |
| ) | |
| end = datetime.datetime.now() | |
| parsed_response = response.stdout.decode("utf-8") | |
| except (subprocess.CalledProcessError, FileNotFoundError) as e: | |
| end = datetime.datetime.now() | |
| error = e | |
| fission_result = ExecutionResult.from_times(begin, end) | |
| if error is not None: | |
| self.logging.error("Invocation of {} failed!".format(self.fname)) | |
| fission_result.stats.failure = True | |
| return fission_result | |
| return_content = json.loads(parsed_response) | |
| fission_result.parse_benchmark_output(return_content) | |
| return fission_result | |
| def sync_invoke(self, payload: dict) -> ExecutionResult: | |
| command = self.fission_cmd + self.get_command(payload) | |
| error = None | |
| try: | |
| begin = datetime.datetime.now() | |
| response = subprocess.run( | |
| command, | |
| stdout=subprocess.PIPE, | |
| stderr=subprocess.PIPE, | |
| check=True, | |
| ) | |
| end = datetime.datetime.now() | |
| parsed_response = response.stdout.decode("utf-8") | |
| except (subprocess.CalledProcessError, FileNotFoundError) as e: | |
| end = datetime.datetime.now() | |
| error = e | |
| fission_result = ExecutionResult.from_times(begin, end) | |
| if error is not None: | |
| self.logging.error("Invocation of {} failed!".format(self.fname)) | |
| fission_result.stats.failure = True | |
| return fission_result | |
| return_content = json.loads(parsed_response) | |
| fission_result.parse_benchmark_output(return_content) | |
| return fission_result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 76
Outside diff range, codebase verification and nitpick comments (14)
testing/originalnodep/_yaml/__init__.py (1)
18-24: Addstacklevelto the warning.Adding a
stacklevelargument to thewarnings.warncall helps identify where the warning originates in the code.warnings.warn( 'The _yaml extension module is now located at yaml._yaml' ' and its location is subject to change. To use the' ' LibYAML-based parser and emitter, import from `yaml`:' ' `from yaml import CLoader as Loader, CDumper as Dumper`.', - DeprecationWarning + DeprecationWarning, + stacklevel=2 )Tools
Ruff
18-18: No explicit
stacklevelkeyword argument found(B028)
testing/prajintry/pacakges/_yaml/__init__.py (1)
18-24: Addstacklevelto the warning.Adding a
stacklevelargument to thewarnings.warncall helps identify where the warning originates in the code.warnings.warn( 'The _yaml extension module is now located at yaml._yaml' ' and its location is subject to change. To use the' ' LibYAML-based parser and emitter, import from `yaml`:' ' `from yaml import CLoader as Loader, CDumper as Dumper`.', - DeprecationWarning + DeprecationWarning, + stacklevel=2 )Tools
Ruff
18-18: No explicit
stacklevelkeyword argument found(B028)
testing/prajintry/pacakges/yaml/nodes.py (1)
8-23: Remove commented-out code.The commented-out code in the
__repr__method ofNodeis unnecessary and could be removed to improve readability.def __repr__(self): value = self.value - #if isinstance(value, list): - # if len(value) == 0: - # value = '<empty>' - # elif len(value) == 1: - # value = '<1 item>' - # else: - # value = '<%d items>' % len(value) - #else: - # if len(value) > 75: - # value = repr(value[:70]+u' ... ') - # else: - # value = repr(value) value = repr(value) return '%s(tag=%r, value=%s)' % (self.__class__.__name__, self.tag, value)tools/build_docker_images.py (2)
30-30: Improved message clarity inbuildfunction.The change from
print(msg)toprint("The message is", msg)clarifies the output but is primarily a stylistic choice.
107-107: Debugging print statement detected.The print statement "First if" seems to be for debugging purposes. Consider removing it before merging to maintain clean code.
- print("First if ")benchmarks/wrappers/fission/python/storage.py (1)
43-50: Enhance theunique_namemethod.The method generates a unique name by appending a random UUID segment. Consider adding a parameter to control the length of the random segment for flexibility.
def unique_name(name, random_length=8): name, extension = os.path.splitext(name) random_segment = str(uuid.uuid4()).split('-')[0][:random_length] return f'{name}.{random_segment}{extension}'testing/prajintry/pacakges/yaml/reader.py (1)
24-43: Improve exception message formatting.The
__str__method inReaderErroris well-structured, but consider using f-strings for better readability and performance in Python 3.6+.- return "'%s' codec can't decode byte #x%02x: %s\n" \ - " in \"%s\", position %d" \ - % (self.encoding, ord(self.character), self.reason, - self.name, self.position) + return (f"'{self.encoding}' codec can't decode byte #x{ord(self.character):02x}: {self.reason}\n" + f" in \"{self.name}\", position {self.position}")testing/originalnodep/yaml/resolver.py (1)
126-127: Simplify conditional statements.Use a single
ifstatement instead of nestedifstatements to improve readability.- if isinstance(node_check, str): - if current_node.tag != node_check: + if isinstance(node_check, str) and current_node.tag != node_check:- elif isinstance(index_check, int) and not isinstance(index_check, bool): - if index_check != current_index: + elif isinstance(index_check, int) and not isinstance(index_check, bool) and index_check != current_index:Also applies to: 138-139
Tools
Ruff
126-127: Use a single
ifstatement instead of nestedifstatements(SIM102)
testing/prajintry/pacakges/yaml/__init__.py (2)
157-206: Consider using a ternary operator for stream initialization.In the
emit,serialize_all, andserializefunctions, consider using a ternary operator for initializing thestreamvariable to make the code more concise.- if stream is None: - stream = io.StringIO() - else: - stream = io.BytesIO() + stream = io.StringIO() if encoding is None else io.BytesIO()Also applies to: 208-213
Tools
Ruff
157-157:
Dumpermay be undefined, or defined from star imports(F405)
178-178:
Dumpermay be undefined, or defined from star imports(F405)
189-192: Use ternary operator
stream = io.StringIO() if encoding is None else io.BytesIO()instead ofif-else-blockReplace
if-else-block withstream = io.StringIO() if encoding is None else io.BytesIO()(SIM108)
347-389: Consider documenting the YAMLObjectMetaclass and YAMLObject classes.The
YAMLObjectMetaclassandYAMLObjectclasses could benefit from additional documentation to explain their roles and how they integrate with the rest of the YAML handling system.class YAMLObjectMetaclass(type): """ The metaclass for YAMLObject. This metaclass is responsible for registering constructors and representers for YAMLObject subclasses based on their yaml_tag attribute. """Tools
Ruff
370-370:
Loadermay be undefined, or defined from star imports(F405)
370-370:
FullLoadermay be undefined, or defined from star imports(F405)
370-370:
UnsafeLoadermay be undefined, or defined from star imports(F405)
371-371:
Dumpermay be undefined, or defined from star imports(F405)
testing/originalnodep/yaml/representer.py (1)
158-161: Use a ternary operator for concise boolean assignment.The
if-elseblock for assigningvaluecan be replaced with a ternary operator for conciseness.- if data: - value = 'true' - else: - value = 'false' + value = 'true' if data else 'false'Tools
Ruff
158-161: Use ternary operator
value = 'true' if data else 'false'instead ofif-else-blockReplace
if-else-block withvalue = 'true' if data else 'false'(SIM108)
testing/prajintry/pacakges/yaml/representer.py (1)
158-161: Use a ternary operator for concise boolean assignment.The
if-elseblock for assigningvaluecan be replaced with a ternary operator for conciseness.- if data: - value = 'true' - else: - value = 'false' + value = 'true' if data else 'false'Tools
Ruff
158-161: Use ternary operator
value = 'true' if data else 'false'instead ofif-else-blockReplace
if-else-block withvalue = 'true' if data else 'false'(SIM108)
testing/prajintry/pacakges/yaml/scanner.py (2)
32-33: ExpandScannerErrorfor more specific error handling.The
ScannerErrorclass currently does not provide additional context or handling. Consider adding more specific error messages or handling logic to improve debugging and maintainability.
258-260: Improve error message clarity.The error message in
ScannerErrorcould be more descriptive by including additional context about the token or character causing the error.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (4)
testing/original.zipis excluded by!**/*.ziptesting/original/original.zipis excluded by!**/*.ziptesting/originalnodep/trying.zipis excluded by!**/*.ziptesting/prajintry/trying.zipis excluded by!**/*.zip
Files selected for processing (75)
- benchmarks/wrappers/fission/python/handler.py (1 hunks)
- benchmarks/wrappers/fission/python/storage.py (1 hunks)
- config/example.json (2 hunks)
- config/systems.json (1 hunks)
- dockerfiles/fission/python/Dockerfile.build (1 hunks)
- dockerfiles/fission/python/Dockerfile.function (1 hunks)
- dockerfiles/fission/python/Dockerfile.runtime (1 hunks)
- experiments.json (1 hunks)
- out_storage.json (1 hunks)
- sebs/benchmark.py (1 hunks)
- sebs/config.py (1 hunks)
- sebs/faas/config.py (1 hunks)
- sebs/faas/function.py (2 hunks)
- sebs/fission/init.py (1 hunks)
- sebs/fission/config.py (1 hunks)
- sebs/fission/fission.py (1 hunks)
- sebs/fission/fissionFunction.py (1 hunks)
- sebs/fission/minio.py (1 hunks)
- sebs/fission/triggers.py (1 hunks)
- sebs/sebs.py (1 hunks)
- testing/original/build.sh (1 hunks)
- testing/original/requirements.txt (1 hunks)
- testing/original/user.py (1 hunks)
- testing/originalnodep/PyYAML-6.0.1.dist-info/INSTALLER (1 hunks)
- testing/originalnodep/PyYAML-6.0.1.dist-info/LICENSE (1 hunks)
- testing/originalnodep/PyYAML-6.0.1.dist-info/METADATA (1 hunks)
- testing/originalnodep/PyYAML-6.0.1.dist-info/RECORD (1 hunks)
- testing/originalnodep/PyYAML-6.0.1.dist-info/WHEEL (1 hunks)
- testing/originalnodep/PyYAML-6.0.1.dist-info/top_level.txt (1 hunks)
- testing/originalnodep/_yaml/init.py (1 hunks)
- testing/originalnodep/build.sh (1 hunks)
- testing/originalnodep/user.py (1 hunks)
- testing/originalnodep/yaml/init.py (1 hunks)
- testing/originalnodep/yaml/composer.py (1 hunks)
- testing/originalnodep/yaml/constructor.py (1 hunks)
- testing/originalnodep/yaml/cyaml.py (1 hunks)
- testing/originalnodep/yaml/dumper.py (1 hunks)
- testing/originalnodep/yaml/emitter.py (1 hunks)
- testing/originalnodep/yaml/error.py (1 hunks)
- testing/originalnodep/yaml/events.py (1 hunks)
- testing/originalnodep/yaml/loader.py (1 hunks)
- testing/originalnodep/yaml/nodes.py (1 hunks)
- testing/originalnodep/yaml/parser.py (1 hunks)
- testing/originalnodep/yaml/reader.py (1 hunks)
- testing/originalnodep/yaml/representer.py (1 hunks)
- testing/originalnodep/yaml/resolver.py (1 hunks)
- testing/originalnodep/yaml/scanner.py (1 hunks)
- testing/originalnodep/yaml/serializer.py (1 hunks)
- testing/originalnodep/yaml/tokens.py (1 hunks)
- testing/prajintry/pacakges/PyYAML-6.0.1.dist-info/INSTALLER (1 hunks)
- testing/prajintry/pacakges/PyYAML-6.0.1.dist-info/LICENSE (1 hunks)
- testing/prajintry/pacakges/PyYAML-6.0.1.dist-info/METADATA (1 hunks)
- testing/prajintry/pacakges/PyYAML-6.0.1.dist-info/RECORD (1 hunks)
- testing/prajintry/pacakges/PyYAML-6.0.1.dist-info/WHEEL (1 hunks)
- testing/prajintry/pacakges/PyYAML-6.0.1.dist-info/top_level.txt (1 hunks)
- testing/prajintry/pacakges/_yaml/init.py (1 hunks)
- testing/prajintry/pacakges/yaml/init.py (1 hunks)
- testing/prajintry/pacakges/yaml/composer.py (1 hunks)
- testing/prajintry/pacakges/yaml/constructor.py (1 hunks)
- testing/prajintry/pacakges/yaml/cyaml.py (1 hunks)
- testing/prajintry/pacakges/yaml/dumper.py (1 hunks)
- testing/prajintry/pacakges/yaml/emitter.py (1 hunks)
- testing/prajintry/pacakges/yaml/error.py (1 hunks)
- testing/prajintry/pacakges/yaml/events.py (1 hunks)
- testing/prajintry/pacakges/yaml/loader.py (1 hunks)
- testing/prajintry/pacakges/yaml/nodes.py (1 hunks)
- testing/prajintry/pacakges/yaml/parser.py (1 hunks)
- testing/prajintry/pacakges/yaml/reader.py (1 hunks)
- testing/prajintry/pacakges/yaml/representer.py (1 hunks)
- testing/prajintry/pacakges/yaml/resolver.py (1 hunks)
- testing/prajintry/pacakges/yaml/scanner.py (1 hunks)
- testing/prajintry/pacakges/yaml/serializer.py (1 hunks)
- testing/prajintry/pacakges/yaml/tokens.py (1 hunks)
- testing/prajintry/user.py (1 hunks)
- tools/build_docker_images.py (3 hunks)
Files skipped from review due to trivial changes (17)
- dockerfiles/fission/python/Dockerfile.function
- sebs/benchmark.py
- sebs/fission/init.py
- testing/original/build.sh
- testing/original/user.py
- testing/originalnodep/PyYAML-6.0.1.dist-info/INSTALLER
- testing/originalnodep/PyYAML-6.0.1.dist-info/LICENSE
- testing/originalnodep/PyYAML-6.0.1.dist-info/METADATA
- testing/originalnodep/PyYAML-6.0.1.dist-info/RECORD
- testing/originalnodep/PyYAML-6.0.1.dist-info/WHEEL
- testing/originalnodep/PyYAML-6.0.1.dist-info/top_level.txt
- testing/originalnodep/build.sh
- testing/prajintry/pacakges/PyYAML-6.0.1.dist-info/LICENSE
- testing/prajintry/pacakges/PyYAML-6.0.1.dist-info/RECORD
- testing/prajintry/pacakges/PyYAML-6.0.1.dist-info/WHEEL
- testing/prajintry/pacakges/PyYAML-6.0.1.dist-info/top_level.txt
- testing/prajintry/user.py
Files skipped from review as they are similar to previous changes (13)
- config/systems.json
- sebs/faas/function.py
- sebs/fission/fissionFunction.py
- sebs/fission/minio.py
- sebs/fission/triggers.py
- testing/original/requirements.txt
- testing/originalnodep/user.py
- testing/originalnodep/yaml/error.py
- testing/originalnodep/yaml/events.py
- testing/originalnodep/yaml/nodes.py
- testing/originalnodep/yaml/tokens.py
- testing/prajintry/pacakges/PyYAML-6.0.1.dist-info/INSTALLER
- testing/prajintry/pacakges/PyYAML-6.0.1.dist-info/METADATA
Additional context used
Gitleaks
out_storage.json
4-4: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
5-5: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
config/example.json
83-83: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
84-84: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
104-104: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
105-105: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
experiments.json
271-271: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
277-277: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
Ruff
testing/originalnodep/_yaml/__init__.py
16-16:
from yaml._yaml import *used; unable to detect undefined names(F403)
18-18: No explicit
stacklevelkeyword argument found(B028)
testing/prajintry/pacakges/_yaml/__init__.py
16-16:
from yaml._yaml import *used; unable to detect undefined names(F403)
18-18: No explicit
stacklevelkeyword argument found(B028)
testing/originalnodep/yaml/loader.py
4-4:
from .reader import *used; unable to detect undefined names(F403)
5-5:
from .scanner import *used; unable to detect undefined names(F403)
6-6:
from .parser import *used; unable to detect undefined names(F403)
7-7:
from .composer import *used; unable to detect undefined names(F403)
8-8:
from .constructor import *used; unable to detect undefined names(F403)
9-9:
from .resolver import *used; unable to detect undefined names(F403)
11-11:
Readermay be undefined, or defined from star imports(F405)
11-11:
Scannermay be undefined, or defined from star imports(F405)
11-11:
Parsermay be undefined, or defined from star imports(F405)
11-11:
Composermay be undefined, or defined from star imports(F405)
11-11:
BaseConstructormay be undefined, or defined from star imports(F405)
11-11:
BaseResolvermay be undefined, or defined from star imports(F405)
14-14:
Readermay be undefined, or defined from star imports(F405)
15-15:
Scannermay be undefined, or defined from star imports(F405)
16-16:
Parsermay be undefined, or defined from star imports(F405)
17-17:
Composermay be undefined, or defined from star imports(F405)
18-18:
BaseConstructormay be undefined, or defined from star imports(F405)
19-19:
BaseResolvermay be undefined, or defined from star imports(F405)
21-21:
Readermay be undefined, or defined from star imports(F405)
21-21:
Scannermay be undefined, or defined from star imports(F405)
21-21:
Parsermay be undefined, or defined from star imports(F405)
21-21:
Composermay be undefined, or defined from star imports(F405)
21-21:
FullConstructormay be undefined, or defined from star imports(F405)
21-21:
Resolvermay be undefined, or defined from star imports(F405)
24-24:
Readermay be undefined, or defined from star imports(F405)
25-25:
Scannermay be undefined, or defined from star imports(F405)
26-26:
Parsermay be undefined, or defined from star imports(F405)
27-27:
Composermay be undefined, or defined from star imports(F405)
28-28:
FullConstructormay be undefined, or defined from star imports(F405)
29-29:
Resolvermay be undefined, or defined from star imports(F405)
31-31:
Readermay be undefined, or defined from star imports(F405)
31-31:
Scannermay be undefined, or defined from star imports(F405)
31-31:
Parsermay be undefined, or defined from star imports(F405)
31-31:
Composermay be undefined, or defined from star imports(F405)
31-31:
SafeConstructormay be undefined, or defined from star imports(F405)
31-31:
Resolvermay be undefined, or defined from star imports(F405)
34-34:
Readermay be undefined, or defined from star imports(F405)
35-35:
Scannermay be undefined, or defined from star imports(F405)
36-36:
Parsermay be undefined, or defined from star imports(F405)
37-37:
Composermay be undefined, or defined from star imports(F405)
38-38:
SafeConstructormay be undefined, or defined from star imports(F405)
39-39:
Resolvermay be undefined, or defined from star imports(F405)
41-41:
Readermay be undefined, or defined from star imports(F405)
41-41:
Scannermay be undefined, or defined from star imports(F405)
41-41:
Parsermay be undefined, or defined from star imports(F405)
41-41:
Composermay be undefined, or defined from star imports(F405)
41-41:
Constructormay be undefined, or defined from star imports(F405)
41-41:
Resolvermay be undefined, or defined from star imports(F405)
44-44:
Readermay be undefined, or defined from star imports(F405)
45-45:
Scannermay be undefined, or defined from star imports(F405)
46-46:
Parsermay be undefined, or defined from star imports(F405)
47-47:
Composermay be undefined, or defined from star imports(F405)
48-48:
Constructormay be undefined, or defined from star imports(F405)
49-49:
Resolvermay be undefined, or defined from star imports(F405)
55-55:
Readermay be undefined, or defined from star imports(F405)
55-55:
Scannermay be undefined, or defined from star imports(F405)
55-55:
Parsermay be undefined, or defined from star imports(F405)
55-55:
Composermay be undefined, or defined from star imports(F405)
55-55:
Constructormay be undefined, or defined from star imports(F405)
55-55:
Resolvermay be undefined, or defined from star imports(F405)
58-58:
Readermay be undefined, or defined from star imports(F405)
59-59:
Scannermay be undefined, or defined from star imports(F405)
60-60:
Parsermay be undefined, or defined from star imports(F405)
61-61:
Composermay be undefined, or defined from star imports(F405)
62-62:
Constructormay be undefined, or defined from star imports(F405)
63-63:
Resolvermay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/loader.py
4-4:
from .reader import *used; unable to detect undefined names(F403)
5-5:
from .scanner import *used; unable to detect undefined names(F403)
6-6:
from .parser import *used; unable to detect undefined names(F403)
7-7:
from .composer import *used; unable to detect undefined names(F403)
8-8:
from .constructor import *used; unable to detect undefined names(F403)
9-9:
from .resolver import *used; unable to detect undefined names(F403)
11-11:
Readermay be undefined, or defined from star imports(F405)
11-11:
Scannermay be undefined, or defined from star imports(F405)
11-11:
Parsermay be undefined, or defined from star imports(F405)
11-11:
Composermay be undefined, or defined from star imports(F405)
11-11:
BaseConstructormay be undefined, or defined from star imports(F405)
11-11:
BaseResolvermay be undefined, or defined from star imports(F405)
14-14:
Readermay be undefined, or defined from star imports(F405)
15-15:
Scannermay be undefined, or defined from star imports(F405)
16-16:
Parsermay be undefined, or defined from star imports(F405)
17-17:
Composermay be undefined, or defined from star imports(F405)
18-18:
BaseConstructormay be undefined, or defined from star imports(F405)
19-19:
BaseResolvermay be undefined, or defined from star imports(F405)
21-21:
Readermay be undefined, or defined from star imports(F405)
21-21:
Scannermay be undefined, or defined from star imports(F405)
21-21:
Parsermay be undefined, or defined from star imports(F405)
21-21:
Composermay be undefined, or defined from star imports(F405)
21-21:
FullConstructormay be undefined, or defined from star imports(F405)
21-21:
Resolvermay be undefined, or defined from star imports(F405)
24-24:
Readermay be undefined, or defined from star imports(F405)
25-25:
Scannermay be undefined, or defined from star imports(F405)
26-26:
Parsermay be undefined, or defined from star imports(F405)
27-27:
Composermay be undefined, or defined from star imports(F405)
28-28:
FullConstructormay be undefined, or defined from star imports(F405)
29-29:
Resolvermay be undefined, or defined from star imports(F405)
31-31:
Readermay be undefined, or defined from star imports(F405)
31-31:
Scannermay be undefined, or defined from star imports(F405)
31-31:
Parsermay be undefined, or defined from star imports(F405)
31-31:
Composermay be undefined, or defined from star imports(F405)
31-31:
SafeConstructormay be undefined, or defined from star imports(F405)
31-31:
Resolvermay be undefined, or defined from star imports(F405)
34-34:
Readermay be undefined, or defined from star imports(F405)
35-35:
Scannermay be undefined, or defined from star imports(F405)
36-36:
Parsermay be undefined, or defined from star imports(F405)
37-37:
Composermay be undefined, or defined from star imports(F405)
38-38:
SafeConstructormay be undefined, or defined from star imports(F405)
39-39:
Resolvermay be undefined, or defined from star imports(F405)
41-41:
Readermay be undefined, or defined from star imports(F405)
41-41:
Scannermay be undefined, or defined from star imports(F405)
41-41:
Parsermay be undefined, or defined from star imports(F405)
41-41:
Composermay be undefined, or defined from star imports(F405)
41-41:
Constructormay be undefined, or defined from star imports(F405)
41-41:
Resolvermay be undefined, or defined from star imports(F405)
44-44:
Readermay be undefined, or defined from star imports(F405)
45-45:
Scannermay be undefined, or defined from star imports(F405)
46-46:
Parsermay be undefined, or defined from star imports(F405)
47-47:
Composermay be undefined, or defined from star imports(F405)
48-48:
Constructormay be undefined, or defined from star imports(F405)
49-49:
Resolvermay be undefined, or defined from star imports(F405)
55-55:
Readermay be undefined, or defined from star imports(F405)
55-55:
Scannermay be undefined, or defined from star imports(F405)
55-55:
Parsermay be undefined, or defined from star imports(F405)
55-55:
Composermay be undefined, or defined from star imports(F405)
55-55:
Constructormay be undefined, or defined from star imports(F405)
55-55:
Resolvermay be undefined, or defined from star imports(F405)
58-58:
Readermay be undefined, or defined from star imports(F405)
59-59:
Scannermay be undefined, or defined from star imports(F405)
60-60:
Parsermay be undefined, or defined from star imports(F405)
61-61:
Composermay be undefined, or defined from star imports(F405)
62-62:
Constructormay be undefined, or defined from star imports(F405)
63-63:
Resolvermay be undefined, or defined from star imports(F405)
benchmarks/wrappers/fission/python/handler.py
54-54: Use capitalized environment variable
COLD_STARTinstead ofcold_startReplace
cold_startwithCOLD_START(SIM112)
testing/originalnodep/yaml/dumper.py
4-4:
from .emitter import *used; unable to detect undefined names(F403)
5-5:
from .serializer import *used; unable to detect undefined names(F403)
6-6:
from .representer import *used; unable to detect undefined names(F403)
7-7:
from .resolver import *used; unable to detect undefined names(F403)
9-9:
Emittermay be undefined, or defined from star imports(F405)
9-9:
Serializermay be undefined, or defined from star imports(F405)
9-9:
BaseRepresentermay be undefined, or defined from star imports(F405)
9-9:
BaseResolvermay be undefined, or defined from star imports(F405)
17-17:
Emittermay be undefined, or defined from star imports(F405)
20-20:
Serializermay be undefined, or defined from star imports(F405)
23-23:
Representermay be undefined, or defined from star imports(F405)
25-25:
Resolvermay be undefined, or defined from star imports(F405)
27-27:
Emittermay be undefined, or defined from star imports(F405)
27-27:
Serializermay be undefined, or defined from star imports(F405)
27-27:
SafeRepresentermay be undefined, or defined from star imports(F405)
27-27:
Resolvermay be undefined, or defined from star imports(F405)
35-35:
Emittermay be undefined, or defined from star imports(F405)
38-38:
Serializermay be undefined, or defined from star imports(F405)
41-41:
SafeRepresentermay be undefined, or defined from star imports(F405)
43-43:
Resolvermay be undefined, or defined from star imports(F405)
45-45:
Emittermay be undefined, or defined from star imports(F405)
45-45:
Serializermay be undefined, or defined from star imports(F405)
45-45:
Representermay be undefined, or defined from star imports(F405)
45-45:
Resolvermay be undefined, or defined from star imports(F405)
53-53:
Emittermay be undefined, or defined from star imports(F405)
56-56:
Serializermay be undefined, or defined from star imports(F405)
59-59:
Representermay be undefined, or defined from star imports(F405)
61-61:
Resolvermay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/dumper.py
4-4:
from .emitter import *used; unable to detect undefined names(F403)
5-5:
from .serializer import *used; unable to detect undefined names(F403)
6-6:
from .representer import *used; unable to detect undefined names(F403)
7-7:
from .resolver import *used; unable to detect undefined names(F403)
9-9:
Emittermay be undefined, or defined from star imports(F405)
9-9:
Serializermay be undefined, or defined from star imports(F405)
9-9:
BaseRepresentermay be undefined, or defined from star imports(F405)
9-9:
BaseResolvermay be undefined, or defined from star imports(F405)
17-17:
Emittermay be undefined, or defined from star imports(F405)
20-20:
Serializermay be undefined, or defined from star imports(F405)
23-23:
Representermay be undefined, or defined from star imports(F405)
25-25:
Resolvermay be undefined, or defined from star imports(F405)
27-27:
Emittermay be undefined, or defined from star imports(F405)
27-27:
Serializermay be undefined, or defined from star imports(F405)
27-27:
SafeRepresentermay be undefined, or defined from star imports(F405)
27-27:
Resolvermay be undefined, or defined from star imports(F405)
35-35:
Emittermay be undefined, or defined from star imports(F405)
38-38:
Serializermay be undefined, or defined from star imports(F405)
41-41:
SafeRepresentermay be undefined, or defined from star imports(F405)
43-43:
Resolvermay be undefined, or defined from star imports(F405)
45-45:
Emittermay be undefined, or defined from star imports(F405)
45-45:
Serializermay be undefined, or defined from star imports(F405)
45-45:
Representermay be undefined, or defined from star imports(F405)
45-45:
Resolvermay be undefined, or defined from star imports(F405)
53-53:
Emittermay be undefined, or defined from star imports(F405)
56-56:
Serializermay be undefined, or defined from star imports(F405)
59-59:
Representermay be undefined, or defined from star imports(F405)
61-61:
Resolvermay be undefined, or defined from star imports(F405)
tools/build_docker_images.py
20-20: Use context handler for opening files
(SIM115)
testing/originalnodep/yaml/cyaml.py
9-9:
from .constructor import *used; unable to detect undefined names(F403)
11-11:
from .serializer import *used; unable to detect undefined names(F403)
12-12:
from .representer import *used; unable to detect undefined names(F403)
14-14:
from .resolver import *used; unable to detect undefined names(F403)
16-16:
BaseConstructormay be undefined, or defined from star imports(F405)
16-16:
BaseResolvermay be undefined, or defined from star imports(F405)
20-20:
BaseConstructormay be undefined, or defined from star imports(F405)
21-21:
BaseResolvermay be undefined, or defined from star imports(F405)
23-23:
SafeConstructormay be undefined, or defined from star imports(F405)
23-23:
Resolvermay be undefined, or defined from star imports(F405)
27-27:
SafeConstructormay be undefined, or defined from star imports(F405)
28-28:
Resolvermay be undefined, or defined from star imports(F405)
30-30:
FullConstructormay be undefined, or defined from star imports(F405)
30-30:
Resolvermay be undefined, or defined from star imports(F405)
34-34:
FullConstructormay be undefined, or defined from star imports(F405)
35-35:
Resolvermay be undefined, or defined from star imports(F405)
37-37:
UnsafeConstructormay be undefined, or defined from star imports(F405)
37-37:
Resolvermay be undefined, or defined from star imports(F405)
41-41:
UnsafeConstructormay be undefined, or defined from star imports(F405)
42-42:
Resolvermay be undefined, or defined from star imports(F405)
44-44:
Constructormay be undefined, or defined from star imports(F405)
44-44:
Resolvermay be undefined, or defined from star imports(F405)
48-48:
Constructormay be undefined, or defined from star imports(F405)
49-49:
Resolvermay be undefined, or defined from star imports(F405)
51-51:
BaseRepresentermay be undefined, or defined from star imports(F405)
51-51:
BaseResolvermay be undefined, or defined from star imports(F405)
64-64:
Representermay be undefined, or defined from star imports(F405)
66-66:
Resolvermay be undefined, or defined from star imports(F405)
68-68:
SafeRepresentermay be undefined, or defined from star imports(F405)
68-68:
Resolvermay be undefined, or defined from star imports(F405)
81-81:
SafeRepresentermay be undefined, or defined from star imports(F405)
83-83:
Resolvermay be undefined, or defined from star imports(F405)
85-85:
Serializermay be undefined, or defined from star imports(F405)
85-85:
Representermay be undefined, or defined from star imports(F405)
85-85:
Resolvermay be undefined, or defined from star imports(F405)
98-98:
Representermay be undefined, or defined from star imports(F405)
100-100:
Resolvermay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/cyaml.py
9-9:
from .constructor import *used; unable to detect undefined names(F403)
11-11:
from .serializer import *used; unable to detect undefined names(F403)
12-12:
from .representer import *used; unable to detect undefined names(F403)
14-14:
from .resolver import *used; unable to detect undefined names(F403)
16-16:
BaseConstructormay be undefined, or defined from star imports(F405)
16-16:
BaseResolvermay be undefined, or defined from star imports(F405)
20-20:
BaseConstructormay be undefined, or defined from star imports(F405)
21-21:
BaseResolvermay be undefined, or defined from star imports(F405)
23-23:
SafeConstructormay be undefined, or defined from star imports(F405)
23-23:
Resolvermay be undefined, or defined from star imports(F405)
27-27:
SafeConstructormay be undefined, or defined from star imports(F405)
28-28:
Resolvermay be undefined, or defined from star imports(F405)
30-30:
FullConstructormay be undefined, or defined from star imports(F405)
30-30:
Resolvermay be undefined, or defined from star imports(F405)
34-34:
FullConstructormay be undefined, or defined from star imports(F405)
35-35:
Resolvermay be undefined, or defined from star imports(F405)
37-37:
UnsafeConstructormay be undefined, or defined from star imports(F405)
37-37:
Resolvermay be undefined, or defined from star imports(F405)
41-41:
UnsafeConstructormay be undefined, or defined from star imports(F405)
42-42:
Resolvermay be undefined, or defined from star imports(F405)
44-44:
Constructormay be undefined, or defined from star imports(F405)
44-44:
Resolvermay be undefined, or defined from star imports(F405)
48-48:
Constructormay be undefined, or defined from star imports(F405)
49-49:
Resolvermay be undefined, or defined from star imports(F405)
51-51:
BaseRepresentermay be undefined, or defined from star imports(F405)
51-51:
BaseResolvermay be undefined, or defined from star imports(F405)
64-64:
Representermay be undefined, or defined from star imports(F405)
66-66:
Resolvermay be undefined, or defined from star imports(F405)
68-68:
SafeRepresentermay be undefined, or defined from star imports(F405)
68-68:
Resolvermay be undefined, or defined from star imports(F405)
81-81:
SafeRepresentermay be undefined, or defined from star imports(F405)
83-83:
Resolvermay be undefined, or defined from star imports(F405)
85-85:
Serializermay be undefined, or defined from star imports(F405)
85-85:
Representermay be undefined, or defined from star imports(F405)
85-85:
Resolvermay be undefined, or defined from star imports(F405)
98-98:
Representermay be undefined, or defined from star imports(F405)
100-100:
Resolvermay be undefined, or defined from star imports(F405)
testing/originalnodep/yaml/serializer.py
5-5:
from .events import *used; unable to detect undefined names(F403)
6-6:
from .nodes import *used; unable to detect undefined names(F403)
29-29:
StreamStartEventmay be undefined, or defined from star imports(F405)
40-40:
StreamEndEventmay be undefined, or defined from star imports(F405)
51-51:
DocumentStartEventmay be undefined, or defined from star imports(F405)
55-55:
DocumentEndEventmay be undefined, or defined from star imports(F405)
66-66:
SequenceNodemay be undefined, or defined from star imports(F405)
69-69:
MappingNodemay be undefined, or defined from star imports(F405)
81-81:
AliasEventmay be undefined, or defined from star imports(F405)
85-85:
ScalarNodemay be undefined, or defined from star imports(F405)
86-86:
ScalarNodemay be undefined, or defined from star imports(F405)
87-87:
ScalarNodemay be undefined, or defined from star imports(F405)
89-89:
ScalarEventmay be undefined, or defined from star imports(F405)
91-91:
SequenceNodemay be undefined, or defined from star imports(F405)
93-93:
SequenceNodemay be undefined, or defined from star imports(F405)
94-94:
SequenceStartEventmay be undefined, or defined from star imports(F405)
100-100:
SequenceEndEventmay be undefined, or defined from star imports(F405)
101-101:
MappingNodemay be undefined, or defined from star imports(F405)
103-103:
MappingNodemay be undefined, or defined from star imports(F405)
104-104:
MappingStartEventmay be undefined, or defined from star imports(F405)
109-109:
MappingEndEventmay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/serializer.py
5-5:
from .events import *used; unable to detect undefined names(F403)
6-6:
from .nodes import *used; unable to detect undefined names(F403)
29-29:
StreamStartEventmay be undefined, or defined from star imports(F405)
40-40:
StreamEndEventmay be undefined, or defined from star imports(F405)
51-51:
DocumentStartEventmay be undefined, or defined from star imports(F405)
55-55:
DocumentEndEventmay be undefined, or defined from star imports(F405)
66-66:
SequenceNodemay be undefined, or defined from star imports(F405)
69-69:
MappingNodemay be undefined, or defined from star imports(F405)
81-81:
AliasEventmay be undefined, or defined from star imports(F405)
85-85:
ScalarNodemay be undefined, or defined from star imports(F405)
86-86:
ScalarNodemay be undefined, or defined from star imports(F405)
87-87:
ScalarNodemay be undefined, or defined from star imports(F405)
89-89:
ScalarEventmay be undefined, or defined from star imports(F405)
91-91:
SequenceNodemay be undefined, or defined from star imports(F405)
93-93:
SequenceNodemay be undefined, or defined from star imports(F405)
94-94:
SequenceStartEventmay be undefined, or defined from star imports(F405)
100-100:
SequenceEndEventmay be undefined, or defined from star imports(F405)
101-101:
MappingNodemay be undefined, or defined from star imports(F405)
103-103:
MappingNodemay be undefined, or defined from star imports(F405)
104-104:
MappingStartEventmay be undefined, or defined from star imports(F405)
109-109:
MappingEndEventmay be undefined, or defined from star imports(F405)
benchmarks/wrappers/fission/python/storage.py
3-3:
jsonimported but unusedRemove unused import:
json(F401)
testing/originalnodep/yaml/composer.py
5-5:
from .events import *used; unable to detect undefined names(F403)
6-6:
from .nodes import *used; unable to detect undefined names(F403)
18-18:
StreamStartEventmay be undefined, or defined from star imports(F405)
22-22:
StreamEndEventmay be undefined, or defined from star imports(F405)
26-26:
StreamEndEventmay be undefined, or defined from star imports(F405)
35-35:
StreamEndEventmay be undefined, or defined from star imports(F405)
39-39:
StreamEndEventmay be undefined, or defined from star imports(F405)
64-64:
AliasEventmay be undefined, or defined from star imports(F405)
73-74: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
79-79:
ScalarEventmay be undefined, or defined from star imports(F405)
81-81:
SequenceStartEventmay be undefined, or defined from star imports(F405)
83-83:
MappingStartEventmay be undefined, or defined from star imports(F405)
92-92:
ScalarNodemay be undefined, or defined from star imports(F405)
93-93:
ScalarNodemay be undefined, or defined from star imports(F405)
103-103:
SequenceNodemay be undefined, or defined from star imports(F405)
104-104:
SequenceNodemay be undefined, or defined from star imports(F405)
110-110:
SequenceEndEventmay be undefined, or defined from star imports(F405)
121-121:
MappingNodemay be undefined, or defined from star imports(F405)
122-122:
MappingNodemay be undefined, or defined from star imports(F405)
127-127:
MappingEndEventmay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/composer.py
5-5:
from .events import *used; unable to detect undefined names(F403)
6-6:
from .nodes import *used; unable to detect undefined names(F403)
18-18:
StreamStartEventmay be undefined, or defined from star imports(F405)
22-22:
StreamEndEventmay be undefined, or defined from star imports(F405)
26-26:
StreamEndEventmay be undefined, or defined from star imports(F405)
35-35:
StreamEndEventmay be undefined, or defined from star imports(F405)
39-39:
StreamEndEventmay be undefined, or defined from star imports(F405)
64-64:
AliasEventmay be undefined, or defined from star imports(F405)
73-74: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
79-79:
ScalarEventmay be undefined, or defined from star imports(F405)
81-81:
SequenceStartEventmay be undefined, or defined from star imports(F405)
83-83:
MappingStartEventmay be undefined, or defined from star imports(F405)
92-92:
ScalarNodemay be undefined, or defined from star imports(F405)
93-93:
ScalarNodemay be undefined, or defined from star imports(F405)
103-103:
SequenceNodemay be undefined, or defined from star imports(F405)
104-104:
SequenceNodemay be undefined, or defined from star imports(F405)
110-110:
SequenceEndEventmay be undefined, or defined from star imports(F405)
121-121:
MappingNodemay be undefined, or defined from star imports(F405)
122-122:
MappingNodemay be undefined, or defined from star imports(F405)
127-127:
MappingEndEventmay be undefined, or defined from star imports(F405)
testing/originalnodep/yaml/reader.py
164-165: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
testing/prajintry/pacakges/yaml/reader.py
164-165: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
testing/originalnodep/yaml/resolver.py
4-4:
from .error import *used; unable to detect undefined names(F403)
5-5:
from .nodes import *used; unable to detect undefined names(F403)
9-9:
YAMLErrormay be undefined, or defined from star imports(F405)
27-27: Test for membership should be
not inConvert to
not in(E713)
51-51: Test for membership should be
not inConvert to
not in(E713)
67-67:
ScalarNodemay be undefined, or defined from star imports(F405)
69-69:
SequenceNodemay be undefined, or defined from star imports(F405)
71-71:
MappingNodemay be undefined, or defined from star imports(F405)
72-72:
ScalarNodemay be undefined, or defined from star imports(F405)
72-72:
SequenceNodemay be undefined, or defined from star imports(F405)
72-72:
MappingNodemay be undefined, or defined from star imports(F405)
81-81:
ScalarNodemay be undefined, or defined from star imports(F405)
83-83:
SequenceNodemay be undefined, or defined from star imports(F405)
85-85:
MappingNodemay be undefined, or defined from star imports(F405)
86-86:
ScalarNodemay be undefined, or defined from star imports(F405)
86-86:
SequenceNodemay be undefined, or defined from star imports(F405)
86-86:
MappingNodemay be undefined, or defined from star imports(F405)
126-127: Use a single
ifstatement instead of nestedifstatements(SIM102)
135-135:
ScalarNodemay be undefined, or defined from star imports(F405)
138-139: Use a single
ifstatement instead of nestedifstatements(SIM102)
144-144:
ScalarNodemay be undefined, or defined from star imports(F405)
160-160:
ScalarNodemay be undefined, or defined from star imports(F405)
162-162:
SequenceNodemay be undefined, or defined from star imports(F405)
164-164:
MappingNodemay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/resolver.py
4-4:
from .error import *used; unable to detect undefined names(F403)
5-5:
from .nodes import *used; unable to detect undefined names(F403)
9-9:
YAMLErrormay be undefined, or defined from star imports(F405)
27-27: Test for membership should be
not inConvert to
not in(E713)
51-51: Test for membership should be
not inConvert to
not in(E713)
67-67:
ScalarNodemay be undefined, or defined from star imports(F405)
69-69:
SequenceNodemay be undefined, or defined from star imports(F405)
71-71:
MappingNodemay be undefined, or defined from star imports(F405)
72-72:
ScalarNodemay be undefined, or defined from star imports(F405)
72-72:
SequenceNodemay be undefined, or defined from star imports(F405)
72-72:
MappingNodemay be undefined, or defined from star imports(F405)
81-81:
ScalarNodemay be undefined, or defined from star imports(F405)
83-83:
SequenceNodemay be undefined, or defined from star imports(F405)
85-85:
MappingNodemay be undefined, or defined from star imports(F405)
86-86:
ScalarNodemay be undefined, or defined from star imports(F405)
86-86:
SequenceNodemay be undefined, or defined from star imports(F405)
86-86:
MappingNodemay be undefined, or defined from star imports(F405)
126-127: Use a single
ifstatement instead of nestedifstatements(SIM102)
135-135:
ScalarNodemay be undefined, or defined from star imports(F405)
138-139: Use a single
ifstatement instead of nestedifstatements(SIM102)
144-144:
ScalarNodemay be undefined, or defined from star imports(F405)
160-160:
ScalarNodemay be undefined, or defined from star imports(F405)
162-162:
SequenceNodemay be undefined, or defined from star imports(F405)
164-164:
MappingNodemay be undefined, or defined from star imports(F405)
sebs/fission/config.py
146-146: f-string without any placeholders
Remove extraneous
fprefix(F541)
172-172: f-string without any placeholders
Remove extraneous
fprefix(F541)
182-182: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
189-189: Do not use mutable data structures for argument defaults
Replace with
None; initialize within function(B006)
214-214: Local variable
connection_uriis assigned to but never usedRemove assignment to unused variable
connection_uri(F841)
215-215: Local variable
access_keyis assigned to but never usedRemove assignment to unused variable
access_key(F841)
216-216: Local variable
secret_keyis assigned to but never usedRemove assignment to unused variable
secret_key(F841)
testing/originalnodep/yaml/__init__.py
2-2:
from .error import *used; unable to detect undefined names(F403)
4-4:
from .tokens import *used; unable to detect undefined names(F403)
5-5:
from .events import *used; unable to detect undefined names(F403)
6-6:
from .nodes import *used; unable to detect undefined names(F403)
8-8:
from .loader import *used; unable to detect undefined names(F403)
9-9:
from .dumper import *used; unable to detect undefined names(F403)
13-13:
from .cyaml import *used; unable to detect undefined names(F403)
29-29:
Loadermay be undefined, or defined from star imports(F405)
40-40:
Loadermay be undefined, or defined from star imports(F405)
51-51:
Loadermay be undefined, or defined from star imports(F405)
62-62:
Loadermay be undefined, or defined from star imports(F405)
105-105:
FullLoadermay be undefined, or defined from star imports(F405)
115-115:
FullLoadermay be undefined, or defined from star imports(F405)
125-125:
SafeLoadermay be undefined, or defined from star imports(F405)
135-135:
SafeLoadermay be undefined, or defined from star imports(F405)
145-145:
UnsafeLoadermay be undefined, or defined from star imports(F405)
155-155:
UnsafeLoadermay be undefined, or defined from star imports(F405)
157-157:
Dumpermay be undefined, or defined from star imports(F405)
178-178:
Dumpermay be undefined, or defined from star imports(F405)
189-192: Use ternary operator
stream = io.StringIO() if encoding is None else io.BytesIO()instead ofif-else-blockReplace
if-else-block withstream = io.StringIO() if encoding is None else io.BytesIO()(SIM108)
208-208:
Dumpermay be undefined, or defined from star imports(F405)
215-215:
Dumpermay be undefined, or defined from star imports(F405)
227-230: Use ternary operator
stream = io.StringIO() if encoding is None else io.BytesIO()instead ofif-else-blockReplace
if-else-block withstream = io.StringIO() if encoding is None else io.BytesIO()(SIM108)
248-248:
Dumpermay be undefined, or defined from star imports(F405)
261-261:
SafeDumpermay be undefined, or defined from star imports(F405)
269-269:
SafeDumpermay be undefined, or defined from star imports(F405)
272-272:
Dumpermay be undefined, or defined from star imports(F405)
280-280:
loadermay be undefined, or defined from star imports(F405)
281-281:
loadermay be undefined, or defined from star imports(F405)
282-282:
loadermay be undefined, or defined from star imports(F405)
287-287:
Dumpermay be undefined, or defined from star imports(F405)
295-295:
loadermay be undefined, or defined from star imports(F405)
296-296:
loadermay be undefined, or defined from star imports(F405)
297-297:
loadermay be undefined, or defined from star imports(F405)
309-309:
loadermay be undefined, or defined from star imports(F405)
310-310:
loadermay be undefined, or defined from star imports(F405)
311-311:
loadermay be undefined, or defined from star imports(F405)
323-323:
loadermay be undefined, or defined from star imports(F405)
324-324:
loadermay be undefined, or defined from star imports(F405)
325-325:
loadermay be undefined, or defined from star imports(F405)
329-329:
Dumpermay be undefined, or defined from star imports(F405)
338-338:
Dumpermay be undefined, or defined from star imports(F405)
370-370:
Loadermay be undefined, or defined from star imports(F405)
370-370:
FullLoadermay be undefined, or defined from star imports(F405)
370-370:
UnsafeLoadermay be undefined, or defined from star imports(F405)
371-371:
Dumpermay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/__init__.py
2-2:
from .error import *used; unable to detect undefined names(F403)
4-4:
from .tokens import *used; unable to detect undefined names(F403)
5-5:
from .events import *used; unable to detect undefined names(F403)
6-6:
from .nodes import *used; unable to detect undefined names(F403)
8-8:
from .loader import *used; unable to detect undefined names(F403)
9-9:
from .dumper import *used; unable to detect undefined names(F403)
13-13:
from .cyaml import *used; unable to detect undefined names(F403)
29-29:
Loadermay be undefined, or defined from star imports(F405)
40-40:
Loadermay be undefined, or defined from star imports(F405)
51-51:
Loadermay be undefined, or defined from star imports(F405)
62-62:
Loadermay be undefined, or defined from star imports(F405)
105-105:
FullLoadermay be undefined, or defined from star imports(F405)
115-115:
FullLoadermay be undefined, or defined from star imports(F405)
125-125:
SafeLoadermay be undefined, or defined from star imports(F405)
135-135:
SafeLoadermay be undefined, or defined from star imports(F405)
145-145:
UnsafeLoadermay be undefined, or defined from star imports(F405)
155-155:
UnsafeLoadermay be undefined, or defined from star imports(F405)
157-157:
Dumpermay be undefined, or defined from star imports(F405)
178-178:
Dumpermay be undefined, or defined from star imports(F405)
189-192: Use ternary operator
stream = io.StringIO() if encoding is None else io.BytesIO()instead ofif-else-blockReplace
if-else-block withstream = io.StringIO() if encoding is None else io.BytesIO()(SIM108)
208-208:
Dumpermay be undefined, or defined from star imports(F405)
215-215:
Dumpermay be undefined, or defined from star imports(F405)
227-230: Use ternary operator
stream = io.StringIO() if encoding is None else io.BytesIO()instead ofif-else-blockReplace
if-else-block withstream = io.StringIO() if encoding is None else io.BytesIO()(SIM108)
248-248:
Dumpermay be undefined, or defined from star imports(F405)
261-261:
SafeDumpermay be undefined, or defined from star imports(F405)
269-269:
SafeDumpermay be undefined, or defined from star imports(F405)
272-272:
Dumpermay be undefined, or defined from star imports(F405)
280-280:
loadermay be undefined, or defined from star imports(F405)
281-281:
loadermay be undefined, or defined from star imports(F405)
282-282:
loadermay be undefined, or defined from star imports(F405)
287-287:
Dumpermay be undefined, or defined from star imports(F405)
295-295:
loadermay be undefined, or defined from star imports(F405)
296-296:
loadermay be undefined, or defined from star imports(F405)
297-297:
loadermay be undefined, or defined from star imports(F405)
309-309:
loadermay be undefined, or defined from star imports(F405)
310-310:
loadermay be undefined, or defined from star imports(F405)
311-311:
loadermay be undefined, or defined from star imports(F405)
323-323:
loadermay be undefined, or defined from star imports(F405)
324-324:
loadermay be undefined, or defined from star imports(F405)
325-325:
loadermay be undefined, or defined from star imports(F405)
329-329:
Dumpermay be undefined, or defined from star imports(F405)
338-338:
Dumpermay be undefined, or defined from star imports(F405)
370-370:
Loadermay be undefined, or defined from star imports(F405)
370-370:
FullLoadermay be undefined, or defined from star imports(F405)
370-370:
UnsafeLoadermay be undefined, or defined from star imports(F405)
371-371:
Dumpermay be undefined, or defined from star imports(F405)
testing/originalnodep/yaml/representer.py
5-5:
from .error import *used; unable to detect undefined names(F403)
6-6:
from .nodes import *used; unable to detect undefined names(F403)
10-10:
YAMLErrormay be undefined, or defined from star imports(F405)
60-60:
ScalarNodemay be undefined, or defined from star imports(F405)
67-67: Test for membership should be
not inConvert to
not in(E713)
73-73: Test for membership should be
not inConvert to
not in(E713)
80-80:
ScalarNodemay be undefined, or defined from star imports(F405)
87-87:
SequenceNodemay be undefined, or defined from star imports(F405)
93-93:
ScalarNodemay be undefined, or defined from star imports(F405)
105-105:
MappingNodemay be undefined, or defined from star imports(F405)
112-115: Use
contextlib.suppress(TypeError)instead oftry-except-passReplace with
contextlib.suppress(TypeError)(SIM105)
119-119:
ScalarNodemay be undefined, or defined from star imports(F405)
121-121:
ScalarNodemay be undefined, or defined from star imports(F405)
158-161: Use ternary operator
value = 'true' if data else 'false'instead ofif-else-blockReplace
if-else-block withvalue = 'true' if data else 'false'(SIM108)
testing/prajintry/pacakges/yaml/representer.py
5-5:
from .error import *used; unable to detect undefined names(F403)
6-6:
from .nodes import *used; unable to detect undefined names(F403)
10-10:
YAMLErrormay be undefined, or defined from star imports(F405)
60-60:
ScalarNodemay be undefined, or defined from star imports(F405)
67-67: Test for membership should be
not inConvert to
not in(E713)
73-73: Test for membership should be
not inConvert to
not in(E713)
80-80:
ScalarNodemay be undefined, or defined from star imports(F405)
87-87:
SequenceNodemay be undefined, or defined from star imports(F405)
93-93:
ScalarNodemay be undefined, or defined from star imports(F405)
105-105:
MappingNodemay be undefined, or defined from star imports(F405)
112-115: Use
contextlib.suppress(TypeError)instead oftry-except-passReplace with
contextlib.suppress(TypeError)(SIM105)
119-119:
ScalarNodemay be undefined, or defined from star imports(F405)
121-121:
ScalarNodemay be undefined, or defined from star imports(F405)
158-161: Use ternary operator
value = 'true' if data else 'false'instead ofif-else-blockReplace
if-else-block withvalue = 'true' if data else 'false'(SIM108)
sebs/fission/fission.py
3-3:
reimported but unusedRemove unused import:
re(F401)
9-9:
jsonimported but unusedRemove unused import:
json(F401)
10-10:
time.sleepimported but unusedRemove unused import:
time.sleep(F401)
11-11: Redefinition of unused
Dictfrom line 6Remove definition:
Dict(F811)
11-11: Redefinition of unused
Tuplefrom line 6Remove definition:
Tuple(F811)
11-11: Redefinition of unused
Listfrom line 6Remove definition:
List(F811)
18-18:
sebs.utils.DOCKER_DIRimported but unusedRemove unused import:
sebs.utils.DOCKER_DIR(F401)
52-52: Do not use mutable data structures for argument defaults
Replace with
None; initialize within function(B006)
205-205: f-string without any placeholders
Remove extraneous
fprefix(F541)
210-210: f-string without any placeholders
Remove extraneous
fprefix(F541)
273-273: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
279-279: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
302-302: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
307-307: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
354-354: f-string without any placeholders
Remove extraneous
fprefix(F541)
testing/originalnodep/yaml/parser.py
65-65:
from .tokens import *used; unable to detect undefined names(F403)
66-66:
from .events import *used; unable to detect undefined names(F403)
67-67:
from .scanner import *used; unable to detect undefined names(F403)
96-97: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
109-110: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
116-117: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
131-131:
StreamStartEventmay be undefined, or defined from star imports(F405)
142-142:
DirectiveTokenmay be undefined, or defined from star imports(F405)
142-142:
DocumentStartTokenmay be undefined, or defined from star imports(F405)
143-143:
StreamEndTokenmay be undefined, or defined from star imports(F405)
147-147:
DocumentStartEventmay be undefined, or defined from star imports(F405)
162-162:
DocumentEndTokenmay be undefined, or defined from star imports(F405)
166-166:
StreamEndTokenmay be undefined, or defined from star imports(F405)
170-170:
DocumentStartTokenmay be undefined, or defined from star imports(F405)
177-177:
DocumentStartEventmay be undefined, or defined from star imports(F405)
184-184:
StreamEndEventmay be undefined, or defined from star imports(F405)
196-196:
DocumentEndTokenmay be undefined, or defined from star imports(F405)
200-200:
DocumentEndEventmay be undefined, or defined from star imports(F405)
209-209:
DirectiveTokenmay be undefined, or defined from star imports(F405)
210-210:
DocumentStartTokenmay be undefined, or defined from star imports(F405)
210-210:
DocumentEndTokenmay be undefined, or defined from star imports(F405)
210-210:
StreamEndTokenmay be undefined, or defined from star imports(F405)
220-220:
DirectiveTokenmay be undefined, or defined from star imports(F405)
274-274:
AliasTokenmay be undefined, or defined from star imports(F405)
276-276:
AliasEventmay be undefined, or defined from star imports(F405)
282-282:
AnchorTokenmay be undefined, or defined from star imports(F405)
287-287:
TagTokenmay be undefined, or defined from star imports(F405)
292-292:
TagTokenmay be undefined, or defined from star imports(F405)
297-297:
AnchorTokenmay be undefined, or defined from star imports(F405)
319-319:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
321-321:
SequenceStartEventmay be undefined, or defined from star imports(F405)
325-325:
ScalarTokenmay be undefined, or defined from star imports(F405)
334-334:
ScalarEventmay be undefined, or defined from star imports(F405)
337-337:
FlowSequenceStartTokenmay be undefined, or defined from star imports(F405)
339-339:
SequenceStartEventmay be undefined, or defined from star imports(F405)
342-342:
FlowMappingStartTokenmay be undefined, or defined from star imports(F405)
344-344:
MappingStartEventmay be undefined, or defined from star imports(F405)
347-347:
BlockSequenceStartTokenmay be undefined, or defined from star imports(F405)
349-349:
SequenceStartEventmay be undefined, or defined from star imports(F405)
352-352:
BlockMappingStartTokenmay be undefined, or defined from star imports(F405)
354-354:
MappingStartEventmay be undefined, or defined from star imports(F405)
360-360:
ScalarEventmay be undefined, or defined from star imports(F405)
364-367: Use ternary operator
node = 'block' if block else 'flow'instead ofif-else-blockReplace
if-else-block withnode = 'block' if block else 'flow'(SIM108)
382-382:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
384-384:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
384-384:
BlockEndTokenmay be undefined, or defined from star imports(F405)
390-390:
BlockEndTokenmay be undefined, or defined from star imports(F405)
395-395:
SequenceEndEventmay be undefined, or defined from star imports(F405)
403-403:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
405-405:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
406-406:
KeyTokenmay be undefined, or defined from star imports(F405)
406-406:
ValueTokenmay be undefined, or defined from star imports(F405)
406-406:
BlockEndTokenmay be undefined, or defined from star imports(F405)
413-413:
SequenceEndEventmay be undefined, or defined from star imports(F405)
428-428:
KeyTokenmay be undefined, or defined from star imports(F405)
430-430:
KeyTokenmay be undefined, or defined from star imports(F405)
430-430:
ValueTokenmay be undefined, or defined from star imports(F405)
430-430:
BlockEndTokenmay be undefined, or defined from star imports(F405)
436-436:
BlockEndTokenmay be undefined, or defined from star imports(F405)
441-441:
MappingEndEventmay be undefined, or defined from star imports(F405)
447-447:
ValueTokenmay be undefined, or defined from star imports(F405)
449-449:
KeyTokenmay be undefined, or defined from star imports(F405)
449-449:
ValueTokenmay be undefined, or defined from star imports(F405)
449-449:
BlockEndTokenmay be undefined, or defined from star imports(F405)
477-477:
FlowSequenceEndTokenmay be undefined, or defined from star imports(F405)
479-479:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
486-486:
KeyTokenmay be undefined, or defined from star imports(F405)
488-488:
MappingStartEventmay be undefined, or defined from star imports(F405)
493-493:
FlowSequenceEndTokenmay be undefined, or defined from star imports(F405)
497-497:
SequenceEndEventmay be undefined, or defined from star imports(F405)
504-504:
ValueTokenmay be undefined, or defined from star imports(F405)
505-505:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
505-505:
FlowSequenceEndTokenmay be undefined, or defined from star imports(F405)
513-513:
ValueTokenmay be undefined, or defined from star imports(F405)
515-515:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
515-515:
FlowSequenceEndTokenmay be undefined, or defined from star imports(F405)
529-529:
MappingEndEventmay be undefined, or defined from star imports(F405)
543-543:
FlowMappingEndTokenmay be undefined, or defined from star imports(F405)
545-545:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
551-551:
KeyTokenmay be undefined, or defined from star imports(F405)
553-553:
ValueTokenmay be undefined, or defined from star imports(F405)
554-554:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
554-554:
FlowMappingEndTokenmay be undefined, or defined from star imports(F405)
560-560:
FlowMappingEndTokenmay be undefined, or defined from star imports(F405)
564-564:
MappingEndEventmay be undefined, or defined from star imports(F405)
570-570:
ValueTokenmay be undefined, or defined from star imports(F405)
572-572:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
572-572:
FlowMappingEndTokenmay be undefined, or defined from star imports(F405)
588-588:
ScalarEventmay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/parser.py
65-65:
from .tokens import *used; unable to detect undefined names(F403)
66-66:
from .events import *used; unable to detect undefined names(F403)
67-67:
from .scanner import *used; unable to detect undefined names(F403)
96-97: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
109-110: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
116-117: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
131-131:
StreamStartEventmay be undefined, or defined from star imports(F405)
142-142:
DirectiveTokenmay be undefined, or defined from star imports(F405)
142-142:
DocumentStartTokenmay be undefined, or defined from star imports(F405)
143-143:
StreamEndTokenmay be undefined, or defined from star imports(F405)
147-147:
DocumentStartEventmay be undefined, or defined from star imports(F405)
162-162:
DocumentEndTokenmay be undefined, or defined from star imports(F405)
166-166:
StreamEndTokenmay be undefined, or defined from star imports(F405)
170-170:
DocumentStartTokenmay be undefined, or defined from star imports(F405)
177-177:
DocumentStartEventmay be undefined, or defined from star imports(F405)
184-184:
StreamEndEventmay be undefined, or defined from star imports(F405)
196-196:
DocumentEndTokenmay be undefined, or defined from star imports(F405)
200-200:
DocumentEndEventmay be undefined, or defined from star imports(F405)
209-209:
DirectiveTokenmay be undefined, or defined from star imports(F405)
210-210:
DocumentStartTokenmay be undefined, or defined from star imports(F405)
210-210:
DocumentEndTokenmay be undefined, or defined from star imports(F405)
210-210:
StreamEndTokenmay be undefined, or defined from star imports(F405)
220-220:
DirectiveTokenmay be undefined, or defined from star imports(F405)
274-274:
AliasTokenmay be undefined, or defined from star imports(F405)
276-276:
AliasEventmay be undefined, or defined from star imports(F405)
282-282:
AnchorTokenmay be undefined, or defined from star imports(F405)
287-287:
TagTokenmay be undefined, or defined from star imports(F405)
292-292:
TagTokenmay be undefined, or defined from star imports(F405)
297-297:
AnchorTokenmay be undefined, or defined from star imports(F405)
319-319:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
321-321:
SequenceStartEventmay be undefined, or defined from star imports(F405)
325-325:
ScalarTokenmay be undefined, or defined from star imports(F405)
334-334:
ScalarEventmay be undefined, or defined from star imports(F405)
337-337:
FlowSequenceStartTokenmay be undefined, or defined from star imports(F405)
339-339:
SequenceStartEventmay be undefined, or defined from star imports(F405)
342-342:
FlowMappingStartTokenmay be undefined, or defined from star imports(F405)
344-344:
MappingStartEventmay be undefined, or defined from star imports(F405)
347-347:
BlockSequenceStartTokenmay be undefined, or defined from star imports(F405)
349-349:
SequenceStartEventmay be undefined, or defined from star imports(F405)
352-352:
BlockMappingStartTokenmay be undefined, or defined from star imports(F405)
354-354:
MappingStartEventmay be undefined, or defined from star imports(F405)
360-360:
ScalarEventmay be undefined, or defined from star imports(F405)
364-367: Use ternary operator
node = 'block' if block else 'flow'instead ofif-else-blockReplace
if-else-block withnode = 'block' if block else 'flow'(SIM108)
382-382:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
384-384:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
384-384:
BlockEndTokenmay be undefined, or defined from star imports(F405)
390-390:
BlockEndTokenmay be undefined, or defined from star imports(F405)
395-395:
SequenceEndEventmay be undefined, or defined from star imports(F405)
403-403:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
405-405:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
406-406:
KeyTokenmay be undefined, or defined from star imports(F405)
406-406:
ValueTokenmay be undefined, or defined from star imports(F405)
406-406:
BlockEndTokenmay be undefined, or defined from star imports(F405)
413-413:
SequenceEndEventmay be undefined, or defined from star imports(F405)
428-428:
KeyTokenmay be undefined, or defined from star imports(F405)
430-430:
KeyTokenmay be undefined, or defined from star imports(F405)
430-430:
ValueTokenmay be undefined, or defined from star imports(F405)
430-430:
BlockEndTokenmay be undefined, or defined from star imports(F405)
436-436:
BlockEndTokenmay be undefined, or defined from star imports(F405)
441-441:
MappingEndEventmay be undefined, or defined from star imports(F405)
447-447:
ValueTokenmay be undefined, or defined from star imports(F405)
449-449:
KeyTokenmay be undefined, or defined from star imports(F405)
449-449:
ValueTokenmay be undefined, or defined from star imports(F405)
449-449:
BlockEndTokenmay be undefined, or defined from star imports(F405)
477-477:
FlowSequenceEndTokenmay be undefined, or defined from star imports(F405)
479-479:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
486-486:
KeyTokenmay be undefined, or defined from star imports(F405)
488-488:
MappingStartEventmay be undefined, or defined from star imports(F405)
493-493:
FlowSequenceEndTokenmay be undefined, or defined from star imports(F405)
497-497:
SequenceEndEventmay be undefined, or defined from star imports(F405)
504-504:
ValueTokenmay be undefined, or defined from star imports(F405)
505-505:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
505-505:
FlowSequenceEndTokenmay be undefined, or defined from star imports(F405)
513-513:
ValueTokenmay be undefined, or defined from star imports(F405)
515-515:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
515-515:
FlowSequenceEndTokenmay be undefined, or defined from star imports(F405)
529-529:
MappingEndEventmay be undefined, or defined from star imports(F405)
543-543:
FlowMappingEndTokenmay be undefined, or defined from star imports(F405)
545-545:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
551-551:
KeyTokenmay be undefined, or defined from star imports(F405)
553-553:
ValueTokenmay be undefined, or defined from star imports(F405)
554-554:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
554-554:
FlowMappingEndTokenmay be undefined, or defined from star imports(F405)
560-560:
FlowMappingEndTokenmay be undefined, or defined from star imports(F405)
564-564:
MappingEndEventmay be undefined, or defined from star imports(F405)
570-570:
ValueTokenmay be undefined, or defined from star imports(F405)
572-572:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
572-572:
FlowMappingEndTokenmay be undefined, or defined from star imports(F405)
588-588:
ScalarEventmay be undefined, or defined from star imports(F405)
testing/originalnodep/yaml/constructor.py
11-11:
from .error import *used; unable to detect undefined names(F403)
12-12:
from .nodes import *used; unable to detect undefined names(F403)
16-16:
MarkedYAMLErrormay be undefined, or defined from star imports(F405)
60-60: Loop control variable
dummynot used within loop bodyRename unused
dummyto_dummy(B007)
93-93:
ScalarNodemay be undefined, or defined from star imports(F405)
95-95:
SequenceNodemay be undefined, or defined from star imports(F405)
97-97:
MappingNodemay be undefined, or defined from star imports(F405)
107-107: Loop control variable
dummynot used within loop bodyRename unused
dummyto_dummy(B007)
118-118:
ScalarNodemay be undefined, or defined from star imports(F405)
125-125:
SequenceNodemay be undefined, or defined from star imports(F405)
133-133:
MappingNodemay be undefined, or defined from star imports(F405)
148-148:
MappingNodemay be undefined, or defined from star imports(F405)
161-161: Test for membership should be
not inConvert to
not in(E713)
167-167: Test for membership should be
not inConvert to
not in(E713)
174-174:
MappingNodemay be undefined, or defined from star imports(F405)
187-187:
MappingNodemay be undefined, or defined from star imports(F405)
190-190:
SequenceNodemay be undefined, or defined from star imports(F405)
193-193:
MappingNodemay be undefined, or defined from star imports(F405)
216-216:
MappingNodemay be undefined, or defined from star imports(F405)
298-300: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
307-308: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
323-323: Local variable
valueis assigned to but never usedRemove assignment to unused variable
value(F841)
358-358:
SequenceNodemay be undefined, or defined from star imports(F405)
362-362:
MappingNodemay be undefined, or defined from star imports(F405)
379-379:
SequenceNodemay be undefined, or defined from star imports(F405)
383-383:
MappingNodemay be undefined, or defined from star imports(F405)
504-506: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
513-514: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
533-534: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
553-554: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
604-604: Use
key in dictinstead ofkey in dict.keys()Remove
.keys()(SIM118)
635-635:
SequenceNodemay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/constructor.py
11-11:
from .error import *used; unable to detect undefined names(F403)
12-12:
from .nodes import *used; unable to detect undefined names(F403)
16-16:
MarkedYAMLErrormay be undefined, or defined from star imports(F405)
60-60: Loop control variable
dummynot used within loop bodyRename unused
dummyto_dummy(B007)
93-93:
ScalarNodemay be undefined, or defined from star imports(F405)
95-95:
SequenceNodemay be undefined, or defined from star imports(F405)
97-97:
MappingNodemay be undefined, or defined from star imports(F405)
107-107: Loop control variable
dummynot used within loop bodyRename unused
dummyto_dummy(B007)
118-118:
ScalarNodemay be undefined, or defined from star imports(F405)
125-125:
SequenceNodemay be undefined, or defined from star imports(F405)
133-133:
MappingNodemay be undefined, or defined from star imports(F405)
148-148:
MappingNodemay be undefined, or defined from star imports(F405)
161-161: Test for membership should be
not inConvert to
not in(E713)
167-167: Test for membership should be
not inConvert to
not in(E713)
174-174:
MappingNodemay be undefined, or defined from star imports(F405)
187-187:
MappingNodemay be undefined, or defined from star imports(F405)
190-190:
SequenceNodemay be undefined, or defined from star imports(F405)
193-193:
MappingNodemay be undefined, or defined from star imports(F405)
216-216:
MappingNodemay be undefined, or defined from star imports(F405)
298-300: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
307-308: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
323-323: Local variable
valueis assigned to but never usedRemove assignment to unused variable
value(F841)
358-358:
SequenceNodemay be undefined, or defined from star imports(F405)
362-362:
MappingNodemay be undefined, or defined from star imports(F405)
379-379:
SequenceNodemay be undefined, or defined from star imports(F405)
383-383:
MappingNodemay be undefined, or defined from star imports(F405)
504-506: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
513-514: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
533-534: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
553-554: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
604-604: Use
key in dictinstead ofkey in dict.keys()Remove
.keys()(SIM118)
635-635:
SequenceNodemay be undefined, or defined from star imports(F405)
testing/originalnodep/yaml/emitter.py
12-12:
from .events import *used; unable to detect undefined names(F403)
124-124:
DocumentStartEventmay be undefined, or defined from star imports(F405)
126-126:
SequenceStartEventmay be undefined, or defined from star imports(F405)
128-128:
MappingStartEventmay be undefined, or defined from star imports(F405)
136-136:
DocumentStartEventmay be undefined, or defined from star imports(F405)
136-136:
CollectionStartEventmay be undefined, or defined from star imports(F405)
138-138:
DocumentEndEventmay be undefined, or defined from star imports(F405)
138-138:
CollectionEndEventmay be undefined, or defined from star imports(F405)
140-140:
StreamEndEventmay be undefined, or defined from star imports(F405)
161-161:
StreamStartEventmay be undefined, or defined from star imports(F405)
179-179:
DocumentStartEventmay be undefined, or defined from star imports(F405)
204-204:
StreamEndEventmay be undefined, or defined from star imports(F405)
215-215:
DocumentEndEventmay be undefined, or defined from star imports(F405)
238-238:
AliasEventmay be undefined, or defined from star imports(F405)
240-240:
ScalarEventmay be undefined, or defined from star imports(F405)
240-240:
CollectionStartEventmay be undefined, or defined from star imports(F405)
243-243:
ScalarEventmay be undefined, or defined from star imports(F405)
245-245:
SequenceStartEventmay be undefined, or defined from star imports(F405)
251-251:
MappingStartEventmay be undefined, or defined from star imports(F405)
281-281:
SequenceEndEventmay be undefined, or defined from star imports(F405)
293-293:
SequenceEndEventmay be undefined, or defined from star imports(F405)
317-317:
MappingEndEventmay be undefined, or defined from star imports(F405)
334-334:
MappingEndEventmay be undefined, or defined from star imports(F405)
377-377:
SequenceEndEventmay be undefined, or defined from star imports(F405)
396-396:
MappingEndEventmay be undefined, or defined from star imports(F405)
423-423:
SequenceStartEventmay be undefined, or defined from star imports(F405)
424-424:
SequenceEndEventmay be undefined, or defined from star imports(F405)
427-427:
MappingStartEventmay be undefined, or defined from star imports(F405)
428-428:
MappingEndEventmay be undefined, or defined from star imports(F405)
431-431:
DocumentStartEventmay be undefined, or defined from star imports(F405)
434-434:
ScalarEventmay be undefined, or defined from star imports(F405)
439-439:
NodeEventmay be undefined, or defined from star imports(F405)
443-443:
ScalarEventmay be undefined, or defined from star imports(F405)
443-443:
CollectionStartEventmay be undefined, or defined from star imports(F405)
448-448:
ScalarEventmay be undefined, or defined from star imports(F405)
452-452:
AliasEventmay be undefined, or defined from star imports(F405)
453-453:
ScalarEventmay be undefined, or defined from star imports(F405)
471-471:
ScalarEventmay be undefined, or defined from star imports(F405)
499-503: Use a single
ifstatement instead of nestedifstatements(SIM102)
505-507: Use a single
ifstatement instead of nestedifstatements(SIM102)
509-511: Use a single
ifstatement instead of nestedifstatements(SIM102)
703-703: Local variable
unicode_charactersis assigned to but never usedRemove assignment to unused variable
unicode_characters(F841)
802-805: Use ternary operator
data = indicator if self.whitespace or not need_whitespace else ' ' + indicatorinstead ofif-else-blockReplace
if-else-block withdata = indicator if self.whitespace or not need_whitespace else ' ' + indicator(SIM108)
887-888: Use a single
ifstatement instead of nestedifstatements(SIM102)
testing/prajintry/pacakges/yaml/emitter.py
12-12:
from .events import *used; unable to detect undefined names(F403)
124-124:
DocumentStartEventmay be undefined, or defined from star imports(F405)
126-126:
SequenceStartEventmay be undefined, or defined from star imports(F405)
128-128:
MappingStartEventmay be undefined, or defined from star imports(F405)
136-136:
DocumentStartEventmay be undefined, or defined from star imports(F405)
136-136:
CollectionStartEventmay be undefined, or defined from star imports(F405)
138-138:
DocumentEndEventmay be undefined, or defined from star imports(F405)
138-138:
CollectionEndEventmay be undefined, or defined from star imports(F405)
140-140:
StreamEndEventmay be undefined, or defined from star imports(F405)
161-161:
StreamStartEventmay be undefined, or defined from star imports(F405)
179-179:
DocumentStartEventmay be undefined, or defined from star imports(F405)
204-204:
StreamEndEventmay be undefined, or defined from star imports(F405)
215-215:
DocumentEndEventmay be undefined, or defined from star imports(F405)
238-238:
AliasEventmay be undefined, or defined from star imports(F405)
240-240:
ScalarEventmay be undefined, or defined from star imports(F405)
240-240:
CollectionStartEventmay be undefined, or defined from star imports(F405)
243-243:
ScalarEventmay be undefined, or defined from star imports(F405)
245-245:
SequenceStartEventmay be undefined, or defined from star imports(F405)
251-251:
MappingStartEventmay be undefined, or defined from star imports(F405)
281-281:
SequenceEndEventmay be undefined, or defined from star imports(F405)
293-293:
SequenceEndEventmay be undefined, or defined from star imports(F405)
317-317:
MappingEndEventmay be undefined, or defined from star imports(F405)
334-334:
MappingEndEventmay be undefined, or defined from star imports(F405)
377-377:
SequenceEndEventmay be undefined, or defined from star imports(F405)
396-396:
MappingEndEventmay be undefined, or defined from star imports(F405)
423-423:
SequenceStartEventmay be undefined, or defined from star imports(F405)
424-424:
SequenceEndEventmay be undefined, or defined from star imports(F405)
427-427:
MappingStartEventmay be undefined, or defined from star imports(F405)
428-428:
MappingEndEventmay be undefined, or defined from star imports(F405)
431-431:
DocumentStartEventmay be undefined, or defined from star imports(F405)
434-434:
ScalarEventmay be undefined, or defined from star imports(F405)
439-439:
NodeEventmay be undefined, or defined from star imports(F405)
443-443:
ScalarEventmay be undefined, or defined from star imports(F405)
443-443:
CollectionStartEventmay be undefined, or defined from star imports(F405)
448-448:
ScalarEventmay be undefined, or defined from star imports(F405)
452-452:
AliasEventmay be undefined, or defined from star imports(F405)
453-453:
ScalarEventmay be undefined, or defined from star imports(F405)
471-471:
ScalarEventmay be undefined, or defined from star imports(F405)
499-503: Use a single
ifstatement instead of nestedifstatements(SIM102)
505-507: Use a single
ifstatement instead of nestedifstatements(SIM102)
509-511: Use a single
ifstatement instead of nestedifstatements(SIM102)
703-703: Local variable
unicode_charactersis assigned to but never usedRemove assignment to unused variable
unicode_characters(F841)
802-805: Use ternary operator
data = indicator if self.whitespace or not need_whitespace else ' ' + indicatorinstead ofif-else-blockReplace
if-else-block withdata = indicator if self.whitespace or not need_whitespace else ' ' + indicator(SIM108)
887-888: Use a single
ifstatement instead of nestedifstatements(SIM102)
testing/originalnodep/yaml/scanner.py
30-30:
from .tokens import *used; unable to detect undefined names(F403)
347-347:
BlockEndTokenmay be undefined, or defined from star imports(F405)
367-367:
StreamStartTokenmay be undefined, or defined from star imports(F405)
385-385:
StreamEndTokenmay be undefined, or defined from star imports(F405)
403-403:
DocumentStartTokenmay be undefined, or defined from star imports(F405)
406-406:
DocumentEndTokenmay be undefined, or defined from star imports(F405)
425-425:
FlowSequenceStartTokenmay be undefined, or defined from star imports(F405)
428-428:
FlowMappingStartTokenmay be undefined, or defined from star imports(F405)
448-448:
FlowSequenceEndTokenmay be undefined, or defined from star imports(F405)
451-451:
FlowMappingEndTokenmay be undefined, or defined from star imports(F405)
482-482:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
498-498:
BlockSequenceStartTokenmay be undefined, or defined from star imports(F405)
515-515:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
531-531:
BlockMappingStartTokenmay be undefined, or defined from star imports(F405)
543-543:
KeyTokenmay be undefined, or defined from star imports(F405)
554-554:
KeyTokenmay be undefined, or defined from star imports(F405)
558-559: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
561-561:
BlockMappingStartTokenmay be undefined, or defined from star imports(F405)
572-576: Use a single
ifstatement instead of nestedifstatements(SIM102)
584-585: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
587-587:
BlockMappingStartTokenmay be undefined, or defined from star imports(F405)
599-599:
ValueTokenmay be undefined, or defined from star imports(F405)
610-610:
AliasTokenmay be undefined, or defined from star imports(F405)
621-621:
AnchorTokenmay be undefined, or defined from star imports(F405)
693-695: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
701-703: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
804-804:
DirectiveTokenmay be undefined, or defined from star imports(F405)
910-913: Use ternary operator
name = 'alias' if indicator == '*' else 'anchor'instead ofif-else-blockReplace
if-else-block withname = 'alias' if indicator == '*' else 'anchor'(SIM108)
974-974:
TagTokenmay be undefined, or defined from star imports(F405)
979-982: Use ternary operator
folded = True if style == '>' else Falseinstead ofif-else-blockReplace
if-else-block withfolded = True if style == '>' else False(SIM108)
1049-1049:
ScalarTokenmay be undefined, or defined from star imports(F405)
1058-1061: Use ternary operator
chomping = True if ch == '+' else Falseinstead ofif-else-blockReplace
if-else-block withchomping = True if ch == '+' else False(SIM108)
1080-1083: Use ternary operator
chomping = True if ch == '+' else Falseinstead ofif-else-blockReplace
if-else-block withchomping = True if ch == '+' else False(SIM108)
1141-1144: Use ternary operator
double = True if style == '"' else Falseinstead ofif-else-blockReplace
if-else-block withdouble = True if style == '"' else False(SIM108)
1155-1155:
ScalarTokenmay be undefined, or defined from star imports(F405)
1309-1309:
ScalarTokenmay be undefined, or defined from star imports(F405)
1413-1413: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
testing/prajintry/pacakges/yaml/scanner.py
30-30:
from .tokens import *used; unable to detect undefined names(F403)
347-347:
BlockEndTokenmay be undefined, or defined from star imports(F405)
367-367:
StreamStartTokenmay be undefined, or defined from star imports(F405)
385-385:
StreamEndTokenmay be undefined, or defined from star imports(F405)
403-403:
DocumentStartTokenmay be undefined, or defined from star imports(F405)
406-406:
DocumentEndTokenmay be undefined, or defined from star imports(F405)
425-425:
FlowSequenceStartTokenmay be undefined, or defined from star imports(F405)
428-428:
FlowMappingStartTokenmay be undefined, or defined from star imports(F405)
448-448:
FlowSequenceEndTokenmay be undefined, or defined from star imports(F405)
451-451:
FlowMappingEndTokenmay be undefined, or defined from star imports(F405)
482-482:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
498-498:
BlockSequenceStartTokenmay be undefined, or defined from star imports(F405)
515-515:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
531-531:
BlockMappingStartTokenmay be undefined, or defined from star imports(F405)
543-543:
KeyTokenmay be undefined, or defined from star imports(F405)
554-554:
KeyTokenmay be undefined, or defined from star imports(F405)
558-559: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
561-561:
BlockMappingStartTokenmay be undefined, or defined from star imports(F405)
572-576: Use a single
ifstatement instead of nestedifstatements(SIM102)
584-585: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
587-587:
BlockMappingStartTokenmay be undefined, or defined from star imports(F405)
599-599:
ValueTokenmay be undefined, or defined from star imports(F405)
610-610:
AliasTokenmay be undefined, or defined from star imports(F405)
621-621:
AnchorTokenmay be undefined, or defined from star imports(F405)
693-695: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
701-703: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
804-804:
DirectiveTokenmay be undefined, or defined from star imports(F405)
910-913: Use ternary operator
name = 'alias' if indicator == '*' else 'anchor'instead ofif-else-blockReplace
if-else-block withname = 'alias' if indicator == '*' else 'anchor'(SIM108)
974-974:
TagTokenmay be undefined, or defined from star imports(F405)
979-982: Use ternary operator
folded = True if style == '>' else Falseinstead ofif-else-blockReplace
if-else-block withfolded = True if style == '>' else False(SIM108)
1049-1049:
ScalarTokenmay be undefined, or defined from star imports(F405)
1058-1061: Use ternary operator
chomping = True if ch == '+' else Falseinstead ofif-else-blockReplace
if-else-block withchomping = True if ch == '+' else False(SIM108)
1080-1083: Use ternary operator
chomping = True if ch == '+' else Falseinstead ofif-else-blockReplace
if-else-block withchomping = True if ch == '+' else False(SIM108)
1141-1144: Use ternary operator
double = True if style == '"' else Falseinstead ofif-else-blockReplace
if-else-block withdouble = True if style == '"' else False(SIM108)
1155-1155:
ScalarTokenmay be undefined, or defined from star imports(F405)
1309-1309:
ScalarTokenmay be undefined, or defined from star imports(F405)
1413-1413: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
Additional comments not posted (120)
dockerfiles/fission/python/Dockerfile.runtime (1)
1-5: LGTM!The Dockerfile is well-structured and uses
apkfor package installation, which is suitable for Alpine-based images.out_storage.json (1)
4-5: Avoid hardcoding sensitive information.The access key and secret key are hardcoded, which is a security risk. Use environment variables or a secrets management system to manage these keys securely.
Tools
Gitleaks
4-4: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
5-5: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
dockerfiles/fission/python/Dockerfile.build (1)
1-27: LGTM!The Dockerfile is well-structured, setting up a comprehensive build environment with necessary tools and dependencies. The use of
gosufor privilege management is a good practice.testing/prajintry/pacakges/yaml/loader.py (1)
4-9: Avoid wildcard imports for better clarity and maintainability.Using
from module import *makes it difficult to identify where specific classes or functions are defined, and can lead to unexpected behavior due to name clashes or undefined names. Consider importing only the necessary components explicitly.Tools
Ruff
4-4:
from .reader import *used; unable to detect undefined names(F403)
5-5:
from .scanner import *used; unable to detect undefined names(F403)
6-6:
from .parser import *used; unable to detect undefined names(F403)
7-7:
from .composer import *used; unable to detect undefined names(F403)
8-8:
from .constructor import *used; unable to detect undefined names(F403)
9-9:
from .resolver import *used; unable to detect undefined names(F403)
benchmarks/wrappers/fission/python/handler.py (1)
1-1: Remove or implement the commented-out code.The file contains commented-out code for a
handlerfunction. If the code is not needed, consider removing it to keep the codebase clean.testing/prajintry/pacakges/yaml/events.py (11)
4-13: LGTM!The
Eventclass is well-implemented with a dynamic__repr__method that adapts to the attributes present in the instance.
15-19: LGTM!The
NodeEventclass correctly extendsEventand initializes its attributes.
21-29: LGTM!The
CollectionStartEventclass is well-structured and initializes all necessary attributes, including optional ones.
31-32: LGTM!The
CollectionEndEventclass is appropriately defined as a marker class extendingEvent.
36-40: LGTM!The
StreamStartEventclass correctly initializes its attributes, including the optionalencoding.
42-43: LGTM!The
StreamEndEventclass is appropriately defined as a marker class extendingEvent.
45-52: LGTM!The
DocumentStartEventclass is well-structured and initializes all necessary attributes, including optional ones.
54-59: LGTM!The
DocumentEndEventclass correctly initializes its attributes, including the optionalexplicit.
61-62: LGTM!The
AliasEventclass is appropriately defined as a marker class extendingNodeEvent.
64-73: LGTM!The
ScalarEventclass is well-structured and initializes all necessary attributes, including optional ones.
75-85: LGTM!The
SequenceStartEvent,SequenceEndEvent,MappingStartEvent, andMappingEndEventclasses are appropriately defined as marker classes extendingCollectionStartEventandCollectionEndEvent.testing/prajintry/pacakges/yaml/error.py (3)
4-44: LGTM!The
Markclass is well-implemented, providing useful methods for generating a snippet and a string representation of the position in the YAML document.
45-46: LGTM!The
YAMLErrorclass is appropriately defined as a basic exception class for YAML errors.
48-74: LGTM!The
MarkedYAMLErrorclass is well-implemented, providing detailed context and problem information for YAML errors.sebs/config.py (1)
45-46: LGTM! Verify configuration key.The
benchmark_base_images_runtimemethod is correctly implemented to retrieve runtime-specific base images. Ensure that the keybase_images_runtimeexists in the configuration data.Verification successful
Configuration Key Verified
The
base_images_runtimekey is present in the configuration data, confirming that thebenchmark_base_images_runtimemethod can access it as expected. No further action is required.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `base_images_runtime` key exists in the configuration data. # Test: Search for the `base_images_runtime` key in the systems.json file. Expect: Key exists. rg --type json '"base_images_runtime"' config/systems.jsonLength of output: 93
testing/prajintry/pacakges/yaml/tokens.py (1)
2-104: Overall structure and consistency are good.The file is well-structured, and the classes are consistent in their implementation. The base
Tokenclass provides a solid foundation for other token types.config/example.json (1)
9-9: Upgrade Python version compatibility.The Python version has been upgraded to 3.8. Ensure that all dependencies and code are compatible with Python 3.8, as this may affect library compatibility or introduce new features.
testing/originalnodep/yaml/dumper.py (1)
9-62: Ensure all base classes are defined.The classes
Emitter,Serializer,Representer, andResolverare used but imported via wildcard imports. Ensure these classes are defined in the imported modules to prevent runtime errors.Verification successful
Base classes are correctly defined.
The classes
Emitter,Serializer,Representer, andResolverare all defined in the relevant modules within thetesting/originalnodep/yamldirectory. There are no missing class definitions that would cause runtime errors.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all base classes used in the dumper classes are defined in the imported modules. # Test: Search for class definitions in the relevant files. fd -e py | xargs rg 'class (Emitter|Serializer|Representer|Resolver)'Length of output: 1213
Tools
Ruff
9-9:
Emittermay be undefined, or defined from star imports(F405)
9-9:
Serializermay be undefined, or defined from star imports(F405)
9-9:
BaseRepresentermay be undefined, or defined from star imports(F405)
9-9:
BaseResolvermay be undefined, or defined from star imports(F405)
17-17:
Emittermay be undefined, or defined from star imports(F405)
20-20:
Serializermay be undefined, or defined from star imports(F405)
23-23:
Representermay be undefined, or defined from star imports(F405)
25-25:
Resolvermay be undefined, or defined from star imports(F405)
27-27:
Emittermay be undefined, or defined from star imports(F405)
27-27:
Serializermay be undefined, or defined from star imports(F405)
27-27:
SafeRepresentermay be undefined, or defined from star imports(F405)
27-27:
Resolvermay be undefined, or defined from star imports(F405)
35-35:
Emittermay be undefined, or defined from star imports(F405)
38-38:
Serializermay be undefined, or defined from star imports(F405)
41-41:
SafeRepresentermay be undefined, or defined from star imports(F405)
43-43:
Resolvermay be undefined, or defined from star imports(F405)
45-45:
Emittermay be undefined, or defined from star imports(F405)
45-45:
Serializermay be undefined, or defined from star imports(F405)
45-45:
Representermay be undefined, or defined from star imports(F405)
45-45:
Resolvermay be undefined, or defined from star imports(F405)
53-53:
Emittermay be undefined, or defined from star imports(F405)
56-56:
Serializermay be undefined, or defined from star imports(F405)
59-59:
Representermay be undefined, or defined from star imports(F405)
61-61:
Resolvermay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/dumper.py (1)
9-25: Ensure all inherited classes are defined.The classes
Emitter,Serializer,BaseRepresenter, andBaseResolvermight be undefined due to star imports. Verify that these classes are correctly imported or defined elsewhere in the codebase.Tools
Ruff
9-9:
Emittermay be undefined, or defined from star imports(F405)
9-9:
Serializermay be undefined, or defined from star imports(F405)
9-9:
BaseRepresentermay be undefined, or defined from star imports(F405)
9-9:
BaseResolvermay be undefined, or defined from star imports(F405)
17-17:
Emittermay be undefined, or defined from star imports(F405)
20-20:
Serializermay be undefined, or defined from star imports(F405)
23-23:
Representermay be undefined, or defined from star imports(F405)
25-25:
Resolvermay be undefined, or defined from star imports(F405)
tools/build_docker_images.py (3)
13-13: New deployment option added: "fission".The addition of "fission" as a deployment choice expands the script's capabilities. Ensure that all necessary configurations for this deployment type are in place.
18-18: New argument added:--runtime.The
--runtimeargument allows users to specify building a runtime image. This addition enhances the script's flexibility.
46-47: Conditional logic forversion_nameadjustment.The check for
image_type == "runtime"and subsequent modification ofversion_nameensures correct naming for runtime images. This logic appears sound.testing/originalnodep/yaml/cyaml.py (1)
16-50: Ensure all inherited classes are defined.The classes
BaseConstructor,SafeConstructor,FullConstructor,UnsafeConstructor,Constructor, andResolvermight be undefined due to star imports. Verify that these classes are correctly imported or defined elsewhere in the codebase.Verification successful
All inherited classes are defined in the codebase.
The classes
BaseConstructor,SafeConstructor,FullConstructor,UnsafeConstructor,Constructor, andResolverare defined in the codebase. Here are their locations:
BaseConstructor,SafeConstructor,FullConstructor,UnsafeConstructor,Constructorare defined intesting/originalnodep/yaml/constructor.py.Resolveris defined intesting/originalnodep/yaml/resolver.py.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all inherited classes are defined in the codebase. # Test: Search for class definitions. Expect: Definitions for BaseConstructor, SafeConstructor, FullConstructor, UnsafeConstructor, Constructor, Resolver. rg --type python --pattern 'class (BaseConstructor|SafeConstructor|FullConstructor|UnsafeConstructor|Constructor|Resolver)'Length of output: 537
Script:
#!/bin/bash # Description: Verify that all inherited classes are defined in the codebase. # Test: Search for class definitions. Expect: Definitions for BaseConstructor, SafeConstructor, FullConstructor, UnsafeConstructor, Constructor, Resolver. rg 'class (BaseConstructor|SafeConstructor|FullConstructor|UnsafeConstructor|Constructor|Resolver)' --type pythonLength of output: 146
Script:
#!/bin/bash # Description: Verify that all inherited classes are defined in the codebase. # Test: Search for class definitions without specifying file type. rg 'class (BaseConstructor|SafeConstructor|FullConstructor|UnsafeConstructor|Constructor|Resolver)' --glob '*.py'Length of output: 1387
Tools
Ruff
16-16:
BaseConstructormay be undefined, or defined from star imports(F405)
16-16:
BaseResolvermay be undefined, or defined from star imports(F405)
20-20:
BaseConstructormay be undefined, or defined from star imports(F405)
21-21:
BaseResolvermay be undefined, or defined from star imports(F405)
23-23:
SafeConstructormay be undefined, or defined from star imports(F405)
23-23:
Resolvermay be undefined, or defined from star imports(F405)
27-27:
SafeConstructormay be undefined, or defined from star imports(F405)
28-28:
Resolvermay be undefined, or defined from star imports(F405)
30-30:
FullConstructormay be undefined, or defined from star imports(F405)
30-30:
Resolvermay be undefined, or defined from star imports(F405)
34-34:
FullConstructormay be undefined, or defined from star imports(F405)
35-35:
Resolvermay be undefined, or defined from star imports(F405)
37-37:
UnsafeConstructormay be undefined, or defined from star imports(F405)
37-37:
Resolvermay be undefined, or defined from star imports(F405)
41-41:
UnsafeConstructormay be undefined, or defined from star imports(F405)
42-42:
Resolvermay be undefined, or defined from star imports(F405)
44-44:
Constructormay be undefined, or defined from star imports(F405)
44-44:
Resolvermay be undefined, or defined from star imports(F405)
48-48:
Constructormay be undefined, or defined from star imports(F405)
49-49:
Resolvermay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/cyaml.py (7)
23-28: Duplicate: Avoid using star imports.The same issue with star imports applies here as well.
Tools
Ruff
23-23:
SafeConstructormay be undefined, or defined from star imports(F405)
23-23:
Resolvermay be undefined, or defined from star imports(F405)
27-27:
SafeConstructormay be undefined, or defined from star imports(F405)
28-28:
Resolvermay be undefined, or defined from star imports(F405)
30-35: Duplicate: Avoid using star imports.The same issue with star imports applies here as well.
Tools
Ruff
30-30:
FullConstructormay be undefined, or defined from star imports(F405)
30-30:
Resolvermay be undefined, or defined from star imports(F405)
34-34:
FullConstructormay be undefined, or defined from star imports(F405)
35-35:
Resolvermay be undefined, or defined from star imports(F405)
37-42: Duplicate: Avoid using star imports.The same issue with star imports applies here as well.
Tools
Ruff
37-37:
UnsafeConstructormay be undefined, or defined from star imports(F405)
37-37:
Resolvermay be undefined, or defined from star imports(F405)
41-41:
UnsafeConstructormay be undefined, or defined from star imports(F405)
42-42:
Resolvermay be undefined, or defined from star imports(F405)
44-49: Duplicate: Avoid using star imports.The same issue with star imports applies here as well.
Tools
Ruff
44-44:
Constructormay be undefined, or defined from star imports(F405)
44-44:
Resolvermay be undefined, or defined from star imports(F405)
48-48:
Constructormay be undefined, or defined from star imports(F405)
49-49:
Resolvermay be undefined, or defined from star imports(F405)
51-66: Duplicate: Avoid using star imports.The same issue with star imports applies here as well.
Tools
Ruff
51-51:
BaseRepresentermay be undefined, or defined from star imports(F405)
51-51:
BaseResolvermay be undefined, or defined from star imports(F405)
64-64:
Representermay be undefined, or defined from star imports(F405)
66-66:
Resolvermay be undefined, or defined from star imports(F405)
68-83: Duplicate: Avoid using star imports.The same issue with star imports applies here as well.
Tools
Ruff
68-68:
SafeRepresentermay be undefined, or defined from star imports(F405)
68-68:
Resolvermay be undefined, or defined from star imports(F405)
81-81:
SafeRepresentermay be undefined, or defined from star imports(F405)
83-83:
Resolvermay be undefined, or defined from star imports(F405)
85-100: Duplicate: Avoid using star imports.The same issue with star imports applies here as well.
Tools
Ruff
85-85:
Serializermay be undefined, or defined from star imports(F405)
85-85:
Representermay be undefined, or defined from star imports(F405)
85-85:
Resolvermay be undefined, or defined from star imports(F405)
98-98:
Representermay be undefined, or defined from star imports(F405)
100-100:
Resolvermay be undefined, or defined from star imports(F405)
testing/originalnodep/yaml/serializer.py (1)
8-9: LGTM!The
SerializerErrorclass is correctly implemented.testing/prajintry/pacakges/yaml/serializer.py (2)
8-9: Duplicate: LGTM!The
SerializerErrorclass is correctly implemented.
5-6: Duplicate: Avoid using star imports.Star imports can lead to undefined names and make the code less maintainable. Consider importing specific classes or functions instead.
Tools
Ruff
5-5:
from .events import *used; unable to detect undefined names(F403)
6-6:
from .nodes import *used; unable to detect undefined names(F403)
benchmarks/wrappers/fission/python/storage.py (1)
3-3: Remove unused import.The import statement for
jsonis unused and should be removed to clean up the code.Tools
Ruff
3-3:
jsonimported but unusedRemove unused import:
json(F401)
testing/prajintry/pacakges/yaml/composer.py (2)
5-6: Avoid using star imports.Star imports can lead to undefined names and make it difficult to track where specific names are coming from. Import only the necessary components explicitly.
Tools
Ruff
5-5:
from .events import *used; unable to detect undefined names(F403)
6-6:
from .nodes import *used; unable to detect undefined names(F403)
73-74: Combine nestedifstatements.The nested
ifstatements can be combined for clarity and conciseness.Tools
Ruff
73-74: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
sebs/faas/config.py (1)
208-211: LGTM! Verify the import ofFissionConfig.The changes to support the "fission" platform in the
deserializefunction are approved.However, ensure that
FissionConfigis correctly defined and imported from the intended module.Verification successful
The import of
FissionConfigis correctly defined and imported.
FissionConfigis defined insebs/fission/config.py.- The import in
sebs/faas/config.pyis valid and correctly references the intended module.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the import of `FissionConfig`. # Test: Search for the definition of `FissionConfig`. Expect: Definition of `FissionConfig` in the appropriate module. ast-grep --lang python --pattern 'class FissionConfig { $$$ }'Length of output: 514
Script:
#!/bin/bash # Description: Verify the import of `FissionConfig`. # Test: Search for the definition of `FissionConfig`. Expect: Definition of `FissionConfig` in the appropriate module. ast-grep --lang python --pattern 'class FissionConfig:'Length of output: 57
Script:
#!/bin/bash # Description: Search for any references to `FissionConfig` in the codebase. # Test: Use ripgrep to find any mentions of `FissionConfig`. rg 'FissionConfig'Length of output: 552
sebs/sebs.py (1)
107-110: LGTM! Verify the import ofFission.The changes to add support for the "fission" platform in the
get_deploymentfunction are approved.However, ensure that
Fissionis correctly defined and imported from the intended module.Verification successful
Import of
FissionVerified SuccessfullyThe
Fissionclass is correctly defined in thesebs/fission/fission.pymodule, and its import insebs/sebs.pyis accurate. No issues were found with the import statement.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the import of `Fission`. # Test: Search for the definition of `Fission`. Expect: Definition of `Fission` in the appropriate module. ast-grep --lang python --pattern 'class Fission { $$$ }'Length of output: 502
Script:
#!/bin/bash # Description: Verify the import of `Fission` by searching for its class definition in Python syntax. # Test: Search for the definition of `Fission`. Expect: Definition of `Fission` in the appropriate module. ast-grep --lang python --pattern 'class Fission: $$$'Length of output: 55
Script:
#!/bin/bash # Description: Search for any occurrences of `Fission` in the codebase to verify its definition or usage. # Test: Search for occurrences of `Fission`. Expect: Any mention of `Fission` in the codebase. rg 'Fission'Length of output: 7276
testing/prajintry/pacakges/yaml/resolver.py (3)
4-5: Avoid star imports.Star imports can lead to namespace pollution and make the code harder to understand. Import specific classes or functions instead.
Tools
Ruff
4-4:
from .error import *used; unable to detect undefined names(F403)
5-5:
from .nodes import *used; unable to detect undefined names(F403)
27-27: Usenot infor membership tests.Use
not infor membership tests to improve readability and adhere to Python's idiomatic practices.Also applies to: 51-51
Tools
Ruff
27-27: Test for membership should be
not inConvert to
not in(E713)
126-127: Simplify conditional statements.Use a single
ifstatement instead of nestedifstatements to improve readability.Also applies to: 138-139
Tools
Ruff
126-127: Use a single
ifstatement instead of nestedifstatements(SIM102)
sebs/fission/config.py (2)
264-270: Handle potential missing keys in the constructor.The constructor assumes that all necessary keys are present in the
configdictionary. Consider adding error handling for missing keys to avoid potential runtime errors.
143-186: ReplaceThe
create_packagemethod usesTools
Ruff
146-146: f-string without any placeholders
Remove extraneous
fprefix(F541)
172-172: f-string without any placeholders
Remove extraneous
fprefix(F541)
182-182: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
testing/prajintry/pacakges/yaml/__init__.py (1)
271-285: Ensure consistency in resolver functions.The
add_implicit_resolverandadd_path_resolverfunctions should ensure that theLoaderandDumperparameters are consistently applied across different loaders and dumpers.Also applies to: 287-300
Verification successful
Consistency in Resolver Functions Verified
The
add_implicit_resolverandadd_path_resolverfunctions consistently apply resolvers across different loaders (Loader,FullLoader,UnsafeLoader) and the dumper. No issues with consistency were found.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistent usage of add_implicit_resolver and add_path_resolver across loaders and dumpers. # Test: Ensure that the resolver functions are applied to all relevant loaders and dumpers. rg --type python -A 2 $'add_implicit_resolver' rg --type python -A 2 $'add_path_resolver'Length of output: 149
Script:
#!/bin/bash # Description: Verify consistent usage of add_implicit_resolver and add_path_resolver across loaders and dumpers. # Test: Ensure that the resolver functions are applied to all relevant loaders and dumpers. rg --type py -A 2 $'add_implicit_resolver' rg --type py -A 2 $'add_path_resolver'Length of output: 9166
Tools
Ruff
272-272:
Dumpermay be undefined, or defined from star imports(F405)
280-280:
loadermay be undefined, or defined from star imports(F405)
281-281:
loadermay be undefined, or defined from star imports(F405)
282-282:
loadermay be undefined, or defined from star imports(F405)
testing/originalnodep/yaml/representer.py (1)
274-283: Ensure complex number representation is correct.The
represent_complexmethod should ensure that the representation of complex numbers is consistent and accurate. Consider adding tests to verify this behavior.testing/prajintry/pacakges/yaml/representer.py (1)
274-283: Ensure complex number representation is correct.The
represent_complexmethod should ensure that the representation of complex numbers is consistent and accurate. Consider adding tests to verify this behavior.sebs/fission/fission.py (2)
59-72: LGTM!The
get_storagemethod correctly initializes Minio storage and handles configuration checks appropriately.
377-382: LGTM!The
cached_functionmethod correctly updates logging handlers for triggers and uses casting appropriately.testing/originalnodep/yaml/parser.py (3)
81-87: LGTM!The
__init__method correctly initializes the parser's state and attributes.
127-137: EnsureStreamStartEventis defined.Due to the use of star imports,
StreamStartEventmay be undefined. Ensure it is explicitly imported to avoid runtime errors.from .events import StreamStartEvent # Example import, adjust as neededTools
Ruff
131-131:
StreamStartEventmay be undefined, or defined from star imports(F405)
217-246: LGTM!The
process_directivesmethod correctly handles duplicate directives and incompatible versions.Tools
Ruff
220-220:
DirectiveTokenmay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/parser.py (3)
81-87: LGTM!The
__init__method correctly initializes the parser's state and attributes.
127-137: EnsureStreamStartEventis defined.Due to the use of star imports,
StreamStartEventmay be undefined. Ensure it is explicitly imported to avoid runtime errors.from .events import StreamStartEvent # Example import, adjust as neededTools
Ruff
131-131:
StreamStartEventmay be undefined, or defined from star imports(F405)
217-246: LGTM!The
process_directivesmethod correctly handles duplicate directives and incompatible versions.Tools
Ruff
220-220:
DirectiveTokenmay be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/emitter.py (30)
14-15:EmitterErrorclass definition is correct.The class is a simple subclass of
YAMLErrorand does not require any changes.
111-116:emitmethod logic is correct.The method correctly processes events using the state machine logic.
120-131:need_more_eventsmethod logic is correct.The method correctly determines if more events are needed. However, ensure event types are properly imported.
Tools
Ruff
124-124:
DocumentStartEventmay be undefined, or defined from star imports(F405)
126-126:
SequenceStartEventmay be undefined, or defined from star imports(F405)
128-128:
MappingStartEventmay be undefined, or defined from star imports(F405)
146-155:increase_indentmethod logic is correct.The method correctly adjusts indentation levels based on the flow and indentless parameters.
160-168:expect_stream_startmethod logic is correct.The method correctly handles the start of a YAML stream and raises an error if the event is not a
StreamStartEvent.Tools
Ruff
161-161:
StreamStartEventmay be undefined, or defined from star imports(F405)
178-212:expect_document_startmethod logic is correct.The method correctly manages the start of a YAML document, handling version and tag directives appropriately.
Tools
Ruff
179-179:
DocumentStartEventmay be undefined, or defined from star imports(F405)
204-204:
StreamEndEventmay be undefined, or defined from star imports(F405)
214-224:expect_document_endmethod logic is correct.The method correctly handles the end of a YAML document and raises an error if the event is not a
DocumentEndEvent.Tools
Ruff
215-215:
DocumentEndEventmay be undefined, or defined from star imports(F405)
232-258:expect_nodemethod logic is correct.The method correctly handles node events, determining the type of node and transitioning to the appropriate state.
Tools
Ruff
238-238:
AliasEventmay be undefined, or defined from star imports(F405)
240-240:
ScalarEventmay be undefined, or defined from star imports(F405)
240-240:
CollectionStartEventmay be undefined, or defined from star imports(F405)
243-243:
ScalarEventmay be undefined, or defined from star imports(F405)
245-245:
SequenceStartEventmay be undefined, or defined from star imports(F405)
251-251:
MappingStartEventmay be undefined, or defined from star imports(F405)
260-264:expect_aliasmethod logic is correct.The method correctly processes alias events and raises an error if no anchor is specified.
266-270:expect_scalarmethod logic is correct.The method correctly processes scalar events, managing indentation and style.
274-278:expect_flow_sequencemethod logic is correct.The method correctly handles the start of a flow sequence, managing indentation and state transitions.
292-306:expect_flow_sequence_itemmethod logic is correct.The method correctly handles items within a flow sequence, ensuring proper state transitions and formatting.
Tools
Ruff
293-293:
SequenceEndEventmay be undefined, or defined from star imports(F405)
310-314:expect_flow_mappingmethod logic is correct.The method correctly handles the start of a flow mapping, managing indentation and state transitions.
333-352:expect_flow_mapping_keymethod logic is correct.The method correctly handles keys within a flow mapping, ensuring proper state transitions and formatting.
Tools
Ruff
334-334:
MappingEndEventmay be undefined, or defined from star imports(F405)
359-364:expect_flow_mapping_valuemethod logic is correct.The method correctly handles values within a flow mapping, ensuring proper state transitions and formatting.
368-371:expect_block_sequencemethod logic is correct.The method correctly handles the start of a block sequence, managing indentation and state transitions.
376-384:expect_block_sequence_itemmethod logic is correct.The method correctly handles items within a block sequence, ensuring proper state transitions and formatting.
Tools
Ruff
377-377:
SequenceEndEventmay be undefined, or defined from star imports(F405)
388-390:expect_block_mappingmethod logic is correct.The method correctly handles the start of a block mapping, managing indentation and state transitions.
395-407:expect_block_mapping_keymethod logic is correct.The method correctly handles keys within a block mapping, ensuring proper state transitions and formatting.
Tools
Ruff
396-396:
MappingEndEventmay be undefined, or defined from star imports(F405)
414-418:expect_block_mapping_valuemethod logic is correct.The method correctly handles values within a block mapping, ensuring proper state transitions and formatting.
422-424:check_empty_sequencemethod logic is correct.The method correctly identifies empty sequences based on the event type.
Tools
Ruff
423-423:
SequenceStartEventmay be undefined, or defined from star imports(F405)
424-424:
SequenceEndEventmay be undefined, or defined from star imports(F405)
426-428:check_empty_mappingmethod logic is correct.The method correctly identifies empty mappings based on the event type.
Tools
Ruff
427-427:
MappingStartEventmay be undefined, or defined from star imports(F405)
428-428:
MappingEndEventmay be undefined, or defined from star imports(F405)
430-435:check_empty_documentmethod logic is correct.The method correctly identifies empty documents based on the event type and attributes.
Tools
Ruff
431-431:
DocumentStartEventmay be undefined, or defined from star imports(F405)
434-434:
ScalarEventmay be undefined, or defined from star imports(F405)
437-455:check_simple_keymethod logic is correct.The method correctly determines if an event can be a simple key based on its attributes.
Tools
Ruff
439-439:
NodeEventmay be undefined, or defined from star imports(F405)
443-443:
ScalarEventmay be undefined, or defined from star imports(F405)
443-443:
CollectionStartEventmay be undefined, or defined from star imports(F405)
448-448:
ScalarEventmay be undefined, or defined from star imports(F405)
452-452:
AliasEventmay be undefined, or defined from star imports(F405)
453-453:
ScalarEventmay be undefined, or defined from star imports(F405)
459-467:process_anchormethod logic is correct.The method correctly handles anchors, ensuring they are properly prepared and written.
469-491:process_tagmethod logic is correct.The method correctly handles tags, ensuring they are properly prepared and written.
Tools
Ruff
471-471:
ScalarEventmay be undefined, or defined from star imports(F405)
494-513:choose_scalar_stylemethod logic is correct.The method correctly determines the scalar style based on various conditions.
Tools
Ruff
499-503: Use a single
ifstatement instead of nestedifstatements(SIM102)
505-507: Use a single
ifstatement instead of nestedifstatements(SIM102)
509-511: Use a single
ifstatement instead of nestedifstatements(SIM102)
515-533:process_scalarmethod logic is correct.The method correctly handles scalar events, ensuring they are written with the appropriate style.
539-543:prepare_versionmethod logic is correct.The method correctly prepares the version directive and raises errors for unsupported versions.
545-555:prepare_tag_handlemethod logic is correct.The method correctly prepares tag handles, raising errors for invalid formats.
testing/originalnodep/yaml/scanner.py (30)
32-33:ScannerErrorclass definition is correct.The class is a simple subclass of
MarkedYAMLErrorand does not require any changes.
113-123:check_tokenmethod logic is correct.The method correctly checks if the next token is one of the given types, ensuring more tokens are fetched if needed.
125-133:peek_tokenmethod logic is correct.The method correctly returns the next token without removing it from the queue or
Noneif no tokens are available.
135-141:get_tokenmethod logic is correct.The method correctly returns and removes the next token from the queue, ensuring more tokens are fetched if needed.
145-154:need_more_tokensmethod logic is correct.The method correctly determines if more tokens are needed, considering the state of simple keys and the current token queue.
156-260:fetch_more_tokensmethod logic is correct.The method correctly fetches more tokens, handling different token types and adjusting state as needed.
279-293:stale_possible_simple_keysmethod logic is correct.The method correctly identifies and removes stale simple keys, raising errors if required keys are missing.
295-310:save_possible_simple_keymethod logic is correct.The method correctly saves the position of a possible simple key, ensuring it is allowed at the current position.
312-321:remove_possible_simple_keymethod logic is correct.The method correctly removes the saved possible key position and raises an error if the key was required.
325-347:unwind_indentmethod logic is correct.The method correctly manages indentation levels, issuing
BLOCK-ENDtokens as needed.Tools
Ruff
347-347:
BlockEndTokenmay be undefined, or defined from star imports(F405)
349-355:add_indentmethod logic is correct.The method correctly checks and updates indentation levels, returning a boolean to indicate changes.
359-368:fetch_stream_startmethod logic is correct.The method correctly adds a
STREAM-STARTtoken, ensuring proper initialization of the stream.Tools
Ruff
367-367:
StreamStartTokenmay be undefined, or defined from star imports(F405)
371-386:fetch_stream_endmethod logic is correct.The method correctly adds a
STREAM-ENDtoken, finalizing the stream processing.Tools
Ruff
385-385:
StreamEndTokenmay be undefined, or defined from star imports(F405)
390-400:fetch_directivemethod logic is correct.The method correctly processes directives, adding a
DIRECTIVEtoken and managing state.
402-403:fetch_document_startmethod logic is correct.The method correctly adds a
DOCUMENT-STARTtoken, ensuring proper document initialization.Tools
Ruff
403-403:
DocumentStartTokenmay be undefined, or defined from star imports(F405)
405-406:fetch_document_endmethod logic is correct.The method correctly adds a
DOCUMENT-ENDtoken, finalizing the document processing.Tools
Ruff
406-406:
DocumentEndTokenmay be undefined, or defined from star imports(F405)
424-425:fetch_flow_sequence_startmethod logic is correct.The method correctly adds a
FLOW-SEQUENCE-STARTtoken, ensuring proper sequence initialization.Tools
Ruff
425-425:
FlowSequenceStartTokenmay be undefined, or defined from star imports(F405)
427-428:fetch_flow_mapping_startmethod logic is correct.The method correctly adds a
FLOW-MAPPING-STARTtoken, ensuring proper mapping initialization.Tools
Ruff
428-428:
FlowMappingStartTokenmay be undefined, or defined from star imports(F405)
447-448:fetch_flow_sequence_endmethod logic is correct.The method correctly adds a
FLOW-SEQUENCE-ENDtoken, finalizing the sequence processing.Tools
Ruff
448-448:
FlowSequenceEndTokenmay be undefined, or defined from star imports(F405)
450-451:fetch_flow_mapping_endmethod logic is correct.The method correctly adds a
FLOW-MAPPING-ENDtoken, finalizing the mapping processing.Tools
Ruff
451-451:
FlowMappingEndTokenmay be undefined, or defined from star imports(F405)
470-482:fetch_flow_entrymethod logic is correct.The method correctly adds a
FLOW-ENTRYtoken, ensuring proper entry processing.Tools
Ruff
482-482:
FlowEntryTokenmay be undefined, or defined from star imports(F405)
484-515:fetch_block_entrymethod logic is correct.The method correctly adds a
BLOCK-ENTRYtoken, ensuring proper entry processing and state management.Tools
Ruff
498-498:
BlockSequenceStartTokenmay be undefined, or defined from star imports(F405)
515-515:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
517-543:fetch_keymethod logic is correct.The method correctly adds a
KEYtoken, ensuring proper key processing and state management.Tools
Ruff
531-531:
BlockMappingStartTokenmay be undefined, or defined from star imports(F405)
543-543:
KeyTokenmay be undefined, or defined from star imports(F405)
545-599:fetch_valuemethod logic is correct.The method correctly adds a
VALUEtoken, ensuring proper value processing and state management.Tools
Ruff
554-554:
KeyTokenmay be undefined, or defined from star imports(F405)
558-559: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
561-561:
BlockMappingStartTokenmay be undefined, or defined from star imports(F405)
572-576: Use a single
ifstatement instead of nestedifstatements(SIM102)
584-585: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
587-587:
BlockMappingStartTokenmay be undefined, or defined from star imports(F405)
599-599:
ValueTokenmay be undefined, or defined from star imports(F405)
601-610:fetch_aliasmethod logic is correct.The method correctly adds an
ALIAStoken, ensuring proper alias processing and state management.Tools
Ruff
610-610:
AliasTokenmay be undefined, or defined from star imports(F405)
612-621:fetch_anchormethod logic is correct.The method correctly adds an
ANCHORtoken, ensuring proper anchor processing and state management.Tools
Ruff
621-621:
AnchorTokenmay be undefined, or defined from star imports(F405)
623-632:fetch_tagmethod logic is correct.The method correctly adds a
TAGtoken, ensuring proper tag processing and state management.
634-636:fetch_literalmethod logic is correct.The method correctly adds a
SCALARtoken for literal scalars, ensuring proper processing and state management.
637-639:fetch_foldedmethod logic is correct.The method correctly adds a
SCALARtoken for folded scalars, ensuring proper processing and state management.
651-653:fetch_singlemethod logic is correct.The method correctly adds a
SCALARtoken for single-quoted scalars, ensuring proper processing and state management.testing/prajintry/pacakges/yaml/scanner.py (1)
48-110: Ensure efficient state management in initialization.The initialization of the
Scannerclass is comprehensive, but managing state variables likeflow_level,tokens, andpossible_simple_keyscan become complex. Ensure that these variables are consistently updated and used efficiently throughout the class.
| class Token(object): | ||
| def __init__(self, start_mark, end_mark): | ||
| self.start_mark = start_mark | ||
| self.end_mark = end_mark |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider removing wildcard imports.
Using wildcard imports (from .emitter import *) can lead to namespace pollution and make it difficult to identify where specific classes or functions are coming from. It is better to import only the necessary components explicitly.
| from .reader import * | ||
| from .scanner import * | ||
| from .parser import * | ||
| from .composer import * | ||
| from .constructor import * | ||
| from .resolver import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid wildcard imports for better clarity and maintainability.
Using from module import * makes it difficult to identify where specific classes or functions are defined, and can lead to unexpected behavior due to name clashes or undefined names. Consider importing only the necessary components explicitly.
-from .reader import *
-from .scanner import *
-from .parser import *
-from .composer import *
-from .constructor import *
-from .resolver import *
+from .reader import Reader
+from .scanner import Scanner
+from .parser import Parser
+from .composer import Composer
+from .constructor import BaseConstructor, FullConstructor, SafeConstructor, Constructor
+from .resolver import BaseResolver, ResolverCommittable suggestion was skipped due to low confidence.
Tools
Ruff
4-4:
from .reader import *used; unable to detect undefined names(F403)
5-5:
from .scanner import *used; unable to detect undefined names(F403)
6-6:
from .parser import *used; unable to detect undefined names(F403)
7-7:
from .composer import *used; unable to detect undefined names(F403)
8-8:
from .constructor import *used; unable to detect undefined names(F403)
9-9:
from .resolver import *used; unable to detect undefined names(F403)
| "access_key": "ioyzpSAmJWjpdgL_0f_HkKa-wIBfdiPrUyGaHDzk3dg", | ||
| "secret_key": "f68742dfcc91132ab01601271587736173a8df8daa6118c327bfdd28a1f181d3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security Issue: Hardcoded Access Key and Secret Key
Hardcoding sensitive information like access keys and secret keys is a security risk. Consider using environment variables or a secrets manager to store these values securely.
- "access_key": "ioyzpSAmJWjpdgL_0f_HkKa-wIBfdiPrUyGaHDzk3dg",
- "secret_key": "f68742dfcc91132ab01601271587736173a8df8daa6118c327bfdd28a1f181d3",
+ "access_key": "${FISSION_MINIO_ACCESS_KEY}",
+ "secret_key": "${FISSION_MINIO_SECRET_KEY}",- "access_key": "wfZoxJ4IJk3pO4XqPtNgPtnTGRbbQCZ-zEZjZ5SeQnQ",
- "secret_key": "34f2fea2f7a66645a12c15e0c4153d74fcb5b9b3945629e7b218e3ea4d03bd9b",
+ "access_key": "${FISSION_MINIO_ACCESS_KEY}",
+ "secret_key": "${FISSION_MINIO_SECRET_KEY}",Also applies to: 104-105
Tools
Gitleaks
83-83: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
84-84: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
| if "cold_start" in os.environ: | ||
| cold_start_var = os.environ["cold_start"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use capitalized environment variable COLD_START.
Environment variables are conventionally capitalized. Replace cold_start with COLD_START to follow this convention.
- if "cold_start" in os.environ:
- cold_start_var = os.environ["cold_start"]
+ if "COLD_START" in os.environ:
+ cold_start_var = os.environ["COLD_START"]Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if "cold_start" in os.environ: | |
| cold_start_var = os.environ["cold_start"] | |
| if "COLD_START" in os.environ: | |
| cold_start_var = os.environ["COLD_START"] |
Tools
Ruff
54-54: Use capitalized environment variable
COLD_STARTinstead ofcold_startReplace
cold_startwithCOLD_START(SIM112)
| from .emitter import * | ||
| from .serializer import * | ||
| from .representer import * | ||
| from .resolver import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using wildcard imports.
Wildcard imports can lead to namespace pollution and make it difficult to track where specific classes or functions are coming from. It is better to import only the necessary components explicitly.
Tools
Ruff
4-4:
from .emitter import *used; unable to detect undefined names(F403)
5-5:
from .serializer import *used; unable to detect undefined names(F403)
6-6:
from .representer import *used; unable to detect undefined names(F403)
7-7:
from .resolver import *used; unable to detect undefined names(F403)
| def check_event(self, *choices): | ||
| # Check the type of the next event. | ||
| if self.current_event is None: | ||
| if self.state: | ||
| self.current_event = self.state() | ||
| if self.current_event is not None: | ||
| if not choices: | ||
| return True | ||
| for choice in choices: | ||
| if isinstance(self.current_event, choice): | ||
| return True | ||
| return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine nested if statements for clarity.
The nested if statements can be combined using and for improved readability.
if self.current_event is None and self.state:
self.current_event = self.state()Tools
Ruff
96-97: Use a single
ifstatement instead of nestedifstatementsCombine
ifstatements usingand(SIM102)
| raise ParserError(None, None, | ||
| "expected '<document start>', but found %r" | ||
| % self.peek_token().id, | ||
| self.peek_token().start_mark) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use raise ... from e for exception chaining.
To preserve the original exception context, use raise ... from e when re-raising exceptions.
raise ParserError(None, None, "expected '<document start>', but found %r" % self.peek_token().id, self.peek_token().start_mark) from e| def parse_node(self, block=False, indentless_sequence=False): | ||
| if self.check_token(AliasToken): | ||
| token = self.get_token() | ||
| event = AliasEvent(token.value, token.start_mark, token.end_mark) | ||
| self.state = self.states.pop() | ||
| else: | ||
| anchor = None | ||
| tag = None | ||
| start_mark = end_mark = tag_mark = None | ||
| if self.check_token(AnchorToken): | ||
| token = self.get_token() | ||
| start_mark = token.start_mark | ||
| end_mark = token.end_mark | ||
| anchor = token.value | ||
| if self.check_token(TagToken): | ||
| token = self.get_token() | ||
| tag_mark = token.start_mark | ||
| end_mark = token.end_mark | ||
| tag = token.value | ||
| elif self.check_token(TagToken): | ||
| token = self.get_token() | ||
| start_mark = tag_mark = token.start_mark | ||
| end_mark = token.end_mark | ||
| tag = token.value | ||
| if self.check_token(AnchorToken): | ||
| token = self.get_token() | ||
| end_mark = token.end_mark | ||
| anchor = token.value | ||
| if tag is not None: | ||
| handle, suffix = tag | ||
| if handle is not None: | ||
| if handle not in self.tag_handles: | ||
| raise ParserError("while parsing a node", start_mark, | ||
| "found undefined tag handle %r" % handle, | ||
| tag_mark) | ||
| tag = self.tag_handles[handle]+suffix | ||
| else: | ||
| tag = suffix | ||
| #if tag == '!': | ||
| # raise ParserError("while parsing a node", start_mark, | ||
| # "found non-specific tag '!'", tag_mark, | ||
| # "Please check 'http://pyyaml.org/wiki/YAMLNonSpecificTag' and share your opinion.") | ||
| if start_mark is None: | ||
| start_mark = end_mark = self.peek_token().start_mark | ||
| event = None | ||
| implicit = (tag is None or tag == '!') | ||
| if indentless_sequence and self.check_token(BlockEntryToken): | ||
| end_mark = self.peek_token().end_mark | ||
| event = SequenceStartEvent(anchor, tag, implicit, | ||
| start_mark, end_mark) | ||
| self.state = self.parse_indentless_sequence_entry | ||
| else: | ||
| if self.check_token(ScalarToken): | ||
| token = self.get_token() | ||
| end_mark = token.end_mark | ||
| if (token.plain and tag is None) or tag == '!': | ||
| implicit = (True, False) | ||
| elif tag is None: | ||
| implicit = (False, True) | ||
| else: | ||
| implicit = (False, False) | ||
| event = ScalarEvent(anchor, tag, implicit, token.value, | ||
| start_mark, end_mark, style=token.style) | ||
| self.state = self.states.pop() | ||
| elif self.check_token(FlowSequenceStartToken): | ||
| end_mark = self.peek_token().end_mark | ||
| event = SequenceStartEvent(anchor, tag, implicit, | ||
| start_mark, end_mark, flow_style=True) | ||
| self.state = self.parse_flow_sequence_first_entry | ||
| elif self.check_token(FlowMappingStartToken): | ||
| end_mark = self.peek_token().end_mark | ||
| event = MappingStartEvent(anchor, tag, implicit, | ||
| start_mark, end_mark, flow_style=True) | ||
| self.state = self.parse_flow_mapping_first_key | ||
| elif block and self.check_token(BlockSequenceStartToken): | ||
| end_mark = self.peek_token().start_mark | ||
| event = SequenceStartEvent(anchor, tag, implicit, | ||
| start_mark, end_mark, flow_style=False) | ||
| self.state = self.parse_block_sequence_first_entry | ||
| elif block and self.check_token(BlockMappingStartToken): | ||
| end_mark = self.peek_token().start_mark | ||
| event = MappingStartEvent(anchor, tag, implicit, | ||
| start_mark, end_mark, flow_style=False) | ||
| self.state = self.parse_block_mapping_first_key | ||
| elif anchor is not None or tag is not None: | ||
| # Empty scalars are allowed even if a tag or an anchor is | ||
| # specified. | ||
| event = ScalarEvent(anchor, tag, (implicit, False), '', | ||
| start_mark, end_mark) | ||
| self.state = self.states.pop() | ||
| else: | ||
| if block: | ||
| node = 'block' | ||
| else: | ||
| node = 'flow' | ||
| token = self.peek_token() | ||
| raise ParserError("while parsing a %s node" % node, start_mark, | ||
| "expected the node content, but found %r" % token.id, | ||
| token.start_mark) | ||
| return event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine nested if statements for clarity.
The nested if statements can be combined using and for improved readability.
if block and self.check_token(BlockSequenceStartToken):
# existing logicTools
Ruff
274-274:
AliasTokenmay be undefined, or defined from star imports(F405)
276-276:
AliasEventmay be undefined, or defined from star imports(F405)
282-282:
AnchorTokenmay be undefined, or defined from star imports(F405)
287-287:
TagTokenmay be undefined, or defined from star imports(F405)
292-292:
TagTokenmay be undefined, or defined from star imports(F405)
297-297:
AnchorTokenmay be undefined, or defined from star imports(F405)
319-319:
BlockEntryTokenmay be undefined, or defined from star imports(F405)
321-321:
SequenceStartEventmay be undefined, or defined from star imports(F405)
325-325:
ScalarTokenmay be undefined, or defined from star imports(F405)
334-334:
ScalarEventmay be undefined, or defined from star imports(F405)
337-337:
FlowSequenceStartTokenmay be undefined, or defined from star imports(F405)
339-339:
SequenceStartEventmay be undefined, or defined from star imports(F405)
342-342:
FlowMappingStartTokenmay be undefined, or defined from star imports(F405)
344-344:
MappingStartEventmay be undefined, or defined from star imports(F405)
347-347:
BlockSequenceStartTokenmay be undefined, or defined from star imports(F405)
349-349:
SequenceStartEventmay be undefined, or defined from star imports(F405)
352-352:
BlockMappingStartTokenmay be undefined, or defined from star imports(F405)
354-354:
MappingStartEventmay be undefined, or defined from star imports(F405)
360-360:
ScalarEventmay be undefined, or defined from star imports(F405)
364-367: Use ternary operator
node = 'block' if block else 'flow'instead ofif-else-blockReplace
if-else-block withnode = 'block' if block else 'flow'(SIM108)
| def __init__(self, stream, canonical=None, indent=None, width=None, | ||
| allow_unicode=None, line_break=None): | ||
|
|
||
| # The stream should have the methods `write` and possibly `flush`. | ||
| self.stream = stream | ||
|
|
||
| # Encoding can be overridden by STREAM-START. | ||
| self.encoding = None | ||
|
|
||
| # Emitter is a state machine with a stack of states to handle nested | ||
| # structures. | ||
| self.states = [] | ||
| self.state = self.expect_stream_start | ||
|
|
||
| # Current event and the event queue. | ||
| self.events = [] | ||
| self.event = None | ||
|
|
||
| # The current indentation level and the stack of previous indents. | ||
| self.indents = [] | ||
| self.indent = None | ||
|
|
||
| # Flow level. | ||
| self.flow_level = 0 | ||
|
|
||
| # Contexts. | ||
| self.root_context = False | ||
| self.sequence_context = False | ||
| self.mapping_context = False | ||
| self.simple_key_context = False | ||
|
|
||
| # Characteristics of the last emitted character: | ||
| # - current position. | ||
| # - is it a whitespace? | ||
| # - is it an indention character | ||
| # (indentation space, '-', '?', or ':')? | ||
| self.line = 0 | ||
| self.column = 0 | ||
| self.whitespace = True | ||
| self.indention = True | ||
|
|
||
| # Whether the document requires an explicit document indicator | ||
| self.open_ended = False | ||
|
|
||
| # Formatting details. | ||
| self.canonical = canonical | ||
| self.allow_unicode = allow_unicode | ||
| self.best_indent = 2 | ||
| if indent and 1 < indent < 10: | ||
| self.best_indent = indent | ||
| self.best_width = 80 | ||
| if width and width > self.best_indent*2: | ||
| self.best_width = width | ||
| self.best_line_break = '\n' | ||
| if line_break in ['\r', '\n', '\r\n']: | ||
| self.best_line_break = line_break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using star imports.
The use of from .events import * can lead to undefined names and makes it difficult to track dependencies. Consider importing specific classes or functions instead.
- from .events import *
+ from .events import DocumentStartEvent, SequenceStartEvent, MappingStartEvent, ...Committable suggestion was skipped due to low confidence.
| def __init__(self): | ||
| """Initialize the scanner.""" | ||
| # It is assumed that Scanner and Reader will have a common descendant. | ||
| # Reader do the dirty work of checking for BOM and converting the | ||
| # input data to Unicode. It also adds NUL to the end. | ||
| # | ||
| # Reader supports the following methods | ||
| # self.peek(i=0) # peek the next i-th character | ||
| # self.prefix(l=1) # peek the next l characters | ||
| # self.forward(l=1) # read the next l characters and move the pointer. | ||
|
|
||
| # Had we reached the end of the stream? | ||
| self.done = False | ||
|
|
||
| # The number of unclosed '{' and '['. `flow_level == 0` means block | ||
| # context. | ||
| self.flow_level = 0 | ||
|
|
||
| # List of processed tokens that are not yet emitted. | ||
| self.tokens = [] | ||
|
|
||
| # Add the STREAM-START token. | ||
| self.fetch_stream_start() | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using star imports.
The use of from .tokens import * can lead to undefined names and makes it difficult to track dependencies. Consider importing specific classes or functions instead.
- from .tokens import *
+ from .tokens import StreamStartToken, StreamEndToken, DocumentStartToken, ...Committable suggestion was skipped due to low confidence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
Outside diff range, codebase verification and nitpick comments (1)
tools/build_docker_images.py (1)
108-108: Consider removing debugging print statement.The print statement "First if" seems intended for debugging and should be removed if not necessary for production.
- print("First if ")
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- sebs/fission/fission.py (1 hunks)
- sebs/fission/triggers.py (1 hunks)
- tools/build_docker_images.py (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- sebs/fission/triggers.py
Additional context used
Ruff
tools/build_docker_images.py
21-21: Use context handler for opening files
(SIM115)
sebs/fission/fission.py
3-3:
reimported but unusedRemove unused import:
re(F401)
9-9:
jsonimported but unusedRemove unused import:
json(F401)
10-10:
time.sleepimported but unusedRemove unused import:
time.sleep(F401)
11-11: Redefinition of unused
Dictfrom line 6Remove definition:
Dict(F811)
11-11: Redefinition of unused
Tuplefrom line 6Remove definition:
Tuple(F811)
11-11: Redefinition of unused
Listfrom line 6Remove definition:
List(F811)
18-18:
sebs.utils.DOCKER_DIRimported but unusedRemove unused import:
sebs.utils.DOCKER_DIR(F401)
52-52: Do not use mutable data structures for argument defaults
Replace with
None; initialize within function(B006)
205-205: f-string without any placeholders
Remove extraneous
fprefix(F541)
210-210: f-string without any placeholders
Remove extraneous
fprefix(F541)
273-273: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
279-279: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
302-302: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
307-307: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
355-355: f-string without any placeholders
Remove extraneous
fprefix(F541)
Additional comments not posted (7)
tools/build_docker_images.py (3)
13-13: Addition of "fission" to deployment options is appropriate.The inclusion of "fission" as a deployment choice aligns with the PR's objective to enhance Fission support.
18-18: Addition of--runtimeargument is logical.The new
--runtimeargument enhances the script's functionality by allowing users to specify the building of runtime images.
31-31: Improved message clarity is beneficial.The change to explicitly print the message enhances clarity without affecting the logic.
sebs/fission/fission.py (4)
52-54: Initialization method looks good.The
initializemethod correctly sets up resources with an optional prefix.Tools
Ruff
52-52: Do not use mutable data structures for argument defaults
Replace with
None; initialize within function(B006)
59-72: Storage initialization is handled correctly.The
get_storagemethod properly initializes storage and checks for configuration.
74-82: Shutdown method is implemented correctly.The
shutdownmethod appropriately handles stopping storage and deleting the cluster if configured.
378-383: Cached function handling looks good.The
cached_functionmethod correctly sets logging handlers for triggers.
| import re | ||
| import shutil | ||
| import subprocess | ||
| from typing import cast, Dict, List, Optional, Tuple, Type | ||
|
|
||
| import docker | ||
| import json | ||
| from time import sleep | ||
| from typing import Dict, Tuple, List |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused imports.
The following imports are unused and should be removed to clean up the code:
rejsontime.sleepDict,Tuple,List(redefined)sebs.utils.DOCKER_DIR
- import re
- import json
- from time import sleep
- from typing import Dict, Tuple, List
- from sebs.utils import DOCKER_DIRAlso applies to: 18-18
Tools
Ruff
3-3:
reimported but unusedRemove unused import:
re(F401)
9-9:
jsonimported but unusedRemove unused import:
json(F401)
10-10:
time.sleepimported but unusedRemove unused import:
time.sleep(F401)
11-11: Redefinition of unused
Dictfrom line 6Remove definition:
Dict(F811)
11-11: Redefinition of unused
Tuplefrom line 6Remove definition:
Tuple(F811)
11-11: Redefinition of unused
Listfrom line 6Remove definition:
List(F811)
| def __init__( | ||
| self, | ||
| system_config: SeBSConfig, | ||
| config: FissionConfig, | ||
| cache_client: Cache, | ||
| docker_client: docker.client, | ||
| logger_handlers: LoggingHandlers, | ||
| ): | ||
| super().__init__(system_config, cache_client, docker_client) | ||
| self._config = config | ||
| self.logging_handlers = logger_handlers | ||
|
|
||
| if self.config.resources.docker_username: | ||
| if self.config.resources.docker_registry: | ||
| docker_client.login( | ||
| username=self.config.resources.docker_username, | ||
| password=self.config.resources.docker_password, | ||
| registry=self.config.resources.docker_registry, | ||
| ) | ||
| else: | ||
| docker_client.login( | ||
| username=self.config.resources.docker_username, | ||
| password=self.config.resources.docker_password, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for Docker login.
Consider adding error handling for the Docker login process to manage potential exceptions, such as docker.errors.APIError.
try:
docker_client.login(
username=self.config.resources.docker_username,
password=self.config.resources.docker_password,
registry=self.config.resources.docker_registry or None,
)
except docker.errors.APIError as e:
self.logging.error(f"Docker login failed: {e}")
raise| def find_image(self, repository_name, image_tag) -> bool: | ||
|
|
||
| if self.config.experimentalManifest: | ||
| try: | ||
| # This requires enabling experimental Docker features | ||
| # Furthermore, it's not yet supported in the Python library | ||
| execute(f"docker manifest inspect {repository_name}:{image_tag}") | ||
| return True | ||
| except RuntimeError: | ||
| return False | ||
| else: | ||
| try: | ||
| # default version requires pulling for an image | ||
| self.docker_client.images.pull(repository=repository_name, tag=image_tag) | ||
| return True | ||
| except docker.errors.NotFound: | ||
| return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding error handling for Docker image operations.
The find_image method could benefit from additional error handling to manage potential exceptions during Docker operations.
try:
if self.config.experimentalManifest:
execute(f"docker manifest inspect {repository_name}:{image_tag}")
else:
self.docker_client.images.pull(repository=repository_name, tag=image_tag)
return True
except (RuntimeError, docker.errors.NotFound) as e:
self.logging.error(f"Error finding image: {e}")
return False| def package_code( | ||
| self, | ||
| directory: str, | ||
| language_name: str, | ||
| language_version: str, | ||
| benchmark: str, | ||
| is_cached: bool, | ||
| ) -> Tuple[str, int]: | ||
|
|
||
| # Use this when wokring for container deployment supports. | ||
| # self.build_base_image(directory, language_name, language_version, benchmark, is_cached) | ||
|
|
||
| repo_name = self.system_config.docker_repository() | ||
|
|
||
| enviroment_name = language_name + language_version.replace(".","") | ||
| builder_image = self.system_config.benchmark_base_images(self.name(), language_name)[ | ||
| language_version | ||
| ] | ||
|
|
||
| runtime_image = "runtime.{deployment}.{language}.{runtime}".format( | ||
| deployment="fission", | ||
| language=language_name, | ||
| runtime=language_version, | ||
| ) | ||
|
|
||
| runtime_image = repo_name + ":" + runtime_image | ||
|
|
||
| storage_args = self.storage_arguments() | ||
| self.config.resources.create_enviroment(name = enviroment_name, image = runtime_image, builder = builder_image, runtime_env = storage_args) | ||
|
|
||
|
|
||
| CONFIG_FILES = { | ||
| "python": ["handler.py", "requirements.txt", ".python_packages"], | ||
| "nodejs": ["handler.js", "package.json", "node_modules"], | ||
| } | ||
| package_config = CONFIG_FILES[language_name] | ||
|
|
||
| function_dir = os.path.join(directory, "function") | ||
| os.makedirs(function_dir) | ||
| for file in os.listdir(directory): | ||
| if file not in package_config: | ||
| file = os.path.join(directory, file) | ||
| shutil.move(file, function_dir) | ||
|
|
||
|
|
||
| # FIXME: use zipfile | ||
| # create zip with hidden directory but without parent directory | ||
| execute("rm requirements.txt", shell=True, cwd=directory) | ||
| execute("zip -qu -r9 {}.zip * .".format(benchmark), shell=True, cwd=directory) | ||
| benchmark_archive = "{}.zip".format(os.path.join(directory, benchmark)) | ||
| self.logging.info("Created {} archive".format(benchmark_archive)) | ||
|
|
||
| bytes_size = os.path.getsize(os.path.join(function_dir, benchmark_archive)) | ||
| mbytes = bytes_size / 1024.0 / 1024.0 | ||
| self.logging.info("Zip archive size {:2f} MB".format(mbytes)) | ||
|
|
||
| package_name = benchmark + "-" + language_name + "-" + language_version | ||
| package_name = package_name.replace(".","") | ||
| self.config.resources.create_package(package_name = package_name, path = benchmark_archive, env_name = enviroment_name) | ||
|
|
||
| return benchmark_archive, bytes_size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Python's zipfile module instead of shell commands.
The zipfile module in Python can replace shell commands for creating zip archives, improving portability and error handling.
import zipfile
with zipfile.ZipFile(f"{benchmark}.zip", 'w', zipfile.ZIP_DEFLATED) as zipf:
for root, _, files in os.walk(directory):
for file in files:
zipf.write(os.path.join(root, file), arcname=os.path.relpath(os.path.join(root, file), directory))| def create_function(self, code_package: Benchmark, func_name: str) -> "FissionFunction": | ||
| package_name = func_name.replace(".", "") | ||
| func_name = func_name.replace(".", "") | ||
| logging.info(f"Deploying fission function...") | ||
| function_cfg = FissionFunctionConfig.from_benchmark(code_package) | ||
| function_cfg.storage = cast(Minio, self.get_storage()).config | ||
| try: | ||
| triggers = subprocess.run( | ||
| f"fission fn list".split(), stdout=subprocess.PIPE, check=True | ||
| ) | ||
| subprocess.run( | ||
| f"grep {func_name}".split(), | ||
| check=True, | ||
| input=triggers.stdout, | ||
| stdout=subprocess.DEVNULL, | ||
| ) | ||
| res = FissionFunction( | ||
| func_name, code_package.benchmark, code_package.hash, | ||
| function_cfg | ||
| ) | ||
| logging.info(f"Function {func_name} already exist") | ||
| logging.info(f"Retrieved existing Fission function {func_name}.") | ||
| self.update_function(res, code_package) | ||
| except subprocess.CalledProcessError: | ||
| subprocess.run( | ||
| [ | ||
| *self.get_fission_cmd(), | ||
| "fn", | ||
| "create", | ||
| "--name", | ||
| func_name, | ||
| "--pkg", | ||
| package_name, | ||
| "--ft", | ||
| str(code_package.benchmark_config.timeout * 1000), | ||
| "--maxmemory", | ||
| str(code_package.benchmark_config.memory), | ||
| "--entrypoint", | ||
| "handler.handler", | ||
| ], | ||
| stderr=subprocess.PIPE, | ||
| stdout=subprocess.PIPE, | ||
| check=True, | ||
| ) | ||
| res = FissionFunction( | ||
| func_name, code_package.benchmark, code_package.hash, function_cfg | ||
| ) | ||
| return res |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for subprocess calls.
Consider adding error handling for subprocess calls to manage potential exceptions and improve robustness.
try:
triggers = subprocess.run(
"fission fn list".split(), stdout=subprocess.PIPE, check=True
)
subprocess.run(
f"grep {func_name}".split(),
check=True,
input=triggers.stdout,
stdout=subprocess.DEVNULL,
)
res = FissionFunction(
func_name, code_package.benchmark, code_package.hash,
function_cfg
)
logging.info(f"Function {func_name} already exist")
logging.info(f"Retrieved existing Fission function {func_name}.")
self.update_function(res, code_package)
except subprocess.CalledProcessError:
subprocess.run(
[
*self.get_fission_cmd(),
"fn",
"create",
"--name",
func_name,
"--pkg",
package_name,
"--ft",
str(code_package.benchmark_config.timeout * 1000),
"--maxmemory",
str(code_package.benchmark_config.memory),
"--entrypoint",
"handler.handler",
],
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
check=True,
)
res = FissionFunction(
func_name, code_package.benchmark, code_package.hash, function_cfg
)
return resTools
Ruff
205-205: f-string without any placeholders
Remove extraneous
fprefix(F541)
210-210: f-string without any placeholders
Remove extraneous
fprefix(F541)
| def update_function(self, function: Function, code_package: Benchmark): | ||
| self.logging.info(f"Update an existing Fission action {function.name}.") | ||
| function = cast(FissionFunction, function) | ||
| try: | ||
| subprocess.run( | ||
| [ | ||
| *self.get_fission_cmd(), | ||
| "fn", | ||
| "update", | ||
| "--name", | ||
| function.name, | ||
| "--src", | ||
| code_package.code_location, | ||
| "--ft", | ||
| str(code_package.benchmark_config.timeout * 1000), | ||
| "--maxmemory", | ||
| str(code_package.benchmark_config.memory), | ||
| "--force" | ||
| ] | ||
| ) | ||
| except FileNotFoundError as e: | ||
| self.logging.error("Could not update Fission function - is path to fission correct?") | ||
| raise RuntimeError(e) | ||
|
|
||
| except subprocess.CalledProcessError as e: | ||
| self.logging.error(f"Unknown error when running function update: {e}!") | ||
| self.logging.error("Make sure to remove SeBS cache after restarting Fission!") | ||
| self.logging.error(f"Output: {e.stderr.decode('utf-8')}") | ||
| raise RuntimeError(e) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for subprocess calls.
Consider adding error handling for subprocess calls to manage potential exceptions and improve robustness.
try:
subprocess.run(
[
*self.get_fission_cmd(),
"fn",
"update",
"--name",
function.name,
"--src",
code_package.code_location,
"--ft",
str(code_package.benchmark_config.timeout * 1000),
"--maxmemory",
str(code_package.benchmark_config.memory),
"--force"
],
check=True
)
except FileNotFoundError as e:
self.logging.error("Could not update Fission function - is path to fission correct?")
raise RuntimeError(e) from e
except subprocess.CalledProcessError as e:
self.logging.error(f"Unknown error when running function update: {e}!")
self.logging.error("Make sure to remove SeBS cache after restarting Fission!")
self.logging.error(f"Output: {e.stderr.decode('utf-8')}")
raise RuntimeError(e) from eTools
Ruff
273-273: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
279-279: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
| def update_function_configuration(self, function: Function, code_package: Benchmark): | ||
| self.logging.info(f"Update configuration of an existing Fission action {function.name}.") | ||
| try: | ||
| subprocess.run( | ||
| [ | ||
| *self.get_fission_cmd(), | ||
| "fn", | ||
| "update", | ||
| "--name", | ||
| function.name, | ||
| "--maxmemory", | ||
| str(code_package.benchmark_config.memory), | ||
| "--ft", | ||
| str(code_package.benchmark_config.timeout * 1000), | ||
| ], | ||
| stderr=subprocess.PIPE, | ||
| stdout=subprocess.PIPE, | ||
| check=True, | ||
| ) | ||
| except FileNotFoundError as e: | ||
| self.logging.error("Could not update Fission function - is path to fission correct?") | ||
| raise RuntimeError(e) | ||
| except subprocess.CalledProcessError as e: | ||
| self.logging.error(f"Unknown error when running function update: {e}!") | ||
| self.logging.error("Make sure to remove SeBS cache after restarting Fisiion!") | ||
| self.logging.error(f"Output: {e.stderr.decode('utf-8')}") | ||
| raise RuntimeError(e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for subprocess calls.
Consider adding error handling for subprocess calls to manage potential exceptions and improve robustness.
try:
subprocess.run(
[
*self.get_fission_cmd(),
"fn",
"update",
"--name",
function.name,
"--maxmemory",
str(code_package.benchmark_config.memory),
"--ft",
str(code_package.benchmark_config.timeout * 1000),
],
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
check=True,
)
except FileNotFoundError as e:
self.logging.error("Could not update Fission function - is path to fission correct?")
raise RuntimeError(e) from e
except subprocess.CalledProcessError as e:
self.logging.error(f"Unknown error when running function update: {e}!")
self.logging.error("Make sure to remove SeBS cache after restarting Fission!")
self.logging.error(f"Output: {e.stderr.decode('utf-8')}")
raise RuntimeError(e) from eTools
Ruff
302-302: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
307-307: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
| def create_trigger(self, function: Function, trigger_type: Trigger.TriggerType) -> Trigger: | ||
| triggerName = function.name + "trigger" | ||
| triggerName = triggerName.replace("_", "") | ||
| triggerName = triggerName.replace("-", "") | ||
| postUrl = triggerName | ||
| if trigger_type == Trigger.TriggerType.LIBRARY: | ||
| self.logging.info("Library trigger is not supported in Fission as of now.") | ||
| return function.triggers(Trigger.TriggerType.LIBRARY)[0] | ||
| elif trigger_type == Trigger.TriggerType.HTTP: | ||
| try: | ||
| triggers = subprocess.run( | ||
| f"fission httptrigger list".split(), stdout=subprocess.PIPE, check=True | ||
| ) | ||
| subprocess.run( | ||
| f"grep {triggerName}".split(), | ||
| check=True, | ||
| input=triggers.stdout, | ||
| stdout=subprocess.DEVNULL,) | ||
| logging.info(f"Trigger {triggerName} already exist") | ||
| except subprocess.CalledProcessError: | ||
| subprocess.run( | ||
| f"fission httptrigger create --method POST --url /{postUrl} --function {function.name} --name {triggerName}".split(), | ||
| check=True, | ||
| ) | ||
| # PK: do not encode url , get this from config specified by User. The defualt in config will be localhost and 31314 | ||
| url = "http://localhost:31314" + "/" + postUrl | ||
| trigger = HTTPTrigger(function.name, url) | ||
| trigger.logging_handlers = self.logging_handlers | ||
| function.add_trigger(trigger) | ||
| self.cache_client.update_function(function) | ||
| return trigger | ||
| else: | ||
| raise RuntimeError("Not supported!") | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling and remove extraneous f-string prefix.
The create_trigger method should include error handling for subprocess calls. Additionally, remove the extraneous f-string prefix.
try:
triggers = subprocess.run(
"fission httptrigger list".split(), stdout=subprocess.PIPE, check=True
)
subprocess.run(
f"grep {triggerName}".split(),
check=True,
input=triggers.stdout,
stdout=subprocess.DEVNULL,
)
logging.info(f"Trigger {triggerName} already exist")
except subprocess.CalledProcessError:
subprocess.run(
"fission httptrigger create --method POST --url /{postUrl} --function {function.name} --name {triggerName}".split(),
check=True,
)
# PK: do not encode url , get this from config specified by User. The defualt in config will be localhost and 31314
url = "http://localhost:31314" + "/" + postUrl
trigger = HTTPTrigger(function.name, url)
trigger.logging_handlers = self.logging_handlers
function.add_trigger(trigger)
self.cache_client.update_function(function)
return triggerTools
Ruff
355-355: f-string without any placeholders
Remove extraneous
fprefix(F541)
| class minio_storage { | ||
|
|
||
| constructor() { | ||
| let minioConfig = JSON.parse(fs.readFileSync('minioConfig.json')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason why we are using a file here and not envs, like in Python?
| def main(args): | ||
| logging.getLogger().setLevel(logging.INFO) | ||
| begin = datetime.datetime.now() | ||
| args['request-id'] = os.getenv('__OW_ACTIVATION_ID') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test this? This looks like a copy-paste from OpenWhisk
| total=5, backoff_factor=0.2, status_forcelist=[500, 502, 503, 504] | ||
| ) | ||
| ) | ||
| print("WE get from os") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary
|
|
||
|
|
||
|
|
||
| # import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
| "access_key": "", | ||
| "secret_key": "", | ||
| "instance_id": "", | ||
| "address": "localhost:9011", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove it
| data = BytesIO() | ||
| c.setopt(pycurl.WRITEFUNCTION, data.write) | ||
|
|
||
| print("the payload is", payload) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
| packages = subprocess.run( | ||
| "fission package list".split(), stdout=subprocess.PIPE, check=True | ||
| ) | ||
| subprocess.run( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can replace grep (expensive OS call) with parsing the output in Python
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also use our subprocess wrapper from sebs/utils.py
| --name {package_name} --env {env_name}" | ||
| subprocess.run(process.split(), check=True) | ||
| # logging.info("Waiting for package build...") | ||
| print("Waiting for package build...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why print instead of logging wrappers?
| def create_enviroment(self, name: str, image: str, builder: str, runtime_env: List[str] = []): | ||
| print("Add logic to create the enviroment") | ||
| # Here we need to create enviroment if it does not exist else get it from the cache | ||
| # PK: ADD Caching mechasim here so that not to create enviroment every time or query the enviroment everytime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, environments should go to FissionResources - just keep a list
| super().__init__(name="fission") | ||
| self._credentials = FissionCredentials() | ||
| self._resources = FissionResources() | ||
| self.shutdownStorage = config["shutdownStorage"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove shutdown storage and remove cluster - those options are no longer needed and we don't have to support them
All informations about implemented features and state of benchmark are included in readme.md file.
Summary by CodeRabbit
New Features
Bug Fixes
Enhancements
Chores
.gitignoreto exclude.vscodedirectory.