-
Notifications
You must be signed in to change notification settings - Fork 68
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
Fission benchmark #56
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
serialize
method insebs/fission/config.py
returns an empty dictionary. This is inconsistent with otherserialize
methods in the codebase that return more detailed dictionaries. If additional attributes are added toFissionCredentials
in 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
serialize
method returns an empty dictionary. If additional attributes are added toFissionCredentials
in 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
serialize
method.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:
minio
imported but unusedRemove unused import:
minio
(F401)
benchmarks/wrappers/fission/python/storage.py
3-3:
json
imported but unusedRemove unused import:
json
(F401)
tools/fission_preparation.py
25-25: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
135-135: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
sebs/fission/minio.py
148-148: Loop control variable
i
not used within loop bodyRename unused
i
to_i
(B007)
150-150: Loop control variable
i
not used within loop bodyRename unused
i
to_i
(B007)
sebs/fission/config.py
146-146: f-string without any placeholders
Remove extraneous
f
prefix(F541)
172-172: f-string without any placeholders
Remove extraneous
f
prefix(F541)
182-182: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
sebs/fission/fission.py
8-8:
json
imported but unusedRemove unused import:
json
(F401)
9-9:
time.sleep
imported but unusedRemove unused import:
time.sleep
(F401)
10-10: Redefinition of unused
Dict
from line 5Remove definition:
Dict
(F811)
10-10: Redefinition of unused
Tuple
from line 5Remove definition:
Tuple
(F811)
10-10: Redefinition of unused
List
from line 5Remove definition:
List
(F811)
24-24:
tools.fission_preparation.check_if_minikube_installed
imported but unusedRemove unused import
(F401)
25-25:
tools.fission_preparation.run_minikube
imported but unusedRemove unused import
(F401)
26-26:
tools.fission_preparation.check_if_k8s_installed
imported but unusedRemove unused import
(F401)
27-27:
tools.fission_preparation.check_if_helm_installed
imported but unusedRemove unused import
(F401)
28-28:
tools.fission_preparation.stop_minikube
imported 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_config
is assigned to but never usedRemove assignment to unused variable
package_config
(F841)
348-348: f-string without any placeholders
Remove extraneous
f
prefix(F541)
355-355: f-string without any placeholders
Remove extraneous
f
prefix(F541)
546-546: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
551-551: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
575-575: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
580-580: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
656-656: f-string without any placeholders
Remove extraneous
f
prefix(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_IMAGE
and${VERSION}
are provided during the build process.sebs/fission/storage.py (3)
9-12
: LGTM!The
deployment_name
method correctly returns the deployment name.
14-21
: LGTM!The constructor correctly initializes the
Minio
class with the provided parameters.
23-27
: LGTM!The
deserialize
method 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
handler
function.
15-15
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
handler
match the new usage ofrequest.get_json(force=True)
.Verification successful
Verification successful: All function calls to
handler
match the new usage ofrequest.get_json(force=True)
.The
handler
function inbenchmarks/100.webapps/110.dynamic-html/python/function.py
correctly usesrequest.get_json(force=True)
as expected.
benchmarks/100.webapps/110.dynamic-html/python/function.py
: Verified usage ofrequest.get_json(force=True)
in thehandler
function.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
fission
choice to the--deployment
argument is correctly formatted.
53-53
: LGTM!The addition of the print statement before the
client.images.build
call is helpful for debugging.sebs/fission/triggers.py (11)
11-15
: LGTM!The
__init__
method is correctly implemented.
17-19
: LGTM!The
trigger_type
method is correctly implemented.
21-24
: LGTM!The
fission_cmd
property is correctly implemented.
26-28
: LGTM!The
fission_cmd
setter is correctly implemented.
31-37
: LGTM!The
get_command
method is correctly implemented.
66-69
: LGTM!The
async_invoke
method is correctly implemented.
84-87
: LGTM!The
__init__
method is correctly implemented.
90-91
: LGTM!The
typename
method is correctly implemented.
94-95
: LGTM!The
trigger_type
method is correctly implemented.
97-99
: LGTM!The
sync_invoke
method is correctly implemented.
101-104
: LGTM!The
async_invoke
method 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_FISSION
is correctly set in theactivate
script and unset in thedeactivate
script. 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.py
install.py
tools/fission_preparation.py
tools/build_docker_images.py
sebs/sebs.py
sebs/benchmark.py
sebs/fission/*
sebs/faas/config.py
Scripts 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
storage
and its methods are implemented correctly.However, ensure that the class is used correctly throughout the codebase.
Verification successful
The usage of the
storage
class is correct throughout the codebase.The class
storage
and its methods are implemented and used correctly in various contexts across the codebase.
sebs.py
install.py
tools/openwhisk_preparation.py
tests/aws/invoke_function_sdk.py
tests/aws/invoke_function_http.py
tests/aws/create_function.py
sebs/sebs.py
sebs/fission/storage.py
sebs/fission/minio.py
sebs/fission/function.py
sebs/fission/fission.py
sebs/fission/config.py
sebs/benchmark.py
sebs/types.py
sebs/storage/minio.py
sebs/openwhisk/storage.py
sebs/openwhisk/openwhisk.py
sebs/openwhisk/function.py
sebs/openwhisk/config.py
sebs/local/local.py
sebs/local/storage.py
sebs/local/deployment.py
sebs/local/config.py
sebs/gcp/storage.py
sebs/gcp/gcp.py
sebs/gcp/function.py
sebs/gcp/config.py
sebs/faas/system.py
sebs/faas/config.py
sebs/faas/storage.py
sebs/experiments/perf_cost.py
sebs/experiments/network_ping_pong.py
sebs/experiments/invocation_overhead.py
sebs/experiments/config.py
sebs/azure/azure.py
sebs/azure/config.py
sebs/azure/blob_storage.py
sebs/aws/aws.py
sebs/aws/s3.py
sebs/aws/function.py
scripts/cloud_results.py
scripts/run_experiments.py
dockerfiles/local/runner.py
benchmarks/400.inference/411.image-recognition/input.py
benchmarks/500.scientific/504.dna-visualisation/python/function.py
benchmarks/400.inference/411.image-recognition/python/function.py
benchmarks/wrappers/fission/python/storage.py
benchmarks/wrappers/openwhisk/python/storage.py
benchmarks/wrappers/azure/python/storage.py
benchmarks/wrappers/aws/python/handler.py
benchmarks/wrappers/local/python/storage.py
benchmarks/300.utilities/311.compression/input.py
benchmarks/300.utilities/311.compression/python/function.py
benchmarks/wrappers/aws/python/storage.py
benchmarks/wrappers/azure/python/handler.py
benchmarks/wrappers/gcp/python/handler.py
benchmarks/wrappers/gcp/python/storage.py
benchmarks/000.microbenchmarks/020.network-benchmark/python/function.py
benchmarks/200.multimedia/220.video-processing/input.py
benchmarks/000.microbenchmarks/030.clock-synchronization/python/function.py
benchmarks/200.multimedia/220.video-processing/python/function.py
benchmarks/200.multimedia/210.thumbnailer/input.py
benchmarks/100.webapps/120.uploader/python/function.py
benchmarks/200.multimedia/210.thumbnailer/python/function.py
Scripts 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 thetypename
method is consistent with class name.The
typename
method returns a string representing the class type. Ensure this is consistent with the class name to avoid confusion.Verification successful
The
typename
method insebs/fission/config.py
is consistent with the class name.The
typename
method 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_params
function 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 setup
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.
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 Fission
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.
# 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
i
not used within loop bodyRename unused
i
to_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
i
not used within loop bodyRename unused
i
to_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 checking
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.
- 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
: Addstacklevel
to the warning.Adding a
stacklevel
argument to thewarnings.warn
call 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
stacklevel
keyword argument found(B028)
testing/prajintry/pacakges/_yaml/__init__.py (1)
18-24
: Addstacklevel
to the warning.Adding a
stacklevel
argument to thewarnings.warn
call 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
stacklevel
keyword argument found(B028)
testing/prajintry/pacakges/yaml/nodes.py (1)
8-23
: Remove commented-out code.The commented-out code in the
__repr__
method ofNode
is 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 inbuild
function.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_name
method.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 inReaderError
is 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
if
statement instead of nestedif
statements 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
if
statement instead of nestedif
statements(SIM102)
testing/prajintry/pacakges/yaml/__init__.py (2)
157-206
: Consider using a ternary operator for stream initialization.In the
emit
,serialize_all
, andserialize
functions, consider using a ternary operator for initializing thestream
variable 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:
Dumper
may be undefined, or defined from star imports(F405)
178-178:
Dumper
may 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
YAMLObjectMetaclass
andYAMLObject
classes 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:
Loader
may be undefined, or defined from star imports(F405)
370-370:
FullLoader
may be undefined, or defined from star imports(F405)
370-370:
UnsafeLoader
may be undefined, or defined from star imports(F405)
371-371:
Dumper
may 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-else
block for assigningvalue
can 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-else
block for assigningvalue
can 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
: ExpandScannerError
for more specific error handling.The
ScannerError
class 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
ScannerError
could 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.zip
is excluded by!**/*.zip
testing/original/original.zip
is excluded by!**/*.zip
testing/originalnodep/trying.zip
is excluded by!**/*.zip
testing/prajintry/trying.zip
is 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
stacklevel
keyword 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
stacklevel
keyword 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:
Reader
may be undefined, or defined from star imports(F405)
11-11:
Scanner
may be undefined, or defined from star imports(F405)
11-11:
Parser
may be undefined, or defined from star imports(F405)
11-11:
Composer
may be undefined, or defined from star imports(F405)
11-11:
BaseConstructor
may be undefined, or defined from star imports(F405)
11-11:
BaseResolver
may be undefined, or defined from star imports(F405)
14-14:
Reader
may be undefined, or defined from star imports(F405)
15-15:
Scanner
may be undefined, or defined from star imports(F405)
16-16:
Parser
may be undefined, or defined from star imports(F405)
17-17:
Composer
may be undefined, or defined from star imports(F405)
18-18:
BaseConstructor
may be undefined, or defined from star imports(F405)
19-19:
BaseResolver
may be undefined, or defined from star imports(F405)
21-21:
Reader
may be undefined, or defined from star imports(F405)
21-21:
Scanner
may be undefined, or defined from star imports(F405)
21-21:
Parser
may be undefined, or defined from star imports(F405)
21-21:
Composer
may be undefined, or defined from star imports(F405)
21-21:
FullConstructor
may be undefined, or defined from star imports(F405)
21-21:
Resolver
may be undefined, or defined from star imports(F405)
24-24:
Reader
may be undefined, or defined from star imports(F405)
25-25:
Scanner
may be undefined, or defined from star imports(F405)
26-26:
Parser
may be undefined, or defined from star imports(F405)
27-27:
Composer
may be undefined, or defined from star imports(F405)
28-28:
FullConstructor
may be undefined, or defined from star imports(F405)
29-29:
Resolver
may be undefined, or defined from star imports(F405)
31-31:
Reader
may be undefined, or defined from star imports(F405)
31-31:
Scanner
may be undefined, or defined from star imports(F405)
31-31:
Parser
may be undefined, or defined from star imports(F405)
31-31:
Composer
may be undefined, or defined from star imports(F405)
31-31:
SafeConstructor
may be undefined, or defined from star imports(F405)
31-31:
Resolver
may be undefined, or defined from star imports(F405)
34-34:
Reader
may be undefined, or defined from star imports(F405)
35-35:
Scanner
may be undefined, or defined from star imports(F405)
36-36:
Parser
may be undefined, or defined from star imports(F405)
37-37:
Composer
may be undefined, or defined from star imports(F405)
38-38:
SafeConstructor
may be undefined, or defined from star imports(F405)
39-39:
Resolver
may be undefined, or defined from star imports(F405)
41-41:
Reader
may be undefined, or defined from star imports(F405)
41-41:
Scanner
may be undefined, or defined from star imports(F405)
41-41:
Parser
may be undefined, or defined from star imports(F405)
41-41:
Composer
may be undefined, or defined from star imports(F405)
41-41:
Constructor
may be undefined, or defined from star imports(F405)
41-41:
Resolver
may be undefined, or defined from star imports(F405)
44-44:
Reader
may be undefined, or defined from star imports(F405)
45-45:
Scanner
may be undefined, or defined from star imports(F405)
46-46:
Parser
may be undefined, or defined from star imports(F405)
47-47:
Composer
may be undefined, or defined from star imports(F405)
48-48:
Constructor
may be undefined, or defined from star imports(F405)
49-49:
Resolver
may be undefined, or defined from star imports(F405)
55-55:
Reader
may be undefined, or defined from star imports(F405)
55-55:
Scanner
may be undefined, or defined from star imports(F405)
55-55:
Parser
may be undefined, or defined from star imports(F405)
55-55:
Composer
may be undefined, or defined from star imports(F405)
55-55:
Constructor
may be undefined, or defined from star imports(F405)
55-55:
Resolver
may be undefined, or defined from star imports(F405)
58-58:
Reader
may be undefined, or defined from star imports(F405)
59-59:
Scanner
may be undefined, or defined from star imports(F405)
60-60:
Parser
may be undefined, or defined from star imports(F405)
61-61:
Composer
may be undefined, or defined from star imports(F405)
62-62:
Constructor
may be undefined, or defined from star imports(F405)
63-63:
Resolver
may 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:
Reader
may be undefined, or defined from star imports(F405)
11-11:
Scanner
may be undefined, or defined from star imports(F405)
11-11:
Parser
may be undefined, or defined from star imports(F405)
11-11:
Composer
may be undefined, or defined from star imports(F405)
11-11:
BaseConstructor
may be undefined, or defined from star imports(F405)
11-11:
BaseResolver
may be undefined, or defined from star imports(F405)
14-14:
Reader
may be undefined, or defined from star imports(F405)
15-15:
Scanner
may be undefined, or defined from star imports(F405)
16-16:
Parser
may be undefined, or defined from star imports(F405)
17-17:
Composer
may be undefined, or defined from star imports(F405)
18-18:
BaseConstructor
may be undefined, or defined from star imports(F405)
19-19:
BaseResolver
may be undefined, or defined from star imports(F405)
21-21:
Reader
may be undefined, or defined from star imports(F405)
21-21:
Scanner
may be undefined, or defined from star imports(F405)
21-21:
Parser
may be undefined, or defined from star imports(F405)
21-21:
Composer
may be undefined, or defined from star imports(F405)
21-21:
FullConstructor
may be undefined, or defined from star imports(F405)
21-21:
Resolver
may be undefined, or defined from star imports(F405)
24-24:
Reader
may be undefined, or defined from star imports(F405)
25-25:
Scanner
may be undefined, or defined from star imports(F405)
26-26:
Parser
may be undefined, or defined from star imports(F405)
27-27:
Composer
may be undefined, or defined from star imports(F405)
28-28:
FullConstructor
may be undefined, or defined from star imports(F405)
29-29:
Resolver
may be undefined, or defined from star imports(F405)
31-31:
Reader
may be undefined, or defined from star imports(F405)
31-31:
Scanner
may be undefined, or defined from star imports(F405)
31-31:
Parser
may be undefined, or defined from star imports(F405)
31-31:
Composer
may be undefined, or defined from star imports(F405)
31-31:
SafeConstructor
may be undefined, or defined from star imports(F405)
31-31:
Resolver
may be undefined, or defined from star imports(F405)
34-34:
Reader
may be undefined, or defined from star imports(F405)
35-35:
Scanner
may be undefined, or defined from star imports(F405)
36-36:
Parser
may be undefined, or defined from star imports(F405)
37-37:
Composer
may be undefined, or defined from star imports(F405)
38-38:
SafeConstructor
may be undefined, or defined from star imports(F405)
39-39:
Resolver
may be undefined, or defined from star imports(F405)
41-41:
Reader
may be undefined, or defined from star imports(F405)
41-41:
Scanner
may be undefined, or defined from star imports(F405)
41-41:
Parser
may be undefined, or defined from star imports(F405)
41-41:
Composer
may be undefined, or defined from star imports(F405)
41-41:
Constructor
may be undefined, or defined from star imports(F405)
41-41:
Resolver
may be undefined, or defined from star imports(F405)
44-44:
Reader
may be undefined, or defined from star imports(F405)
45-45:
Scanner
may be undefined, or defined from star imports(F405)
46-46:
Parser
may be undefined, or defined from star imports(F405)
47-47:
Composer
may be undefined, or defined from star imports(F405)
48-48:
Constructor
may be undefined, or defined from star imports(F405)
49-49:
Resolver
may be undefined, or defined from star imports(F405)
55-55:
Reader
may be undefined, or defined from star imports(F405)
55-55:
Scanner
may be undefined, or defined from star imports(F405)
55-55:
Parser
may be undefined, or defined from star imports(F405)
55-55:
Composer
may be undefined, or defined from star imports(F405)
55-55:
Constructor
may be undefined, or defined from star imports(F405)
55-55:
Resolver
may be undefined, or defined from star imports(F405)
58-58:
Reader
may be undefined, or defined from star imports(F405)
59-59:
Scanner
may be undefined, or defined from star imports(F405)
60-60:
Parser
may be undefined, or defined from star imports(F405)
61-61:
Composer
may be undefined, or defined from star imports(F405)
62-62:
Constructor
may be undefined, or defined from star imports(F405)
63-63:
Resolver
may be undefined, or defined from star imports(F405)
benchmarks/wrappers/fission/python/handler.py
54-54: Use capitalized environment variable
COLD_START
instead ofcold_start
Replace
cold_start
withCOLD_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:
Emitter
may be undefined, or defined from star imports(F405)
9-9:
Serializer
may be undefined, or defined from star imports(F405)
9-9:
BaseRepresenter
may be undefined, or defined from star imports(F405)
9-9:
BaseResolver
may be undefined, or defined from star imports(F405)
17-17:
Emitter
may be undefined, or defined from star imports(F405)
20-20:
Serializer
may be undefined, or defined from star imports(F405)
23-23:
Representer
may be undefined, or defined from star imports(F405)
25-25:
Resolver
may be undefined, or defined from star imports(F405)
27-27:
Emitter
may be undefined, or defined from star imports(F405)
27-27:
Serializer
may be undefined, or defined from star imports(F405)
27-27:
SafeRepresenter
may be undefined, or defined from star imports(F405)
27-27:
Resolver
may be undefined, or defined from star imports(F405)
35-35:
Emitter
may be undefined, or defined from star imports(F405)
38-38:
Serializer
may be undefined, or defined from star imports(F405)
41-41:
SafeRepresenter
may be undefined, or defined from star imports(F405)
43-43:
Resolver
may be undefined, or defined from star imports(F405)
45-45:
Emitter
may be undefined, or defined from star imports(F405)
45-45:
Serializer
may be undefined, or defined from star imports(F405)
45-45:
Representer
may be undefined, or defined from star imports(F405)
45-45:
Resolver
may be undefined, or defined from star imports(F405)
53-53:
Emitter
may be undefined, or defined from star imports(F405)
56-56:
Serializer
may be undefined, or defined from star imports(F405)
59-59:
Representer
may be undefined, or defined from star imports(F405)
61-61:
Resolver
may 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:
Emitter
may be undefined, or defined from star imports(F405)
9-9:
Serializer
may be undefined, or defined from star imports(F405)
9-9:
BaseRepresenter
may be undefined, or defined from star imports(F405)
9-9:
BaseResolver
may be undefined, or defined from star imports(F405)
17-17:
Emitter
may be undefined, or defined from star imports(F405)
20-20:
Serializer
may be undefined, or defined from star imports(F405)
23-23:
Representer
may be undefined, or defined from star imports(F405)
25-25:
Resolver
may be undefined, or defined from star imports(F405)
27-27:
Emitter
may be undefined, or defined from star imports(F405)
27-27:
Serializer
may be undefined, or defined from star imports(F405)
27-27:
SafeRepresenter
may be undefined, or defined from star imports(F405)
27-27:
Resolver
may be undefined, or defined from star imports(F405)
35-35:
Emitter
may be undefined, or defined from star imports(F405)
38-38:
Serializer
may be undefined, or defined from star imports(F405)
41-41:
SafeRepresenter
may be undefined, or defined from star imports(F405)
43-43:
Resolver
may be undefined, or defined from star imports(F405)
45-45:
Emitter
may be undefined, or defined from star imports(F405)
45-45:
Serializer
may be undefined, or defined from star imports(F405)
45-45:
Representer
may be undefined, or defined from star imports(F405)
45-45:
Resolver
may be undefined, or defined from star imports(F405)
53-53:
Emitter
may be undefined, or defined from star imports(F405)
56-56:
Serializer
may be undefined, or defined from star imports(F405)
59-59:
Representer
may be undefined, or defined from star imports(F405)
61-61:
Resolver
may 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:
BaseConstructor
may be undefined, or defined from star imports(F405)
16-16:
BaseResolver
may be undefined, or defined from star imports(F405)
20-20:
BaseConstructor
may be undefined, or defined from star imports(F405)
21-21:
BaseResolver
may be undefined, or defined from star imports(F405)
23-23:
SafeConstructor
may be undefined, or defined from star imports(F405)
23-23:
Resolver
may be undefined, or defined from star imports(F405)
27-27:
SafeConstructor
may be undefined, or defined from star imports(F405)
28-28:
Resolver
may be undefined, or defined from star imports(F405)
30-30:
FullConstructor
may be undefined, or defined from star imports(F405)
30-30:
Resolver
may be undefined, or defined from star imports(F405)
34-34:
FullConstructor
may be undefined, or defined from star imports(F405)
35-35:
Resolver
may be undefined, or defined from star imports(F405)
37-37:
UnsafeConstructor
may be undefined, or defined from star imports(F405)
37-37:
Resolver
may be undefined, or defined from star imports(F405)
41-41:
UnsafeConstructor
may be undefined, or defined from star imports(F405)
42-42:
Resolver
may be undefined, or defined from star imports(F405)
44-44:
Constructor
may be undefined, or defined from star imports(F405)
44-44:
Resolver
may be undefined, or defined from star imports(F405)
48-48:
Constructor
may be undefined, or defined from star imports(F405)
49-49:
Resolver
may be undefined, or defined from star imports(F405)
51-51:
BaseRepresenter
may be undefined, or defined from star imports(F405)
51-51:
BaseResolver
may be undefined, or defined from star imports(F405)
64-64:
Representer
may be undefined, or defined from star imports(F405)
66-66:
Resolver
may be undefined, or defined from star imports(F405)
68-68:
SafeRepresenter
may be undefined, or defined from star imports(F405)
68-68:
Resolver
may be undefined, or defined from star imports(F405)
81-81:
SafeRepresenter
may be undefined, or defined from star imports(F405)
83-83:
Resolver
may be undefined, or defined from star imports(F405)
85-85:
Serializer
may be undefined, or defined from star imports(F405)
85-85:
Representer
may be undefined, or defined from star imports(F405)
85-85:
Resolver
may be undefined, or defined from star imports(F405)
98-98:
Representer
may be undefined, or defined from star imports(F405)
100-100:
Resolver
may 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:
BaseConstructor
may be undefined, or defined from star imports(F405)
16-16:
BaseResolver
may be undefined, or defined from star imports(F405)
20-20:
BaseConstructor
may be undefined, or defined from star imports(F405)
21-21:
BaseResolver
may be undefined, or defined from star imports(F405)
23-23:
SafeConstructor
may be undefined, or defined from star imports(F405)
23-23:
Resolver
may be undefined, or defined from star imports(F405)
27-27:
SafeConstructor
may be undefined, or defined from star imports(F405)
28-28:
Resolver
may be undefined, or defined from star imports(F405)
30-30:
FullConstructor
may be undefined, or defined from star imports(F405)
30-30:
Resolver
may be undefined, or defined from star imports(F405)
34-34:
FullConstructor
may be undefined, or defined from star imports(F405)
35-35:
Resolver
may be undefined, or defined from star imports(F405)
37-37:
UnsafeConstructor
may be undefined, or defined from star imports(F405)
37-37:
Resolver
may be undefined, or defined from star imports(F405)
41-41:
UnsafeConstructor
may be undefined, or defined from star imports(F405)
42-42:
Resolver
may be undefined, or defined from star imports(F405)
44-44:
Constructor
may be undefined, or defined from star imports(F405)
44-44:
Resolver
may be undefined, or defined from star imports(F405)
48-48:
Constructor
may be undefined, or defined from star imports(F405)
49-49:
Resolver
may be undefined, or defined from star imports(F405)
51-51:
BaseRepresenter
may be undefined, or defined from star imports(F405)
51-51:
BaseResolver
may be undefined, or defined from star imports(F405)
64-64:
Representer
may be undefined, or defined from star imports(F405)
66-66:
Resolver
may be undefined, or defined from star imports(F405)
68-68:
SafeRepresenter
may be undefined, or defined from star imports(F405)
68-68:
Resolver
may be undefined, or defined from star imports(F405)
81-81:
SafeRepresenter
may be undefined, or defined from star imports(F405)
83-83:
Resolver
may be undefined, or defined from star imports(F405)
85-85:
Serializer
may be undefined, or defined from star imports(F405)
85-85:
Representer
may be undefined, or defined from star imports(F405)
85-85:
Resolver
may be undefined, or defined from star imports(F405)
98-98:
Representer
may be undefined, or defined from star imports(F405)
100-100:
Resolver
may 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:
StreamStartEvent
may be undefined, or defined from star imports(F405)
40-40:
StreamEndEvent
may be undefined, or defined from star imports(F405)
51-51:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
55-55:
DocumentEndEvent
may be undefined, or defined from star imports(F405)
66-66:
SequenceNode
may be undefined, or defined from star imports(F405)
69-69:
MappingNode
may be undefined, or defined from star imports(F405)
81-81:
AliasEvent
may be undefined, or defined from star imports(F405)
85-85:
ScalarNode
may be undefined, or defined from star imports(F405)
86-86:
ScalarNode
may be undefined, or defined from star imports(F405)
87-87:
ScalarNode
may be undefined, or defined from star imports(F405)
89-89:
ScalarEvent
may be undefined, or defined from star imports(F405)
91-91:
SequenceNode
may be undefined, or defined from star imports(F405)
93-93:
SequenceNode
may be undefined, or defined from star imports(F405)
94-94:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
100-100:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
101-101:
MappingNode
may be undefined, or defined from star imports(F405)
103-103:
MappingNode
may be undefined, or defined from star imports(F405)
104-104:
MappingStartEvent
may be undefined, or defined from star imports(F405)
109-109:
MappingEndEvent
may 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:
StreamStartEvent
may be undefined, or defined from star imports(F405)
40-40:
StreamEndEvent
may be undefined, or defined from star imports(F405)
51-51:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
55-55:
DocumentEndEvent
may be undefined, or defined from star imports(F405)
66-66:
SequenceNode
may be undefined, or defined from star imports(F405)
69-69:
MappingNode
may be undefined, or defined from star imports(F405)
81-81:
AliasEvent
may be undefined, or defined from star imports(F405)
85-85:
ScalarNode
may be undefined, or defined from star imports(F405)
86-86:
ScalarNode
may be undefined, or defined from star imports(F405)
87-87:
ScalarNode
may be undefined, or defined from star imports(F405)
89-89:
ScalarEvent
may be undefined, or defined from star imports(F405)
91-91:
SequenceNode
may be undefined, or defined from star imports(F405)
93-93:
SequenceNode
may be undefined, or defined from star imports(F405)
94-94:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
100-100:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
101-101:
MappingNode
may be undefined, or defined from star imports(F405)
103-103:
MappingNode
may be undefined, or defined from star imports(F405)
104-104:
MappingStartEvent
may be undefined, or defined from star imports(F405)
109-109:
MappingEndEvent
may be undefined, or defined from star imports(F405)
benchmarks/wrappers/fission/python/storage.py
3-3:
json
imported 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:
StreamStartEvent
may be undefined, or defined from star imports(F405)
22-22:
StreamEndEvent
may be undefined, or defined from star imports(F405)
26-26:
StreamEndEvent
may be undefined, or defined from star imports(F405)
35-35:
StreamEndEvent
may be undefined, or defined from star imports(F405)
39-39:
StreamEndEvent
may be undefined, or defined from star imports(F405)
64-64:
AliasEvent
may be undefined, or defined from star imports(F405)
73-74: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
79-79:
ScalarEvent
may be undefined, or defined from star imports(F405)
81-81:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
83-83:
MappingStartEvent
may be undefined, or defined from star imports(F405)
92-92:
ScalarNode
may be undefined, or defined from star imports(F405)
93-93:
ScalarNode
may be undefined, or defined from star imports(F405)
103-103:
SequenceNode
may be undefined, or defined from star imports(F405)
104-104:
SequenceNode
may be undefined, or defined from star imports(F405)
110-110:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
121-121:
MappingNode
may be undefined, or defined from star imports(F405)
122-122:
MappingNode
may be undefined, or defined from star imports(F405)
127-127:
MappingEndEvent
may 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:
StreamStartEvent
may be undefined, or defined from star imports(F405)
22-22:
StreamEndEvent
may be undefined, or defined from star imports(F405)
26-26:
StreamEndEvent
may be undefined, or defined from star imports(F405)
35-35:
StreamEndEvent
may be undefined, or defined from star imports(F405)
39-39:
StreamEndEvent
may be undefined, or defined from star imports(F405)
64-64:
AliasEvent
may be undefined, or defined from star imports(F405)
73-74: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
79-79:
ScalarEvent
may be undefined, or defined from star imports(F405)
81-81:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
83-83:
MappingStartEvent
may be undefined, or defined from star imports(F405)
92-92:
ScalarNode
may be undefined, or defined from star imports(F405)
93-93:
ScalarNode
may be undefined, or defined from star imports(F405)
103-103:
SequenceNode
may be undefined, or defined from star imports(F405)
104-104:
SequenceNode
may be undefined, or defined from star imports(F405)
110-110:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
121-121:
MappingNode
may be undefined, or defined from star imports(F405)
122-122:
MappingNode
may be undefined, or defined from star imports(F405)
127-127:
MappingEndEvent
may be undefined, or defined from star imports(F405)
testing/originalnodep/yaml/reader.py
164-165: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
testing/prajintry/pacakges/yaml/reader.py
164-165: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to 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:
YAMLError
may be undefined, or defined from star imports(F405)
27-27: Test for membership should be
not in
Convert to
not in
(E713)
51-51: Test for membership should be
not in
Convert to
not in
(E713)
67-67:
ScalarNode
may be undefined, or defined from star imports(F405)
69-69:
SequenceNode
may be undefined, or defined from star imports(F405)
71-71:
MappingNode
may be undefined, or defined from star imports(F405)
72-72:
ScalarNode
may be undefined, or defined from star imports(F405)
72-72:
SequenceNode
may be undefined, or defined from star imports(F405)
72-72:
MappingNode
may be undefined, or defined from star imports(F405)
81-81:
ScalarNode
may be undefined, or defined from star imports(F405)
83-83:
SequenceNode
may be undefined, or defined from star imports(F405)
85-85:
MappingNode
may be undefined, or defined from star imports(F405)
86-86:
ScalarNode
may be undefined, or defined from star imports(F405)
86-86:
SequenceNode
may be undefined, or defined from star imports(F405)
86-86:
MappingNode
may be undefined, or defined from star imports(F405)
126-127: Use a single
if
statement instead of nestedif
statements(SIM102)
135-135:
ScalarNode
may be undefined, or defined from star imports(F405)
138-139: Use a single
if
statement instead of nestedif
statements(SIM102)
144-144:
ScalarNode
may be undefined, or defined from star imports(F405)
160-160:
ScalarNode
may be undefined, or defined from star imports(F405)
162-162:
SequenceNode
may be undefined, or defined from star imports(F405)
164-164:
MappingNode
may 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:
YAMLError
may be undefined, or defined from star imports(F405)
27-27: Test for membership should be
not in
Convert to
not in
(E713)
51-51: Test for membership should be
not in
Convert to
not in
(E713)
67-67:
ScalarNode
may be undefined, or defined from star imports(F405)
69-69:
SequenceNode
may be undefined, or defined from star imports(F405)
71-71:
MappingNode
may be undefined, or defined from star imports(F405)
72-72:
ScalarNode
may be undefined, or defined from star imports(F405)
72-72:
SequenceNode
may be undefined, or defined from star imports(F405)
72-72:
MappingNode
may be undefined, or defined from star imports(F405)
81-81:
ScalarNode
may be undefined, or defined from star imports(F405)
83-83:
SequenceNode
may be undefined, or defined from star imports(F405)
85-85:
MappingNode
may be undefined, or defined from star imports(F405)
86-86:
ScalarNode
may be undefined, or defined from star imports(F405)
86-86:
SequenceNode
may be undefined, or defined from star imports(F405)
86-86:
MappingNode
may be undefined, or defined from star imports(F405)
126-127: Use a single
if
statement instead of nestedif
statements(SIM102)
135-135:
ScalarNode
may be undefined, or defined from star imports(F405)
138-139: Use a single
if
statement instead of nestedif
statements(SIM102)
144-144:
ScalarNode
may be undefined, or defined from star imports(F405)
160-160:
ScalarNode
may be undefined, or defined from star imports(F405)
162-162:
SequenceNode
may be undefined, or defined from star imports(F405)
164-164:
MappingNode
may be undefined, or defined from star imports(F405)
sebs/fission/config.py
146-146: f-string without any placeholders
Remove extraneous
f
prefix(F541)
172-172: f-string without any placeholders
Remove extraneous
f
prefix(F541)
182-182: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to 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_uri
is assigned to but never usedRemove assignment to unused variable
connection_uri
(F841)
215-215: Local variable
access_key
is assigned to but never usedRemove assignment to unused variable
access_key
(F841)
216-216: Local variable
secret_key
is 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:
Loader
may be undefined, or defined from star imports(F405)
40-40:
Loader
may be undefined, or defined from star imports(F405)
51-51:
Loader
may be undefined, or defined from star imports(F405)
62-62:
Loader
may be undefined, or defined from star imports(F405)
105-105:
FullLoader
may be undefined, or defined from star imports(F405)
115-115:
FullLoader
may be undefined, or defined from star imports(F405)
125-125:
SafeLoader
may be undefined, or defined from star imports(F405)
135-135:
SafeLoader
may be undefined, or defined from star imports(F405)
145-145:
UnsafeLoader
may be undefined, or defined from star imports(F405)
155-155:
UnsafeLoader
may be undefined, or defined from star imports(F405)
157-157:
Dumper
may be undefined, or defined from star imports(F405)
178-178:
Dumper
may 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:
Dumper
may be undefined, or defined from star imports(F405)
215-215:
Dumper
may 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:
Dumper
may be undefined, or defined from star imports(F405)
261-261:
SafeDumper
may be undefined, or defined from star imports(F405)
269-269:
SafeDumper
may be undefined, or defined from star imports(F405)
272-272:
Dumper
may be undefined, or defined from star imports(F405)
280-280:
loader
may be undefined, or defined from star imports(F405)
281-281:
loader
may be undefined, or defined from star imports(F405)
282-282:
loader
may be undefined, or defined from star imports(F405)
287-287:
Dumper
may be undefined, or defined from star imports(F405)
295-295:
loader
may be undefined, or defined from star imports(F405)
296-296:
loader
may be undefined, or defined from star imports(F405)
297-297:
loader
may be undefined, or defined from star imports(F405)
309-309:
loader
may be undefined, or defined from star imports(F405)
310-310:
loader
may be undefined, or defined from star imports(F405)
311-311:
loader
may be undefined, or defined from star imports(F405)
323-323:
loader
may be undefined, or defined from star imports(F405)
324-324:
loader
may be undefined, or defined from star imports(F405)
325-325:
loader
may be undefined, or defined from star imports(F405)
329-329:
Dumper
may be undefined, or defined from star imports(F405)
338-338:
Dumper
may be undefined, or defined from star imports(F405)
370-370:
Loader
may be undefined, or defined from star imports(F405)
370-370:
FullLoader
may be undefined, or defined from star imports(F405)
370-370:
UnsafeLoader
may be undefined, or defined from star imports(F405)
371-371:
Dumper
may 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:
Loader
may be undefined, or defined from star imports(F405)
40-40:
Loader
may be undefined, or defined from star imports(F405)
51-51:
Loader
may be undefined, or defined from star imports(F405)
62-62:
Loader
may be undefined, or defined from star imports(F405)
105-105:
FullLoader
may be undefined, or defined from star imports(F405)
115-115:
FullLoader
may be undefined, or defined from star imports(F405)
125-125:
SafeLoader
may be undefined, or defined from star imports(F405)
135-135:
SafeLoader
may be undefined, or defined from star imports(F405)
145-145:
UnsafeLoader
may be undefined, or defined from star imports(F405)
155-155:
UnsafeLoader
may be undefined, or defined from star imports(F405)
157-157:
Dumper
may be undefined, or defined from star imports(F405)
178-178:
Dumper
may 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:
Dumper
may be undefined, or defined from star imports(F405)
215-215:
Dumper
may 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:
Dumper
may be undefined, or defined from star imports(F405)
261-261:
SafeDumper
may be undefined, or defined from star imports(F405)
269-269:
SafeDumper
may be undefined, or defined from star imports(F405)
272-272:
Dumper
may be undefined, or defined from star imports(F405)
280-280:
loader
may be undefined, or defined from star imports(F405)
281-281:
loader
may be undefined, or defined from star imports(F405)
282-282:
loader
may be undefined, or defined from star imports(F405)
287-287:
Dumper
may be undefined, or defined from star imports(F405)
295-295:
loader
may be undefined, or defined from star imports(F405)
296-296:
loader
may be undefined, or defined from star imports(F405)
297-297:
loader
may be undefined, or defined from star imports(F405)
309-309:
loader
may be undefined, or defined from star imports(F405)
310-310:
loader
may be undefined, or defined from star imports(F405)
311-311:
loader
may be undefined, or defined from star imports(F405)
323-323:
loader
may be undefined, or defined from star imports(F405)
324-324:
loader
may be undefined, or defined from star imports(F405)
325-325:
loader
may be undefined, or defined from star imports(F405)
329-329:
Dumper
may be undefined, or defined from star imports(F405)
338-338:
Dumper
may be undefined, or defined from star imports(F405)
370-370:
Loader
may be undefined, or defined from star imports(F405)
370-370:
FullLoader
may be undefined, or defined from star imports(F405)
370-370:
UnsafeLoader
may be undefined, or defined from star imports(F405)
371-371:
Dumper
may 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:
YAMLError
may be undefined, or defined from star imports(F405)
60-60:
ScalarNode
may be undefined, or defined from star imports(F405)
67-67: Test for membership should be
not in
Convert to
not in
(E713)
73-73: Test for membership should be
not in
Convert to
not in
(E713)
80-80:
ScalarNode
may be undefined, or defined from star imports(F405)
87-87:
SequenceNode
may be undefined, or defined from star imports(F405)
93-93:
ScalarNode
may be undefined, or defined from star imports(F405)
105-105:
MappingNode
may be undefined, or defined from star imports(F405)
112-115: Use
contextlib.suppress(TypeError)
instead oftry
-except
-pass
Replace with
contextlib.suppress(TypeError)
(SIM105)
119-119:
ScalarNode
may be undefined, or defined from star imports(F405)
121-121:
ScalarNode
may 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:
YAMLError
may be undefined, or defined from star imports(F405)
60-60:
ScalarNode
may be undefined, or defined from star imports(F405)
67-67: Test for membership should be
not in
Convert to
not in
(E713)
73-73: Test for membership should be
not in
Convert to
not in
(E713)
80-80:
ScalarNode
may be undefined, or defined from star imports(F405)
87-87:
SequenceNode
may be undefined, or defined from star imports(F405)
93-93:
ScalarNode
may be undefined, or defined from star imports(F405)
105-105:
MappingNode
may be undefined, or defined from star imports(F405)
112-115: Use
contextlib.suppress(TypeError)
instead oftry
-except
-pass
Replace with
contextlib.suppress(TypeError)
(SIM105)
119-119:
ScalarNode
may be undefined, or defined from star imports(F405)
121-121:
ScalarNode
may 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:
re
imported but unusedRemove unused import:
re
(F401)
9-9:
json
imported but unusedRemove unused import:
json
(F401)
10-10:
time.sleep
imported but unusedRemove unused import:
time.sleep
(F401)
11-11: Redefinition of unused
Dict
from line 6Remove definition:
Dict
(F811)
11-11: Redefinition of unused
Tuple
from line 6Remove definition:
Tuple
(F811)
11-11: Redefinition of unused
List
from line 6Remove definition:
List
(F811)
18-18:
sebs.utils.DOCKER_DIR
imported 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
f
prefix(F541)
210-210: f-string without any placeholders
Remove extraneous
f
prefix(F541)
273-273: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
279-279: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
302-302: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
307-307: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
354-354: f-string without any placeholders
Remove extraneous
f
prefix(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
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
109-110: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
116-117: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
131-131:
StreamStartEvent
may be undefined, or defined from star imports(F405)
142-142:
DirectiveToken
may be undefined, or defined from star imports(F405)
142-142:
DocumentStartToken
may be undefined, or defined from star imports(F405)
143-143:
StreamEndToken
may be undefined, or defined from star imports(F405)
147-147:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
162-162:
DocumentEndToken
may be undefined, or defined from star imports(F405)
166-166:
StreamEndToken
may be undefined, or defined from star imports(F405)
170-170:
DocumentStartToken
may be undefined, or defined from star imports(F405)
177-177:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
184-184:
StreamEndEvent
may be undefined, or defined from star imports(F405)
196-196:
DocumentEndToken
may be undefined, or defined from star imports(F405)
200-200:
DocumentEndEvent
may be undefined, or defined from star imports(F405)
209-209:
DirectiveToken
may be undefined, or defined from star imports(F405)
210-210:
DocumentStartToken
may be undefined, or defined from star imports(F405)
210-210:
DocumentEndToken
may be undefined, or defined from star imports(F405)
210-210:
StreamEndToken
may be undefined, or defined from star imports(F405)
220-220:
DirectiveToken
may be undefined, or defined from star imports(F405)
274-274:
AliasToken
may be undefined, or defined from star imports(F405)
276-276:
AliasEvent
may be undefined, or defined from star imports(F405)
282-282:
AnchorToken
may be undefined, or defined from star imports(F405)
287-287:
TagToken
may be undefined, or defined from star imports(F405)
292-292:
TagToken
may be undefined, or defined from star imports(F405)
297-297:
AnchorToken
may be undefined, or defined from star imports(F405)
319-319:
BlockEntryToken
may be undefined, or defined from star imports(F405)
321-321:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
325-325:
ScalarToken
may be undefined, or defined from star imports(F405)
334-334:
ScalarEvent
may be undefined, or defined from star imports(F405)
337-337:
FlowSequenceStartToken
may be undefined, or defined from star imports(F405)
339-339:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
342-342:
FlowMappingStartToken
may be undefined, or defined from star imports(F405)
344-344:
MappingStartEvent
may be undefined, or defined from star imports(F405)
347-347:
BlockSequenceStartToken
may be undefined, or defined from star imports(F405)
349-349:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
352-352:
BlockMappingStartToken
may be undefined, or defined from star imports(F405)
354-354:
MappingStartEvent
may be undefined, or defined from star imports(F405)
360-360:
ScalarEvent
may 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:
BlockEntryToken
may be undefined, or defined from star imports(F405)
384-384:
BlockEntryToken
may be undefined, or defined from star imports(F405)
384-384:
BlockEndToken
may be undefined, or defined from star imports(F405)
390-390:
BlockEndToken
may be undefined, or defined from star imports(F405)
395-395:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
403-403:
BlockEntryToken
may be undefined, or defined from star imports(F405)
405-405:
BlockEntryToken
may be undefined, or defined from star imports(F405)
406-406:
KeyToken
may be undefined, or defined from star imports(F405)
406-406:
ValueToken
may be undefined, or defined from star imports(F405)
406-406:
BlockEndToken
may be undefined, or defined from star imports(F405)
413-413:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
428-428:
KeyToken
may be undefined, or defined from star imports(F405)
430-430:
KeyToken
may be undefined, or defined from star imports(F405)
430-430:
ValueToken
may be undefined, or defined from star imports(F405)
430-430:
BlockEndToken
may be undefined, or defined from star imports(F405)
436-436:
BlockEndToken
may be undefined, or defined from star imports(F405)
441-441:
MappingEndEvent
may be undefined, or defined from star imports(F405)
447-447:
ValueToken
may be undefined, or defined from star imports(F405)
449-449:
KeyToken
may be undefined, or defined from star imports(F405)
449-449:
ValueToken
may be undefined, or defined from star imports(F405)
449-449:
BlockEndToken
may be undefined, or defined from star imports(F405)
477-477:
FlowSequenceEndToken
may be undefined, or defined from star imports(F405)
479-479:
FlowEntryToken
may be undefined, or defined from star imports(F405)
486-486:
KeyToken
may be undefined, or defined from star imports(F405)
488-488:
MappingStartEvent
may be undefined, or defined from star imports(F405)
493-493:
FlowSequenceEndToken
may be undefined, or defined from star imports(F405)
497-497:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
504-504:
ValueToken
may be undefined, or defined from star imports(F405)
505-505:
FlowEntryToken
may be undefined, or defined from star imports(F405)
505-505:
FlowSequenceEndToken
may be undefined, or defined from star imports(F405)
513-513:
ValueToken
may be undefined, or defined from star imports(F405)
515-515:
FlowEntryToken
may be undefined, or defined from star imports(F405)
515-515:
FlowSequenceEndToken
may be undefined, or defined from star imports(F405)
529-529:
MappingEndEvent
may be undefined, or defined from star imports(F405)
543-543:
FlowMappingEndToken
may be undefined, or defined from star imports(F405)
545-545:
FlowEntryToken
may be undefined, or defined from star imports(F405)
551-551:
KeyToken
may be undefined, or defined from star imports(F405)
553-553:
ValueToken
may be undefined, or defined from star imports(F405)
554-554:
FlowEntryToken
may be undefined, or defined from star imports(F405)
554-554:
FlowMappingEndToken
may be undefined, or defined from star imports(F405)
560-560:
FlowMappingEndToken
may be undefined, or defined from star imports(F405)
564-564:
MappingEndEvent
may be undefined, or defined from star imports(F405)
570-570:
ValueToken
may be undefined, or defined from star imports(F405)
572-572:
FlowEntryToken
may be undefined, or defined from star imports(F405)
572-572:
FlowMappingEndToken
may be undefined, or defined from star imports(F405)
588-588:
ScalarEvent
may 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
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
109-110: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
116-117: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
131-131:
StreamStartEvent
may be undefined, or defined from star imports(F405)
142-142:
DirectiveToken
may be undefined, or defined from star imports(F405)
142-142:
DocumentStartToken
may be undefined, or defined from star imports(F405)
143-143:
StreamEndToken
may be undefined, or defined from star imports(F405)
147-147:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
162-162:
DocumentEndToken
may be undefined, or defined from star imports(F405)
166-166:
StreamEndToken
may be undefined, or defined from star imports(F405)
170-170:
DocumentStartToken
may be undefined, or defined from star imports(F405)
177-177:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
184-184:
StreamEndEvent
may be undefined, or defined from star imports(F405)
196-196:
DocumentEndToken
may be undefined, or defined from star imports(F405)
200-200:
DocumentEndEvent
may be undefined, or defined from star imports(F405)
209-209:
DirectiveToken
may be undefined, or defined from star imports(F405)
210-210:
DocumentStartToken
may be undefined, or defined from star imports(F405)
210-210:
DocumentEndToken
may be undefined, or defined from star imports(F405)
210-210:
StreamEndToken
may be undefined, or defined from star imports(F405)
220-220:
DirectiveToken
may be undefined, or defined from star imports(F405)
274-274:
AliasToken
may be undefined, or defined from star imports(F405)
276-276:
AliasEvent
may be undefined, or defined from star imports(F405)
282-282:
AnchorToken
may be undefined, or defined from star imports(F405)
287-287:
TagToken
may be undefined, or defined from star imports(F405)
292-292:
TagToken
may be undefined, or defined from star imports(F405)
297-297:
AnchorToken
may be undefined, or defined from star imports(F405)
319-319:
BlockEntryToken
may be undefined, or defined from star imports(F405)
321-321:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
325-325:
ScalarToken
may be undefined, or defined from star imports(F405)
334-334:
ScalarEvent
may be undefined, or defined from star imports(F405)
337-337:
FlowSequenceStartToken
may be undefined, or defined from star imports(F405)
339-339:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
342-342:
FlowMappingStartToken
may be undefined, or defined from star imports(F405)
344-344:
MappingStartEvent
may be undefined, or defined from star imports(F405)
347-347:
BlockSequenceStartToken
may be undefined, or defined from star imports(F405)
349-349:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
352-352:
BlockMappingStartToken
may be undefined, or defined from star imports(F405)
354-354:
MappingStartEvent
may be undefined, or defined from star imports(F405)
360-360:
ScalarEvent
may 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:
BlockEntryToken
may be undefined, or defined from star imports(F405)
384-384:
BlockEntryToken
may be undefined, or defined from star imports(F405)
384-384:
BlockEndToken
may be undefined, or defined from star imports(F405)
390-390:
BlockEndToken
may be undefined, or defined from star imports(F405)
395-395:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
403-403:
BlockEntryToken
may be undefined, or defined from star imports(F405)
405-405:
BlockEntryToken
may be undefined, or defined from star imports(F405)
406-406:
KeyToken
may be undefined, or defined from star imports(F405)
406-406:
ValueToken
may be undefined, or defined from star imports(F405)
406-406:
BlockEndToken
may be undefined, or defined from star imports(F405)
413-413:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
428-428:
KeyToken
may be undefined, or defined from star imports(F405)
430-430:
KeyToken
may be undefined, or defined from star imports(F405)
430-430:
ValueToken
may be undefined, or defined from star imports(F405)
430-430:
BlockEndToken
may be undefined, or defined from star imports(F405)
436-436:
BlockEndToken
may be undefined, or defined from star imports(F405)
441-441:
MappingEndEvent
may be undefined, or defined from star imports(F405)
447-447:
ValueToken
may be undefined, or defined from star imports(F405)
449-449:
KeyToken
may be undefined, or defined from star imports(F405)
449-449:
ValueToken
may be undefined, or defined from star imports(F405)
449-449:
BlockEndToken
may be undefined, or defined from star imports(F405)
477-477:
FlowSequenceEndToken
may be undefined, or defined from star imports(F405)
479-479:
FlowEntryToken
may be undefined, or defined from star imports(F405)
486-486:
KeyToken
may be undefined, or defined from star imports(F405)
488-488:
MappingStartEvent
may be undefined, or defined from star imports(F405)
493-493:
FlowSequenceEndToken
may be undefined, or defined from star imports(F405)
497-497:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
504-504:
ValueToken
may be undefined, or defined from star imports(F405)
505-505:
FlowEntryToken
may be undefined, or defined from star imports(F405)
505-505:
FlowSequenceEndToken
may be undefined, or defined from star imports(F405)
513-513:
ValueToken
may be undefined, or defined from star imports(F405)
515-515:
FlowEntryToken
may be undefined, or defined from star imports(F405)
515-515:
FlowSequenceEndToken
may be undefined, or defined from star imports(F405)
529-529:
MappingEndEvent
may be undefined, or defined from star imports(F405)
543-543:
FlowMappingEndToken
may be undefined, or defined from star imports(F405)
545-545:
FlowEntryToken
may be undefined, or defined from star imports(F405)
551-551:
KeyToken
may be undefined, or defined from star imports(F405)
553-553:
ValueToken
may be undefined, or defined from star imports(F405)
554-554:
FlowEntryToken
may be undefined, or defined from star imports(F405)
554-554:
FlowMappingEndToken
may be undefined, or defined from star imports(F405)
560-560:
FlowMappingEndToken
may be undefined, or defined from star imports(F405)
564-564:
MappingEndEvent
may be undefined, or defined from star imports(F405)
570-570:
ValueToken
may be undefined, or defined from star imports(F405)
572-572:
FlowEntryToken
may be undefined, or defined from star imports(F405)
572-572:
FlowMappingEndToken
may be undefined, or defined from star imports(F405)
588-588:
ScalarEvent
may 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:
MarkedYAMLError
may be undefined, or defined from star imports(F405)
60-60: Loop control variable
dummy
not used within loop bodyRename unused
dummy
to_dummy
(B007)
93-93:
ScalarNode
may be undefined, or defined from star imports(F405)
95-95:
SequenceNode
may be undefined, or defined from star imports(F405)
97-97:
MappingNode
may be undefined, or defined from star imports(F405)
107-107: Loop control variable
dummy
not used within loop bodyRename unused
dummy
to_dummy
(B007)
118-118:
ScalarNode
may be undefined, or defined from star imports(F405)
125-125:
SequenceNode
may be undefined, or defined from star imports(F405)
133-133:
MappingNode
may be undefined, or defined from star imports(F405)
148-148:
MappingNode
may be undefined, or defined from star imports(F405)
161-161: Test for membership should be
not in
Convert to
not in
(E713)
167-167: Test for membership should be
not in
Convert to
not in
(E713)
174-174:
MappingNode
may be undefined, or defined from star imports(F405)
187-187:
MappingNode
may be undefined, or defined from star imports(F405)
190-190:
SequenceNode
may be undefined, or defined from star imports(F405)
193-193:
MappingNode
may be undefined, or defined from star imports(F405)
216-216:
MappingNode
may be undefined, or defined from star imports(F405)
298-300: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
307-308: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
323-323: Local variable
value
is assigned to but never usedRemove assignment to unused variable
value
(F841)
358-358:
SequenceNode
may be undefined, or defined from star imports(F405)
362-362:
MappingNode
may be undefined, or defined from star imports(F405)
379-379:
SequenceNode
may be undefined, or defined from star imports(F405)
383-383:
MappingNode
may be undefined, or defined from star imports(F405)
504-506: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
513-514: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
533-534: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
553-554: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
604-604: Use
key in dict
instead ofkey in dict.keys()
Remove
.keys()
(SIM118)
635-635:
SequenceNode
may 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:
MarkedYAMLError
may be undefined, or defined from star imports(F405)
60-60: Loop control variable
dummy
not used within loop bodyRename unused
dummy
to_dummy
(B007)
93-93:
ScalarNode
may be undefined, or defined from star imports(F405)
95-95:
SequenceNode
may be undefined, or defined from star imports(F405)
97-97:
MappingNode
may be undefined, or defined from star imports(F405)
107-107: Loop control variable
dummy
not used within loop bodyRename unused
dummy
to_dummy
(B007)
118-118:
ScalarNode
may be undefined, or defined from star imports(F405)
125-125:
SequenceNode
may be undefined, or defined from star imports(F405)
133-133:
MappingNode
may be undefined, or defined from star imports(F405)
148-148:
MappingNode
may be undefined, or defined from star imports(F405)
161-161: Test for membership should be
not in
Convert to
not in
(E713)
167-167: Test for membership should be
not in
Convert to
not in
(E713)
174-174:
MappingNode
may be undefined, or defined from star imports(F405)
187-187:
MappingNode
may be undefined, or defined from star imports(F405)
190-190:
SequenceNode
may be undefined, or defined from star imports(F405)
193-193:
MappingNode
may be undefined, or defined from star imports(F405)
216-216:
MappingNode
may be undefined, or defined from star imports(F405)
298-300: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
307-308: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
323-323: Local variable
value
is assigned to but never usedRemove assignment to unused variable
value
(F841)
358-358:
SequenceNode
may be undefined, or defined from star imports(F405)
362-362:
MappingNode
may be undefined, or defined from star imports(F405)
379-379:
SequenceNode
may be undefined, or defined from star imports(F405)
383-383:
MappingNode
may be undefined, or defined from star imports(F405)
504-506: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
513-514: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
533-534: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
553-554: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
604-604: Use
key in dict
instead ofkey in dict.keys()
Remove
.keys()
(SIM118)
635-635:
SequenceNode
may 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:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
126-126:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
128-128:
MappingStartEvent
may be undefined, or defined from star imports(F405)
136-136:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
136-136:
CollectionStartEvent
may be undefined, or defined from star imports(F405)
138-138:
DocumentEndEvent
may be undefined, or defined from star imports(F405)
138-138:
CollectionEndEvent
may be undefined, or defined from star imports(F405)
140-140:
StreamEndEvent
may be undefined, or defined from star imports(F405)
161-161:
StreamStartEvent
may be undefined, or defined from star imports(F405)
179-179:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
204-204:
StreamEndEvent
may be undefined, or defined from star imports(F405)
215-215:
DocumentEndEvent
may be undefined, or defined from star imports(F405)
238-238:
AliasEvent
may be undefined, or defined from star imports(F405)
240-240:
ScalarEvent
may be undefined, or defined from star imports(F405)
240-240:
CollectionStartEvent
may be undefined, or defined from star imports(F405)
243-243:
ScalarEvent
may be undefined, or defined from star imports(F405)
245-245:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
251-251:
MappingStartEvent
may be undefined, or defined from star imports(F405)
281-281:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
293-293:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
317-317:
MappingEndEvent
may be undefined, or defined from star imports(F405)
334-334:
MappingEndEvent
may be undefined, or defined from star imports(F405)
377-377:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
396-396:
MappingEndEvent
may be undefined, or defined from star imports(F405)
423-423:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
424-424:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
427-427:
MappingStartEvent
may be undefined, or defined from star imports(F405)
428-428:
MappingEndEvent
may be undefined, or defined from star imports(F405)
431-431:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
434-434:
ScalarEvent
may be undefined, or defined from star imports(F405)
439-439:
NodeEvent
may be undefined, or defined from star imports(F405)
443-443:
ScalarEvent
may be undefined, or defined from star imports(F405)
443-443:
CollectionStartEvent
may be undefined, or defined from star imports(F405)
448-448:
ScalarEvent
may be undefined, or defined from star imports(F405)
452-452:
AliasEvent
may be undefined, or defined from star imports(F405)
453-453:
ScalarEvent
may be undefined, or defined from star imports(F405)
471-471:
ScalarEvent
may be undefined, or defined from star imports(F405)
499-503: Use a single
if
statement instead of nestedif
statements(SIM102)
505-507: Use a single
if
statement instead of nestedif
statements(SIM102)
509-511: Use a single
if
statement instead of nestedif
statements(SIM102)
703-703: Local variable
unicode_characters
is 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 ' ' + indicator
instead ofif
-else
-blockReplace
if
-else
-block withdata = indicator if self.whitespace or not need_whitespace else ' ' + indicator
(SIM108)
887-888: Use a single
if
statement instead of nestedif
statements(SIM102)
testing/prajintry/pacakges/yaml/emitter.py
12-12:
from .events import *
used; unable to detect undefined names(F403)
124-124:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
126-126:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
128-128:
MappingStartEvent
may be undefined, or defined from star imports(F405)
136-136:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
136-136:
CollectionStartEvent
may be undefined, or defined from star imports(F405)
138-138:
DocumentEndEvent
may be undefined, or defined from star imports(F405)
138-138:
CollectionEndEvent
may be undefined, or defined from star imports(F405)
140-140:
StreamEndEvent
may be undefined, or defined from star imports(F405)
161-161:
StreamStartEvent
may be undefined, or defined from star imports(F405)
179-179:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
204-204:
StreamEndEvent
may be undefined, or defined from star imports(F405)
215-215:
DocumentEndEvent
may be undefined, or defined from star imports(F405)
238-238:
AliasEvent
may be undefined, or defined from star imports(F405)
240-240:
ScalarEvent
may be undefined, or defined from star imports(F405)
240-240:
CollectionStartEvent
may be undefined, or defined from star imports(F405)
243-243:
ScalarEvent
may be undefined, or defined from star imports(F405)
245-245:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
251-251:
MappingStartEvent
may be undefined, or defined from star imports(F405)
281-281:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
293-293:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
317-317:
MappingEndEvent
may be undefined, or defined from star imports(F405)
334-334:
MappingEndEvent
may be undefined, or defined from star imports(F405)
377-377:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
396-396:
MappingEndEvent
may be undefined, or defined from star imports(F405)
423-423:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
424-424:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
427-427:
MappingStartEvent
may be undefined, or defined from star imports(F405)
428-428:
MappingEndEvent
may be undefined, or defined from star imports(F405)
431-431:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
434-434:
ScalarEvent
may be undefined, or defined from star imports(F405)
439-439:
NodeEvent
may be undefined, or defined from star imports(F405)
443-443:
ScalarEvent
may be undefined, or defined from star imports(F405)
443-443:
CollectionStartEvent
may be undefined, or defined from star imports(F405)
448-448:
ScalarEvent
may be undefined, or defined from star imports(F405)
452-452:
AliasEvent
may be undefined, or defined from star imports(F405)
453-453:
ScalarEvent
may be undefined, or defined from star imports(F405)
471-471:
ScalarEvent
may be undefined, or defined from star imports(F405)
499-503: Use a single
if
statement instead of nestedif
statements(SIM102)
505-507: Use a single
if
statement instead of nestedif
statements(SIM102)
509-511: Use a single
if
statement instead of nestedif
statements(SIM102)
703-703: Local variable
unicode_characters
is 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 ' ' + indicator
instead ofif
-else
-blockReplace
if
-else
-block withdata = indicator if self.whitespace or not need_whitespace else ' ' + indicator
(SIM108)
887-888: Use a single
if
statement instead of nestedif
statements(SIM102)
testing/originalnodep/yaml/scanner.py
30-30:
from .tokens import *
used; unable to detect undefined names(F403)
347-347:
BlockEndToken
may be undefined, or defined from star imports(F405)
367-367:
StreamStartToken
may be undefined, or defined from star imports(F405)
385-385:
StreamEndToken
may be undefined, or defined from star imports(F405)
403-403:
DocumentStartToken
may be undefined, or defined from star imports(F405)
406-406:
DocumentEndToken
may be undefined, or defined from star imports(F405)
425-425:
FlowSequenceStartToken
may be undefined, or defined from star imports(F405)
428-428:
FlowMappingStartToken
may be undefined, or defined from star imports(F405)
448-448:
FlowSequenceEndToken
may be undefined, or defined from star imports(F405)
451-451:
FlowMappingEndToken
may be undefined, or defined from star imports(F405)
482-482:
FlowEntryToken
may be undefined, or defined from star imports(F405)
498-498:
BlockSequenceStartToken
may be undefined, or defined from star imports(F405)
515-515:
BlockEntryToken
may be undefined, or defined from star imports(F405)
531-531:
BlockMappingStartToken
may be undefined, or defined from star imports(F405)
543-543:
KeyToken
may be undefined, or defined from star imports(F405)
554-554:
KeyToken
may be undefined, or defined from star imports(F405)
558-559: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
561-561:
BlockMappingStartToken
may be undefined, or defined from star imports(F405)
572-576: Use a single
if
statement instead of nestedif
statements(SIM102)
584-585: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
587-587:
BlockMappingStartToken
may be undefined, or defined from star imports(F405)
599-599:
ValueToken
may be undefined, or defined from star imports(F405)
610-610:
AliasToken
may be undefined, or defined from star imports(F405)
621-621:
AnchorToken
may be undefined, or defined from star imports(F405)
693-695: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
701-703: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
804-804:
DirectiveToken
may 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:
TagToken
may be undefined, or defined from star imports(F405)
979-982: Use ternary operator
folded = True if style == '>' else False
instead ofif
-else
-blockReplace
if
-else
-block withfolded = True if style == '>' else False
(SIM108)
1049-1049:
ScalarToken
may be undefined, or defined from star imports(F405)
1058-1061: Use ternary operator
chomping = True if ch == '+' else False
instead ofif
-else
-blockReplace
if
-else
-block withchomping = True if ch == '+' else False
(SIM108)
1080-1083: Use ternary operator
chomping = True if ch == '+' else False
instead ofif
-else
-blockReplace
if
-else
-block withchomping = True if ch == '+' else False
(SIM108)
1141-1144: Use ternary operator
double = True if style == '"' else False
instead ofif
-else
-blockReplace
if
-else
-block withdouble = True if style == '"' else False
(SIM108)
1155-1155:
ScalarToken
may be undefined, or defined from star imports(F405)
1309-1309:
ScalarToken
may be undefined, or defined from star imports(F405)
1413-1413: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to 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:
BlockEndToken
may be undefined, or defined from star imports(F405)
367-367:
StreamStartToken
may be undefined, or defined from star imports(F405)
385-385:
StreamEndToken
may be undefined, or defined from star imports(F405)
403-403:
DocumentStartToken
may be undefined, or defined from star imports(F405)
406-406:
DocumentEndToken
may be undefined, or defined from star imports(F405)
425-425:
FlowSequenceStartToken
may be undefined, or defined from star imports(F405)
428-428:
FlowMappingStartToken
may be undefined, or defined from star imports(F405)
448-448:
FlowSequenceEndToken
may be undefined, or defined from star imports(F405)
451-451:
FlowMappingEndToken
may be undefined, or defined from star imports(F405)
482-482:
FlowEntryToken
may be undefined, or defined from star imports(F405)
498-498:
BlockSequenceStartToken
may be undefined, or defined from star imports(F405)
515-515:
BlockEntryToken
may be undefined, or defined from star imports(F405)
531-531:
BlockMappingStartToken
may be undefined, or defined from star imports(F405)
543-543:
KeyToken
may be undefined, or defined from star imports(F405)
554-554:
KeyToken
may be undefined, or defined from star imports(F405)
558-559: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
561-561:
BlockMappingStartToken
may be undefined, or defined from star imports(F405)
572-576: Use a single
if
statement instead of nestedif
statements(SIM102)
584-585: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
587-587:
BlockMappingStartToken
may be undefined, or defined from star imports(F405)
599-599:
ValueToken
may be undefined, or defined from star imports(F405)
610-610:
AliasToken
may be undefined, or defined from star imports(F405)
621-621:
AnchorToken
may be undefined, or defined from star imports(F405)
693-695: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
701-703: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
804-804:
DirectiveToken
may 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:
TagToken
may be undefined, or defined from star imports(F405)
979-982: Use ternary operator
folded = True if style == '>' else False
instead ofif
-else
-blockReplace
if
-else
-block withfolded = True if style == '>' else False
(SIM108)
1049-1049:
ScalarToken
may be undefined, or defined from star imports(F405)
1058-1061: Use ternary operator
chomping = True if ch == '+' else False
instead ofif
-else
-blockReplace
if
-else
-block withchomping = True if ch == '+' else False
(SIM108)
1080-1083: Use ternary operator
chomping = True if ch == '+' else False
instead ofif
-else
-blockReplace
if
-else
-block withchomping = True if ch == '+' else False
(SIM108)
1141-1144: Use ternary operator
double = True if style == '"' else False
instead ofif
-else
-blockReplace
if
-else
-block withdouble = True if style == '"' else False
(SIM108)
1155-1155:
ScalarToken
may be undefined, or defined from star imports(F405)
1309-1309:
ScalarToken
may be undefined, or defined from star imports(F405)
1413-1413: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to 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
apk
for 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
gosu
for 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
handler
function. 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
Event
class is well-implemented with a dynamic__repr__
method that adapts to the attributes present in the instance.
15-19
: LGTM!The
NodeEvent
class correctly extendsEvent
and initializes its attributes.
21-29
: LGTM!The
CollectionStartEvent
class is well-structured and initializes all necessary attributes, including optional ones.
31-32
: LGTM!The
CollectionEndEvent
class is appropriately defined as a marker class extendingEvent
.
36-40
: LGTM!The
StreamStartEvent
class correctly initializes its attributes, including the optionalencoding
.
42-43
: LGTM!The
StreamEndEvent
class is appropriately defined as a marker class extendingEvent
.
45-52
: LGTM!The
DocumentStartEvent
class is well-structured and initializes all necessary attributes, including optional ones.
54-59
: LGTM!The
DocumentEndEvent
class correctly initializes its attributes, including the optionalexplicit
.
61-62
: LGTM!The
AliasEvent
class is appropriately defined as a marker class extendingNodeEvent
.
64-73
: LGTM!The
ScalarEvent
class is well-structured and initializes all necessary attributes, including optional ones.
75-85
: LGTM!The
SequenceStartEvent
,SequenceEndEvent
,MappingStartEvent
, andMappingEndEvent
classes are appropriately defined as marker classes extendingCollectionStartEvent
andCollectionEndEvent
.testing/prajintry/pacakges/yaml/error.py (3)
4-44
: LGTM!The
Mark
class 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
YAMLError
class is appropriately defined as a basic exception class for YAML errors.
48-74
: LGTM!The
MarkedYAMLError
class 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_runtime
method is correctly implemented to retrieve runtime-specific base images. Ensure that the keybase_images_runtime
exists in the configuration data.Verification successful
Configuration Key Verified
The
base_images_runtime
key is present in the configuration data, confirming that thebenchmark_base_images_runtime
method 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
Token
class 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
, andResolver
are 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
, andResolver
are all defined in the relevant modules within thetesting/originalnodep/yaml
directory. 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:
Emitter
may be undefined, or defined from star imports(F405)
9-9:
Serializer
may be undefined, or defined from star imports(F405)
9-9:
BaseRepresenter
may be undefined, or defined from star imports(F405)
9-9:
BaseResolver
may be undefined, or defined from star imports(F405)
17-17:
Emitter
may be undefined, or defined from star imports(F405)
20-20:
Serializer
may be undefined, or defined from star imports(F405)
23-23:
Representer
may be undefined, or defined from star imports(F405)
25-25:
Resolver
may be undefined, or defined from star imports(F405)
27-27:
Emitter
may be undefined, or defined from star imports(F405)
27-27:
Serializer
may be undefined, or defined from star imports(F405)
27-27:
SafeRepresenter
may be undefined, or defined from star imports(F405)
27-27:
Resolver
may be undefined, or defined from star imports(F405)
35-35:
Emitter
may be undefined, or defined from star imports(F405)
38-38:
Serializer
may be undefined, or defined from star imports(F405)
41-41:
SafeRepresenter
may be undefined, or defined from star imports(F405)
43-43:
Resolver
may be undefined, or defined from star imports(F405)
45-45:
Emitter
may be undefined, or defined from star imports(F405)
45-45:
Serializer
may be undefined, or defined from star imports(F405)
45-45:
Representer
may be undefined, or defined from star imports(F405)
45-45:
Resolver
may be undefined, or defined from star imports(F405)
53-53:
Emitter
may be undefined, or defined from star imports(F405)
56-56:
Serializer
may be undefined, or defined from star imports(F405)
59-59:
Representer
may be undefined, or defined from star imports(F405)
61-61:
Resolver
may 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
, andBaseResolver
might be undefined due to star imports. Verify that these classes are correctly imported or defined elsewhere in the codebase.Tools
Ruff
9-9:
Emitter
may be undefined, or defined from star imports(F405)
9-9:
Serializer
may be undefined, or defined from star imports(F405)
9-9:
BaseRepresenter
may be undefined, or defined from star imports(F405)
9-9:
BaseResolver
may be undefined, or defined from star imports(F405)
17-17:
Emitter
may be undefined, or defined from star imports(F405)
20-20:
Serializer
may be undefined, or defined from star imports(F405)
23-23:
Representer
may be undefined, or defined from star imports(F405)
25-25:
Resolver
may 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
--runtime
argument allows users to specify building a runtime image. This addition enhances the script's flexibility.
46-47
: Conditional logic forversion_name
adjustment.The check for
image_type == "runtime"
and subsequent modification ofversion_name
ensures 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
, andResolver
might 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
, andResolver
are defined in the codebase. Here are their locations:
BaseConstructor
,SafeConstructor
,FullConstructor
,UnsafeConstructor
,Constructor
are defined intesting/originalnodep/yaml/constructor.py
.Resolver
is 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:
BaseConstructor
may be undefined, or defined from star imports(F405)
16-16:
BaseResolver
may be undefined, or defined from star imports(F405)
20-20:
BaseConstructor
may be undefined, or defined from star imports(F405)
21-21:
BaseResolver
may be undefined, or defined from star imports(F405)
23-23:
SafeConstructor
may be undefined, or defined from star imports(F405)
23-23:
Resolver
may be undefined, or defined from star imports(F405)
27-27:
SafeConstructor
may be undefined, or defined from star imports(F405)
28-28:
Resolver
may be undefined, or defined from star imports(F405)
30-30:
FullConstructor
may be undefined, or defined from star imports(F405)
30-30:
Resolver
may be undefined, or defined from star imports(F405)
34-34:
FullConstructor
may be undefined, or defined from star imports(F405)
35-35:
Resolver
may be undefined, or defined from star imports(F405)
37-37:
UnsafeConstructor
may be undefined, or defined from star imports(F405)
37-37:
Resolver
may be undefined, or defined from star imports(F405)
41-41:
UnsafeConstructor
may be undefined, or defined from star imports(F405)
42-42:
Resolver
may be undefined, or defined from star imports(F405)
44-44:
Constructor
may be undefined, or defined from star imports(F405)
44-44:
Resolver
may be undefined, or defined from star imports(F405)
48-48:
Constructor
may be undefined, or defined from star imports(F405)
49-49:
Resolver
may 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:
SafeConstructor
may be undefined, or defined from star imports(F405)
23-23:
Resolver
may be undefined, or defined from star imports(F405)
27-27:
SafeConstructor
may be undefined, or defined from star imports(F405)
28-28:
Resolver
may 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:
FullConstructor
may be undefined, or defined from star imports(F405)
30-30:
Resolver
may be undefined, or defined from star imports(F405)
34-34:
FullConstructor
may be undefined, or defined from star imports(F405)
35-35:
Resolver
may 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:
UnsafeConstructor
may be undefined, or defined from star imports(F405)
37-37:
Resolver
may be undefined, or defined from star imports(F405)
41-41:
UnsafeConstructor
may be undefined, or defined from star imports(F405)
42-42:
Resolver
may 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:
Constructor
may be undefined, or defined from star imports(F405)
44-44:
Resolver
may be undefined, or defined from star imports(F405)
48-48:
Constructor
may be undefined, or defined from star imports(F405)
49-49:
Resolver
may 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:
BaseRepresenter
may be undefined, or defined from star imports(F405)
51-51:
BaseResolver
may be undefined, or defined from star imports(F405)
64-64:
Representer
may be undefined, or defined from star imports(F405)
66-66:
Resolver
may 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:
SafeRepresenter
may be undefined, or defined from star imports(F405)
68-68:
Resolver
may be undefined, or defined from star imports(F405)
81-81:
SafeRepresenter
may be undefined, or defined from star imports(F405)
83-83:
Resolver
may 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:
Serializer
may be undefined, or defined from star imports(F405)
85-85:
Representer
may be undefined, or defined from star imports(F405)
85-85:
Resolver
may be undefined, or defined from star imports(F405)
98-98:
Representer
may be undefined, or defined from star imports(F405)
100-100:
Resolver
may be undefined, or defined from star imports(F405)
testing/originalnodep/yaml/serializer.py (1)
8-9
: LGTM!The
SerializerError
class is correctly implemented.testing/prajintry/pacakges/yaml/serializer.py (2)
8-9
: Duplicate: LGTM!The
SerializerError
class 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
json
is unused and should be removed to clean up the code.Tools
Ruff
3-3:
json
imported 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 nestedif
statements.The nested
if
statements can be combined for clarity and conciseness.Tools
Ruff
73-74: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
sebs/faas/config.py (1)
208-211
: LGTM! Verify the import ofFissionConfig
.The changes to support the "fission" platform in the
deserialize
function are approved.However, ensure that
FissionConfig
is correctly defined and imported from the intended module.Verification successful
The import of
FissionConfig
is correctly defined and imported.
FissionConfig
is defined insebs/fission/config.py
.- The import in
sebs/faas/config.py
is 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_deployment
function are approved.However, ensure that
Fission
is correctly defined and imported from the intended module.Verification successful
Import of
Fission
Verified SuccessfullyThe
Fission
class is correctly defined in thesebs/fission/fission.py
module, and its import insebs/sebs.py
is 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 in
for membership tests.Use
not in
for 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 in
Convert to
not in
(E713)
126-127
: Simplify conditional statements.Use a single
if
statement instead of nestedif
statements to improve readability.Also applies to: 138-139
Tools
Ruff
126-127: Use a single
if
statement instead of nestedif
statements(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
config
dictionary. Consider adding error handling for missing keys to avoid potential runtime errors.
143-186
: ReplaceThe
create_package
method usesTools
Ruff
146-146: f-string without any placeholders
Remove extraneous
f
prefix(F541)
172-172: f-string without any placeholders
Remove extraneous
f
prefix(F541)
182-182: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to 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_resolver
andadd_path_resolver
functions should ensure that theLoader
andDumper
parameters are consistently applied across different loaders and dumpers.Also applies to: 287-300
Verification successful
Consistency in Resolver Functions Verified
The
add_implicit_resolver
andadd_path_resolver
functions 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:
Dumper
may be undefined, or defined from star imports(F405)
280-280:
loader
may be undefined, or defined from star imports(F405)
281-281:
loader
may be undefined, or defined from star imports(F405)
282-282:
loader
may be undefined, or defined from star imports(F405)
testing/originalnodep/yaml/representer.py (1)
274-283
: Ensure complex number representation is correct.The
represent_complex
method 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_complex
method 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_storage
method correctly initializes Minio storage and handles configuration checks appropriately.
377-382
: LGTM!The
cached_function
method 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
: EnsureStreamStartEvent
is defined.Due to the use of star imports,
StreamStartEvent
may be undefined. Ensure it is explicitly imported to avoid runtime errors.from .events import StreamStartEvent # Example import, adjust as neededTools
Ruff
131-131:
StreamStartEvent
may be undefined, or defined from star imports(F405)
217-246
: LGTM!The
process_directives
method correctly handles duplicate directives and incompatible versions.Tools
Ruff
220-220:
DirectiveToken
may 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
: EnsureStreamStartEvent
is defined.Due to the use of star imports,
StreamStartEvent
may be undefined. Ensure it is explicitly imported to avoid runtime errors.from .events import StreamStartEvent # Example import, adjust as neededTools
Ruff
131-131:
StreamStartEvent
may be undefined, or defined from star imports(F405)
217-246
: LGTM!The
process_directives
method correctly handles duplicate directives and incompatible versions.Tools
Ruff
220-220:
DirectiveToken
may be undefined, or defined from star imports(F405)
testing/prajintry/pacakges/yaml/emitter.py (30)
14-15
:EmitterError
class definition is correct.The class is a simple subclass of
YAMLError
and does not require any changes.
111-116
:emit
method logic is correct.The method correctly processes events using the state machine logic.
120-131
:need_more_events
method logic is correct.The method correctly determines if more events are needed. However, ensure event types are properly imported.
Tools
Ruff
124-124:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
126-126:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
128-128:
MappingStartEvent
may be undefined, or defined from star imports(F405)
146-155
:increase_indent
method logic is correct.The method correctly adjusts indentation levels based on the flow and indentless parameters.
160-168
:expect_stream_start
method 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:
StreamStartEvent
may be undefined, or defined from star imports(F405)
178-212
:expect_document_start
method logic is correct.The method correctly manages the start of a YAML document, handling version and tag directives appropriately.
Tools
Ruff
179-179:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
204-204:
StreamEndEvent
may be undefined, or defined from star imports(F405)
214-224
:expect_document_end
method 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:
DocumentEndEvent
may be undefined, or defined from star imports(F405)
232-258
:expect_node
method logic is correct.The method correctly handles node events, determining the type of node and transitioning to the appropriate state.
Tools
Ruff
238-238:
AliasEvent
may be undefined, or defined from star imports(F405)
240-240:
ScalarEvent
may be undefined, or defined from star imports(F405)
240-240:
CollectionStartEvent
may be undefined, or defined from star imports(F405)
243-243:
ScalarEvent
may be undefined, or defined from star imports(F405)
245-245:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
251-251:
MappingStartEvent
may be undefined, or defined from star imports(F405)
260-264
:expect_alias
method logic is correct.The method correctly processes alias events and raises an error if no anchor is specified.
266-270
:expect_scalar
method logic is correct.The method correctly processes scalar events, managing indentation and style.
274-278
:expect_flow_sequence
method logic is correct.The method correctly handles the start of a flow sequence, managing indentation and state transitions.
292-306
:expect_flow_sequence_item
method logic is correct.The method correctly handles items within a flow sequence, ensuring proper state transitions and formatting.
Tools
Ruff
293-293:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
310-314
:expect_flow_mapping
method logic is correct.The method correctly handles the start of a flow mapping, managing indentation and state transitions.
333-352
:expect_flow_mapping_key
method logic is correct.The method correctly handles keys within a flow mapping, ensuring proper state transitions and formatting.
Tools
Ruff
334-334:
MappingEndEvent
may be undefined, or defined from star imports(F405)
359-364
:expect_flow_mapping_value
method logic is correct.The method correctly handles values within a flow mapping, ensuring proper state transitions and formatting.
368-371
:expect_block_sequence
method logic is correct.The method correctly handles the start of a block sequence, managing indentation and state transitions.
376-384
:expect_block_sequence_item
method logic is correct.The method correctly handles items within a block sequence, ensuring proper state transitions and formatting.
Tools
Ruff
377-377:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
388-390
:expect_block_mapping
method logic is correct.The method correctly handles the start of a block mapping, managing indentation and state transitions.
395-407
:expect_block_mapping_key
method logic is correct.The method correctly handles keys within a block mapping, ensuring proper state transitions and formatting.
Tools
Ruff
396-396:
MappingEndEvent
may be undefined, or defined from star imports(F405)
414-418
:expect_block_mapping_value
method logic is correct.The method correctly handles values within a block mapping, ensuring proper state transitions and formatting.
422-424
:check_empty_sequence
method logic is correct.The method correctly identifies empty sequences based on the event type.
Tools
Ruff
423-423:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
424-424:
SequenceEndEvent
may be undefined, or defined from star imports(F405)
426-428
:check_empty_mapping
method logic is correct.The method correctly identifies empty mappings based on the event type.
Tools
Ruff
427-427:
MappingStartEvent
may be undefined, or defined from star imports(F405)
428-428:
MappingEndEvent
may be undefined, or defined from star imports(F405)
430-435
:check_empty_document
method logic is correct.The method correctly identifies empty documents based on the event type and attributes.
Tools
Ruff
431-431:
DocumentStartEvent
may be undefined, or defined from star imports(F405)
434-434:
ScalarEvent
may be undefined, or defined from star imports(F405)
437-455
:check_simple_key
method logic is correct.The method correctly determines if an event can be a simple key based on its attributes.
Tools
Ruff
439-439:
NodeEvent
may be undefined, or defined from star imports(F405)
443-443:
ScalarEvent
may be undefined, or defined from star imports(F405)
443-443:
CollectionStartEvent
may be undefined, or defined from star imports(F405)
448-448:
ScalarEvent
may be undefined, or defined from star imports(F405)
452-452:
AliasEvent
may be undefined, or defined from star imports(F405)
453-453:
ScalarEvent
may be undefined, or defined from star imports(F405)
459-467
:process_anchor
method logic is correct.The method correctly handles anchors, ensuring they are properly prepared and written.
469-491
:process_tag
method logic is correct.The method correctly handles tags, ensuring they are properly prepared and written.
Tools
Ruff
471-471:
ScalarEvent
may be undefined, or defined from star imports(F405)
494-513
:choose_scalar_style
method logic is correct.The method correctly determines the scalar style based on various conditions.
Tools
Ruff
499-503: Use a single
if
statement instead of nestedif
statements(SIM102)
505-507: Use a single
if
statement instead of nestedif
statements(SIM102)
509-511: Use a single
if
statement instead of nestedif
statements(SIM102)
515-533
:process_scalar
method logic is correct.The method correctly handles scalar events, ensuring they are written with the appropriate style.
539-543
:prepare_version
method logic is correct.The method correctly prepares the version directive and raises errors for unsupported versions.
545-555
:prepare_tag_handle
method logic is correct.The method correctly prepares tag handles, raising errors for invalid formats.
testing/originalnodep/yaml/scanner.py (30)
32-33
:ScannerError
class definition is correct.The class is a simple subclass of
MarkedYAMLError
and does not require any changes.
113-123
:check_token
method 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_token
method logic is correct.The method correctly returns the next token without removing it from the queue or
None
if no tokens are available.
135-141
:get_token
method 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_tokens
method 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_tokens
method logic is correct.The method correctly fetches more tokens, handling different token types and adjusting state as needed.
279-293
:stale_possible_simple_keys
method logic is correct.The method correctly identifies and removes stale simple keys, raising errors if required keys are missing.
295-310
:save_possible_simple_key
method 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_key
method logic is correct.The method correctly removes the saved possible key position and raises an error if the key was required.
325-347
:unwind_indent
method logic is correct.The method correctly manages indentation levels, issuing
BLOCK-END
tokens as needed.Tools
Ruff
347-347:
BlockEndToken
may be undefined, or defined from star imports(F405)
349-355
:add_indent
method logic is correct.The method correctly checks and updates indentation levels, returning a boolean to indicate changes.
359-368
:fetch_stream_start
method logic is correct.The method correctly adds a
STREAM-START
token, ensuring proper initialization of the stream.Tools
Ruff
367-367:
StreamStartToken
may be undefined, or defined from star imports(F405)
371-386
:fetch_stream_end
method logic is correct.The method correctly adds a
STREAM-END
token, finalizing the stream processing.Tools
Ruff
385-385:
StreamEndToken
may be undefined, or defined from star imports(F405)
390-400
:fetch_directive
method logic is correct.The method correctly processes directives, adding a
DIRECTIVE
token and managing state.
402-403
:fetch_document_start
method logic is correct.The method correctly adds a
DOCUMENT-START
token, ensuring proper document initialization.Tools
Ruff
403-403:
DocumentStartToken
may be undefined, or defined from star imports(F405)
405-406
:fetch_document_end
method logic is correct.The method correctly adds a
DOCUMENT-END
token, finalizing the document processing.Tools
Ruff
406-406:
DocumentEndToken
may be undefined, or defined from star imports(F405)
424-425
:fetch_flow_sequence_start
method logic is correct.The method correctly adds a
FLOW-SEQUENCE-START
token, ensuring proper sequence initialization.Tools
Ruff
425-425:
FlowSequenceStartToken
may be undefined, or defined from star imports(F405)
427-428
:fetch_flow_mapping_start
method logic is correct.The method correctly adds a
FLOW-MAPPING-START
token, ensuring proper mapping initialization.Tools
Ruff
428-428:
FlowMappingStartToken
may be undefined, or defined from star imports(F405)
447-448
:fetch_flow_sequence_end
method logic is correct.The method correctly adds a
FLOW-SEQUENCE-END
token, finalizing the sequence processing.Tools
Ruff
448-448:
FlowSequenceEndToken
may be undefined, or defined from star imports(F405)
450-451
:fetch_flow_mapping_end
method logic is correct.The method correctly adds a
FLOW-MAPPING-END
token, finalizing the mapping processing.Tools
Ruff
451-451:
FlowMappingEndToken
may be undefined, or defined from star imports(F405)
470-482
:fetch_flow_entry
method logic is correct.The method correctly adds a
FLOW-ENTRY
token, ensuring proper entry processing.Tools
Ruff
482-482:
FlowEntryToken
may be undefined, or defined from star imports(F405)
484-515
:fetch_block_entry
method logic is correct.The method correctly adds a
BLOCK-ENTRY
token, ensuring proper entry processing and state management.Tools
Ruff
498-498:
BlockSequenceStartToken
may be undefined, or defined from star imports(F405)
515-515:
BlockEntryToken
may be undefined, or defined from star imports(F405)
517-543
:fetch_key
method logic is correct.The method correctly adds a
KEY
token, ensuring proper key processing and state management.Tools
Ruff
531-531:
BlockMappingStartToken
may be undefined, or defined from star imports(F405)
543-543:
KeyToken
may be undefined, or defined from star imports(F405)
545-599
:fetch_value
method logic is correct.The method correctly adds a
VALUE
token, ensuring proper value processing and state management.Tools
Ruff
554-554:
KeyToken
may be undefined, or defined from star imports(F405)
558-559: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
561-561:
BlockMappingStartToken
may be undefined, or defined from star imports(F405)
572-576: Use a single
if
statement instead of nestedif
statements(SIM102)
584-585: Use a single
if
statement instead of nestedif
statementsCombine
if
statements usingand
(SIM102)
587-587:
BlockMappingStartToken
may be undefined, or defined from star imports(F405)
599-599:
ValueToken
may be undefined, or defined from star imports(F405)
601-610
:fetch_alias
method logic is correct.The method correctly adds an
ALIAS
token, ensuring proper alias processing and state management.Tools
Ruff
610-610:
AliasToken
may be undefined, or defined from star imports(F405)
612-621
:fetch_anchor
method logic is correct.The method correctly adds an
ANCHOR
token, ensuring proper anchor processing and state management.Tools
Ruff
621-621:
AnchorToken
may be undefined, or defined from star imports(F405)
623-632
:fetch_tag
method logic is correct.The method correctly adds a
TAG
token, ensuring proper tag processing and state management.
634-636
:fetch_literal
method logic is correct.The method correctly adds a
SCALAR
token for literal scalars, ensuring proper processing and state management.
637-639
:fetch_folded
method logic is correct.The method correctly adds a
SCALAR
token for folded scalars, ensuring proper processing and state management.
651-653
:fetch_single
method logic is correct.The method correctly adds a
SCALAR
token 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
Scanner
class is comprehensive, but managing state variables likeflow_level
,tokens
, andpossible_simple_keys
can 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, Resolver
Committable 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_START
instead ofcold_start
Replace
cold_start
withCOLD_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
if
statement instead of nestedif
statementsCombine
if
statements 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 logic
Tools
Ruff
274-274:
AliasToken
may be undefined, or defined from star imports(F405)
276-276:
AliasEvent
may be undefined, or defined from star imports(F405)
282-282:
AnchorToken
may be undefined, or defined from star imports(F405)
287-287:
TagToken
may be undefined, or defined from star imports(F405)
292-292:
TagToken
may be undefined, or defined from star imports(F405)
297-297:
AnchorToken
may be undefined, or defined from star imports(F405)
319-319:
BlockEntryToken
may be undefined, or defined from star imports(F405)
321-321:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
325-325:
ScalarToken
may be undefined, or defined from star imports(F405)
334-334:
ScalarEvent
may be undefined, or defined from star imports(F405)
337-337:
FlowSequenceStartToken
may be undefined, or defined from star imports(F405)
339-339:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
342-342:
FlowMappingStartToken
may be undefined, or defined from star imports(F405)
344-344:
MappingStartEvent
may be undefined, or defined from star imports(F405)
347-347:
BlockSequenceStartToken
may be undefined, or defined from star imports(F405)
349-349:
SequenceStartEvent
may be undefined, or defined from star imports(F405)
352-352:
BlockMappingStartToken
may be undefined, or defined from star imports(F405)
354-354:
MappingStartEvent
may be undefined, or defined from star imports(F405)
360-360:
ScalarEvent
may 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:
re
imported but unusedRemove unused import:
re
(F401)
9-9:
json
imported but unusedRemove unused import:
json
(F401)
10-10:
time.sleep
imported but unusedRemove unused import:
time.sleep
(F401)
11-11: Redefinition of unused
Dict
from line 6Remove definition:
Dict
(F811)
11-11: Redefinition of unused
Tuple
from line 6Remove definition:
Tuple
(F811)
11-11: Redefinition of unused
List
from line 6Remove definition:
List
(F811)
18-18:
sebs.utils.DOCKER_DIR
imported 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
f
prefix(F541)
210-210: f-string without any placeholders
Remove extraneous
f
prefix(F541)
273-273: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
279-279: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
302-302: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
307-307: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
355-355: f-string without any placeholders
Remove extraneous
f
prefix(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--runtime
argument is logical.The new
--runtime
argument 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
initialize
method 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_storage
method properly initializes storage and checks for configuration.
74-82
: Shutdown method is implemented correctly.The
shutdown
method appropriately handles stopping storage and deleting the cluster if configured.
378-383
: Cached function handling looks good.The
cached_function
method 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:
re
json
time.sleep
Dict
,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_DIR
Also applies to: 18-18
Tools
Ruff
3-3:
re
imported but unusedRemove unused import:
re
(F401)
9-9:
json
imported but unusedRemove unused import:
json
(F401)
10-10:
time.sleep
imported but unusedRemove unused import:
time.sleep
(F401)
11-11: Redefinition of unused
Dict
from line 6Remove definition:
Dict
(F811)
11-11: Redefinition of unused
Tuple
from line 6Remove definition:
Tuple
(F811)
11-11: Redefinition of unused
List
from 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 res
Tools
Ruff
205-205: f-string without any placeholders
Remove extraneous
f
prefix(F541)
210-210: f-string without any placeholders
Remove extraneous
f
prefix(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 e
Tools
Ruff
273-273: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
279-279: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to 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 e
Tools
Ruff
302-302: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
307-307: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to 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 trigger
Tools
Ruff
355-355: f-string without any placeholders
Remove extraneous
f
prefix(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
@@ -200,7 +200,7 @@ def _http_invoke(self, payload: dict, url: str, verify_ssl: bool = True) -> Exec | |||
c.setopt(pycurl.SSL_VERIFYPEER, 0) | |||
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
.gitignore
to exclude.vscode
directory.