Skip to content

Commit 4cbbf2c

Browse files
V3.2 features and deprecation (#172)
## Pull Request Template ### Prerequisites <!-- Take a couple of minutes to help our maintainers work faster by checking of the pre-requisites. --> <!-- To tick the checkboxes replace the space with an 'x', so [ ] becomes [x] . --> - [x] I have [searched](https://github.com/DefinetlyNotAI/Logicytics/pulls) for duplicate or closed issues. - [x] I have read the [contributing guidelines](https://github.com/DefinetlyNotAI/Logicytics/blob/main/CONTRIBUTING.md). - [x] I have followed the instructions in the [wiki](https://github.com/DefinetlyNotAI/Logicytics/wiki) about contributions. - [x] I have updated the documentation accordingly, if required. - [x] I have tested my code with the `--dev` flag, if required. ### PR Type <!-- Take a couple of minutes to help our maintainers work faster by telling us what is the PR guided on. --> <!-- To tick the checkboxes replace the space with an 'x', so [ ] becomes [x] . --> - [ ] Bug fix <!-- Non-Breaking Bug Fix - Usually relates to fixing an issue --> - [x] Deprecation Change <!-- Removing a deprecation --> - [ ] New feature <!-- Non-Breaking Change that adds a new feature --> - [ ] Refactoring <!-- Non-Breaking Change that modifies existing code to refactor it to become more organised --> - [ ] Documentation update <!-- Non-Breaking Change that modifies existing documentation to refactor it or add extra comments - either wiki, md files or code is included here --> - [ ] ⚠️ Breaking change ⚠️ <!-- Breaking Bug Fix / New Addition that changes how Logicytics works --> ### Description This pull request includes several changes to deprecate outdated features, improve code organization, and update documentation. The most important changes include deprecating the `extra` and `unzip-extra` features, updating the `VulnScan` documentation, and removing the `_extra.py` file. #### Deprecation of outdated features: * [`CODE/Logicytics.py`](diffhunk://#diff-44a988332704ab86171610dcfe391d08df0f70f8177c3463e6e089aec9c5baa0R138-R147): Deprecated the `extra` and `unzip-extra` features and added warnings for their usage. [[1]](diffhunk://#diff-44a988332704ab86171610dcfe391d08df0f70f8177c3463e6e089aec9c5baa0R138-R147) [[2]](diffhunk://#diff-44a988332704ab86171610dcfe391d08df0f70f8177c3463e6e089aec9c5baa0R179-R186) * [`CODE/logicytics/Flag.py`](diffhunk://#diff-28c69e4247379f685aaf5eb5f582b0641d3247f99db1730a04e10170f6f2497dL134-L148): Moved the `--extra` and `--unzip-extra` flags to a deprecated section and added a method to display the help menu. [[1]](diffhunk://#diff-28c69e4247379f685aaf5eb5f582b0641d3247f99db1730a04e10170f6f2497dL134-L148) [[2]](diffhunk://#diff-28c69e4247379f685aaf5eb5f582b0641d3247f99db1730a04e10170f6f2497dR171-R186) [[3]](diffhunk://#diff-28c69e4247379f685aaf5eb5f582b0641d3247f99db1730a04e10170f6f2497dR277-R284) #### Documentation updates: * [`CODE/VulnScan/README.md`](diffhunk://#diff-334cc7dff881eaa0e3d249719b5478f9970bcd2b865157abc058c0c88f50389aR3-R8): Added a warning about the upcoming move of `VulnScan` to a different repository. #### Code organization: * [`CODE/VulnScan/v3/_generate_data.py`](diffhunk://#diff-954f866569d6c0606ee08ff8d601030d0224e2190aa90761c7b1bed0099082c5R3-R10): Reorganized imports and added a deprecation warning for the `SenseMacro` feature. [[1]](diffhunk://#diff-954f866569d6c0606ee08ff8d601030d0224e2190aa90761c7b1bed0099082c5R3-R10) [[2]](diffhunk://#diff-954f866569d6c0606ee08ff8d601030d0224e2190aa90761c7b1bed0099082c5R188-R192) [[3]](diffhunk://#diff-954f866569d6c0606ee08ff8d601030d0224e2190aa90761c7b1bed0099082c5L195-L200) #### Removal of deprecated files: * [`CODE/_extra.py`](diffhunk://#diff-31b299e38dccd5bfbb4c369ed2336200d55bc112b5d0e46ee7f0e6ad33f2bbccL1-L58): Removed the `_extra.py` file as part of the deprecation process. ### Motivation and Context Removal of many deprecated functions, to reorganise Logicytics ### Credit <!-- If this PR is a contribution, please mention the contributors here using the appropriate syntax. --> <!-- ### File-Created/CONTRIBUTION by MAIN-Username What you did, created, removed, refactored, fixed, or discovered. - [Your GitHub Username](https://github.com/YourGitHubLink) - [Your GitHub Username](https://github.com/YourGitHubLink) etc... --> _N/A_ ### Issues Fixed <!-- REQUIRED: What issues will be fixed? (Format: "#50, #23" etc.) if none exist type _N/A_ --> _N/A_ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a checkbox option for "Deprecation Change" in the pull request template. - Introduced a new static method to display the help menu in the Flag class. - **Bug Fixes** - Enhanced error handling for deprecated features and improved logging during script execution. - **Documentation** - Updated VulnScan documentation to include a warning about migration to a different repository. - Made textual and structural improvements in the README.md for clarity. - **Chores** - Removed deprecated files and tasks from the project. - Updated version number in the configuration file. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents add3ec8 + 729e737 commit 4cbbf2c

File tree

12 files changed

+84
-696
lines changed

12 files changed

+84
-696
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<!-- To tick the checkboxes replace the space with an 'x', so [ ] becomes [x] . -->
1818

1919
- [ ] Bug fix <!-- Non-Breaking Bug Fix - Usually relates to fixing an issue -->
20+
- [ ] Deprecation Change <!-- Removing a deprecation -->
2021
- [ ] New feature <!-- Non-Breaking Change that adds a new feature -->
2122
- [ ] Refactoring <!-- Non-Breaking Change that modifies existing code to refactor it to become more organised -->
2223
- [ ] Documentation

.github/workflows/file-mod-restrict.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

CODE/Logicytics.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
import zipfile
88
from datetime import datetime
99
from typing import Any
10+
1011
from prettytable import PrettyTable
11-
from pathlib import Path
1212

1313
from logicytics import Log, Execute, Check, Get, FileManagement, Flag, DEBUG, DELETE_LOGS
1414

15-
1615
# Initialization
1716
FileManagement.mkdir()
1817
log = Log({"log_level": DEBUG, "delete_log": DELETE_LOGS})
@@ -136,9 +135,13 @@ def handle_special_actions():
136135
log.info("Opening developer menu...")
137136
special_execute("_dev.py")
138137

138+
# Deprecated, remove in v3.3.0
139139
if ACTION == "extra":
140-
log.info("Opening extra tools menu...")
141-
special_execute("_extra.py")
140+
print("\033[91mDeprecationWarning: The `extra` feature has been removed! 🚫\n"
141+
"Why? It didn't match our code quality standards.\n"
142+
"What to use instead? Check out our new features with --help\033[0m")
143+
input("Press Enter to exit...")
144+
exit(0)
142145

143146
if ACTION == "update":
144147
log.info("Updating...")
@@ -170,14 +173,11 @@ def handle_special_actions():
170173
input("Press Enter to exit...")
171174
exit(0)
172175

176+
# Deprecated, remove in v3.3.0
173177
if ACTION == "unzip_extra":
174-
log.warning(
175-
"The contents of this directory can be flagged as malicious and enter quarantine, please use with "
176-
"caution"
177-
)
178-
log.info("Unzipping...")
179-
FileManagement.unzip(Path("..\\EXTRA\\EXTRA.zip"))
180-
log.info("Unzip complete!")
178+
print("\033[91mDeprecationWarning: The `unzip_extra` feature has been removed! 🚫\n"
179+
"Why? It didn't match our code quality standards.\n"
180+
"What to use instead? Check out our new features with --help\033[0m")
181181
input("Press Enter to exit...")
182182
exit(0)
183183

@@ -327,12 +327,13 @@ def threaded_execution(execution_list_thread, index_thread):
327327

328328
def zip_generated_files():
329329
"""Zips generated files based on the action."""
330+
330331
def zip_and_log(directory: str, name: str):
331332
log.debug(f"Zipping directory '{directory}' with name '{name}' under action '{ACTION}'")
332333
zip_values = FileManagement.Zip.and_hash(
333-
directory,
334-
name,
335-
ACTION if ACTION is not None else f"ERROR_NO_ACTION_SPECIFIED_{datetime.now().isoformat()}"
334+
directory,
335+
name,
336+
ACTION if ACTION is not None else f"ERROR_NO_ACTION_SPECIFIED_{datetime.now().isoformat()}"
336337
)
337338
if isinstance(zip_values, str):
338339
log.error(zip_values)
@@ -362,8 +363,8 @@ def handle_sub_action():
362363
elif SUB_ACTION == "reboot":
363364
subprocess.call("shutdown /r /t 3", shell=False)
364365
# elif sub_action == "webhook":
365-
# Implement this in future
366-
# log.warning("This feature is not implemented yet! Sorry")
366+
# Implement this in future
367+
# log.warning("This feature is not implemented yet! Sorry")
367368

368369

369370
if __name__ == "__main__":

CODE/VulnScan/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# VulnScan Documentation
22

3+
> [!WARNING]
4+
> # VulnScan Migration Notice 🚨
5+
>
6+
> VulnScan is moving to a new home! Here's what you need to know:
7+
> - This repository section will be archived
8+
> - A link to the new repository will be added here
9+
> - The `pkl` and `pth` files will stay here (they'll work with `vulnscan.py`)
10+
> - VulnScan itself will NOT be moved to the other repository
11+
>
12+
> This will occur in version `3.2.0` of Logicytics.
13+
314
## Overview
415

516
VulnScan is designed to detect sensitive data across various file formats. It offers a modular framework to train models using diverse algorithms, from traditional ML classifiers to advanced Neural Networks. This document outlines the system's naming conventions, lifecycle, and model configuration.

0 commit comments

Comments
 (0)