Skip to content

Commit 894a672

Browse files
authored
Merge pull request #2 from BenjaminArp/main
Fixed Bug in .txt files of model variants using the provided error_replacer.py
2 parents fc00fac + 03424b5 commit 894a672

File tree

96 files changed

+146
-116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+146
-116
lines changed

dataset/anilallewar_microservices-basics-spring-boot/model_variants/12.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ digraph dfd2{
4949
auth_server -> api_gateway [label = " --restful_http--\n"]
5050
api_gateway -> user_webservice [label = " --restful_http--\n--load_balanced_link--\n--circuit_breaker_link--\n"]
5151
api_gateway -> task_webservice [label = " --restful_http--\n--load_balanced_link--\n--circuit_breaker_link--\n"]
52-
message_broker [label = "{Process: message_broker | --infrastructural--\n--message_broker--}" shape = Mrecord];
52+
message_broker [label = "{Process: message_broker | --infrastructural--\n--message_broker--\n}" shape = Mrecord];
5353
message_broker -> web_portal [label = " --restful_http--\n"]
5454
user_webservice -> message_broker [label = " --restful_http--\n"]
5555
comments_webservice -> message_broker [label = " --restful_http--\n"]

dataset/anilallewar_microservices-basics-spring-boot/model_variants/18.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ digraph dfd2{
4949
auth_server -> api_gateway [label = " --restful_http--\n"]
5050
api_gateway -> user_webservice [label = " --restful_http--\n--load_balanced_link--\n--circuit_breaker_link--\n"]
5151
api_gateway -> task_webservice [label = " --restful_http--\n--load_balanced_link--\n--circuit_breaker_link--\n"]
52-
secret_manager [label = "{Process: secret_manager | --infrastructural--\n--secret_manager--}" shape = Mrecord];
52+
secret_manager [label = "{Process: secret_manager | --infrastructural--\n--secret_manager--\n}" shape = Mrecord];
5353
api_gateway -> secret_manager [label = " --restful_http--"]
5454
configserver -> secret_manager [label = " --restful_http--"]
5555
webservice_registry -> secret_manager [label = " --restful_http--"]

dataset/apssouza22_java-microservice/model_variants/18.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ digraph dfd2{
5757
mailer -> logstash [label = " --restful_http--\n"]
5858
jmx_monitoring [label = "{Process: jmx_monitoring | --internal--\n}" shape = Mrecord];
5959
todo_infra [label = "{Process: todo_infra | --internal--\n}" shape = Mrecord];
60-
secret_manager [label = "{Process: secret_manager | --infrastructural-- \n --secret_manager--}" shape = Mrecord];
60+
secret_manager [label = "{Process: secret_manager | --infrastructural-- \n --secret_manager--\n}" shape = Mrecord];
6161
config_server -> secret_manager [label = " --restful_http--\n"]
6262
admin -> secret_manager [label = " --restful_http--\n"]
6363
eureka_server -> secret_manager [label = " --restful_http--\n"]

dataset/callistaenterprise_blog-microservices/model_variants/18.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ digraph dfd2{
5858
config_server -> edge_server [label = " --restful_http--\n"]
5959
edge_server -> auth_server [label = " --restful_http--\n"]
6060

61-
secret_manager [label = "{Process: secret_manager | --infrastructural-- \n --secret_manager--}" shape = Mrecord];
61+
secret_manager [label = "{Process: secret_manager | --infrastructural-- \n --secret_manager--\n}" shape = Mrecord];
6262
elasticsearch -> secret_manager [label = " --restful_http--\n"]
6363
kibana -> secret_manager [label = " --restful_http--\n"]
6464
logstash -> secret_manager [label = " --restful_http--\n"]

dataset/error_replacer.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from pathlib import Path
2+
import re
3+
4+
def replace_in_file(file_path):
5+
try:
6+
if not file_path.exists():
7+
print(f"File does not exist: {file_path}")
8+
return
9+
10+
content = file_path.read_text(encoding='utf-8')
11+
modified_content = re.sub(r'--\}', r'--\\n}', content)
12+
13+
if content != modified_content:
14+
file_path.write_text(modified_content, encoding='utf-8')
15+
print(f"Updated file: {file_path}")
16+
else:
17+
print(f"No changes needed: {file_path}")
18+
19+
except Exception as e:
20+
print(f"Error processing file {file_path}: {e}")
21+
22+
def process_all_subfolders(root_dir):
23+
root_path = Path(root_dir)
24+
# Using rglob to recursively find all .txt files
25+
for file_path in root_path.rglob('*.txt'):
26+
replace_in_file(file_path)
27+
28+
# Example usage:
29+
root_dir = Path(r'put\your\root\dir\here') #set root dir
30+
process_all_subfolders(root_dir)

dataset/ewolff_microservice-kafka/model_variants/10.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ digraph dfd2{
2929
postgres -> shipping [label = " --jdbc--\n--plaintext_credentials_link--\n'Username': dbuser\n 'Password': dbpass\n"]
3030
postgres -> invoicing [label = " --jdbc--\n--plaintext_credentials_link--\n'Username': dbuser\n 'Password': dbpass\n"]
3131

32-
monitoring_dashboard [label = "{Process: monitoring_dashboard | \n--infrastructural--\n--monitoring_dashboard--\n--local_logging--}" shape = Mrecord];
33-
logging_server [label = "{Process: logging_server | --infrastructural--\n--logging_server--}" shape = Mrecord];
32+
monitoring_dashboard [label = "{Process: monitoring_dashboard | \n--infrastructural--\n--monitoring_dashboard--\n--local_logging--\n}" shape = Mrecord];
33+
logging_server [label = "{Process: logging_server | --infrastructural--\n--logging_server--\n}" shape = Mrecord];
3434
logging_server -> monitoring_dashboard [label = " --restful_http--\n"]
3535
zookeeper -> logging_server [label = " --restful_http--\n"]
3636
kafka -> logging_server [label = " --restful_http--\n"]

dataset/ewolff_microservice-kafka/model_variants/11.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ digraph dfd2{
2929
postgres -> shipping [label = " --jdbc--\n--plaintext_credentials_link--\n'Username': dbuser\n 'Password': dbpass\n"]
3030
postgres -> invoicing [label = " --jdbc--\n--plaintext_credentials_link--\n'Username': dbuser\n 'Password': dbpass\n"]
3131

32-
monitoring_dashboard [label = "{Process: monitoring_dashboard | \n--infrastructural--\n--monitoring_dashboard--\n--local_logging--}" shape = Mrecord];
33-
logging_server [label = "{Process: logging_server | --infrastructural--\n--logging_server--}" shape = Mrecord];
32+
monitoring_dashboard [label = "{Process: monitoring_dashboard | \n--infrastructural--\n--monitoring_dashboard--\n--local_logging--\n}" shape = Mrecord];
33+
logging_server [label = "{Process: logging_server | --infrastructural--\n--logging_server--\n}" shape = Mrecord];
3434
logging_server -> monitoring_dashboard [label = " --restful_http--\n"]
3535
zookeeper -> logging_server [label = " --restful_http--\n"]
3636
kafka -> logging_server [label = " --restful_http--\n"]

dataset/ewolff_microservice-kafka/model_variants/12.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ digraph dfd2{
2929
postgres -> shipping [label = " --jdbc--\n--plaintext_credentials_link--\n'Username': dbuser\n 'Password': dbpass\n"]
3030
postgres -> invoicing [label = " --jdbc--\n--plaintext_credentials_link--\n'Username': dbuser\n 'Password': dbpass\n"]
3131

32-
monitoring_dashboard [label = "{Process: monitoring_dashboard | \n--infrastructural--\n--monitoring_dashboard--\n--local_logging--}" shape = Mrecord];
33-
logging_server [label = "{Process: logging_server | --infrastructural--\n--logging_server--}" shape = Mrecord];
32+
monitoring_dashboard [label = "{Process: monitoring_dashboard | \n--infrastructural--\n--monitoring_dashboard--\n--local_logging--\n}" shape = Mrecord];
33+
logging_server [label = "{Process: logging_server | --infrastructural--\n--logging_server--\n}" shape = Mrecord];
3434
logging_server -> monitoring_dashboard [label = " --restful_http--\n"]
3535
kafka -> logging_server [label = " --restful_http--\n"]
3636
zookeeper -> kafka [label = " --restful_http--\n"]

dataset/ewolff_microservice-kafka/model_variants/16.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ digraph dfd2{
2929
postgres -> shipping [label = " --jdbc--\n--plaintext_credentials_link--\n'Username': dbuser\n 'Password': dbpass\n"]
3030
postgres -> invoicing [label = " --jdbc--\n--plaintext_credentials_link--\n'Username': dbuser\n 'Password': dbpass\n"]
3131

32-
service_discovery [label = "{Process: service_discovery | --infrastructural--\n--service_discovery--}" shape = Mrecord];
32+
service_discovery [label = "{Process: service_discovery | --infrastructural--\n--service_discovery--\n}" shape = Mrecord];
3333
zookeeper -> service_discovery [label = " --restful_http--\n"]
3434
kafka -> service_discovery [label = " --restful_http--\n"]
3535
order -> service_discovery [label = " --restful_http--\n"]

dataset/ewolff_microservice-kafka/model_variants/17.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ digraph dfd2{
2929
postgres -> shipping [label = " --jdbc--\n--plaintext_credentials_link--\n'Username': dbuser\n 'Password': dbpass\n"]
3030
postgres -> invoicing [label = " --jdbc--\n--plaintext_credentials_link--\n'Username': dbuser\n 'Password': dbpass\n"]
3131

32-
service_discovery [label = "{Process: service_discovery | --infrastructural--\n--service_discovery--\n--validate_registration--}" shape = Mrecord];
32+
service_discovery [label = "{Process: service_discovery | --infrastructural--\n--service_discovery--\n--validate_registration--\n}" shape = Mrecord];
3333
zookeeper -> service_discovery [label = " --restful_http--\n"]
3434
kafka -> service_discovery [label = " --restful_http--\n"]
3535
order -> service_discovery [label = " --restful_http--\n"]

0 commit comments

Comments
 (0)