Skip to content

Pull request dedicated to support analysis and integration of the functional modules designed for ANAC project 2024 #4393

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

Open
wants to merge 27 commits into
base: anac/wb2024/start
Choose a base branch
from

Conversation

@evilaliv3 evilaliv3 requested a review from a team as a code owner February 10, 2025 07:07
Copy link

codacy-production bot commented Feb 10, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-7.05% (target: -0.10%) 48.64% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (904efe8) 18560 15121 81.47%
Head commit (83bde6e) 30574 (+12014) 22754 (+7633) 74.42% (-7.05%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4393) 5389 2621 48.64%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@evilaliv3 evilaliv3 changed the title Anac/wb2024/accreditation forwarding report antivirus Pull request dedicated to support analysis and integration of the functional modules designed for ANAC project 2024 Feb 10, 2025
…criber.organization_name

Change necessary to anticipate fix on migration 69 to properly handle the situation
@evilaliv3 evilaliv3 force-pushed the anac/wb2024/accreditation_forwarding_report_antivirus branch from 7d49b79 to 92e203e Compare February 10, 2025 07:36
@evilaliv3 evilaliv3 force-pushed the devel branch 12 times, most recently from 7e993d2 to 50018b4 Compare February 10, 2025 22:18
@evilaliv3 evilaliv3 changed the base branch from devel to anac/wb2024/start February 12, 2025 07:41
except ValueError:
return False

def find_statistical_info(session, tid:str, answers:dict, default_language:str):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alessiofranceschini @joeman65: this function should probably be recursive or it will ignore statistical questions that are part of a group or subgroup.

def find_statistical_info(session, tid:str, answers:dict, default_language:str):
answers_dict = dict()
for k, v in answers.items():
field = db_get(session, models.Field, (models.Field.id == k, models.Field.tid == tid))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alessiofranceschini @joeman65: this query, defined inside a For loop, will be probably cause of significant inefficient on questionnaires with a lot of questions. Probably it should be optimized parsing the dictionary and then performing one single query.

try:
with sf.open('rb') as encrypted_file, \
GCE.streaming_encryption_open('ENCRYPT', key, dest_path) as seo:
id_file = dest_path.split('/')[-1]
chunk = encrypted_file.read(abstract.FileDescriptor.bufferSize)
Copy link
Member Author

@evilaliv3 evilaliv3 May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alessiofranceschini : still this appear to read a file of 1GB chunk by chunk and analyze a single chunk. This will result in failure in recognizing viruses.

In case you will need to fix this, you will find the fix in our merge as we are proceeding fixing this in our integration.

logging.info(file_name)
try:
cd = pyclamd.ClamdNetworkSocket(self._host, int(self._port))
result = cd.scan_stream(data_bytes)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alessiofranceschini : still is the usage of a streaming API but externally it will block till all the bytes are processed so this _scan_file function should be run in a deferredThread to not block the process when running it.

In case you will need to fix this, you will find the fix in our merge as we are proceeding fixing this in our integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants