8
8
import os
9
9
from abc import ABC , abstractmethod
10
10
from functools import cached_property
11
+ from pathlib import Path
11
12
from typing import ClassVar , List , Optional
12
13
13
14
import requests # type: ignore
@@ -124,16 +125,33 @@ class QaChecks(SimpleDockerStep):
124
125
"""
125
126
126
127
def __init__ (self , context : ConnectorContext ) -> None :
128
+ code_directory = context .connector .code_directory
129
+ documentation_file_path = context .connector .documentation_file_path
130
+ migration_guide_file_path = context .connector .migration_guide_file_path
131
+ icon_path = context .connector .icon_path
132
+ technical_name = context .connector .technical_name
133
+
134
+ # When the connector is strict-encrypt, we should run QA checks on the main one as it's the one whose artifacts gets released
135
+ if context .connector .technical_name .endswith ("-strict-encrypt" ):
136
+ technical_name = technical_name .replace ("-strict-encrypt" , "" )
137
+ code_directory = Path (str (code_directory ).replace ("-strict-encrypt" , "" ))
138
+ if documentation_file_path :
139
+ documentation_file_path = Path (str (documentation_file_path ).replace ("-strict-encrypt" , "" ))
140
+ if migration_guide_file_path :
141
+ migration_guide_file_path = Path (str (migration_guide_file_path ).replace ("-strict-encrypt" , "" ))
142
+ if icon_path :
143
+ icon_path = Path (str (icon_path ).replace ("-strict-encrypt" , "" ))
144
+
127
145
super ().__init__ (
128
- title = f"Run QA checks for { context . connector . technical_name } " ,
146
+ title = f"Run QA checks for { technical_name } " ,
129
147
context = context ,
130
148
paths_to_mount = [
131
- MountPath (context . connector . code_directory ),
149
+ MountPath (code_directory ),
132
150
# These paths are optional
133
151
# But their absence might make the QA check fail
134
- MountPath (context . connector . documentation_file_path , optional = True ),
135
- MountPath (context . connector . migration_guide_file_path , optional = True ),
136
- MountPath (context . connector . icon_path , optional = True ),
152
+ MountPath (documentation_file_path , optional = True ),
153
+ MountPath (migration_guide_file_path , optional = True ),
154
+ MountPath (icon_path , optional = True ),
137
155
],
138
156
internal_tools = [
139
157
MountPath (INTERNAL_TOOL_PATHS .CONNECTORS_QA .value ),
@@ -146,7 +164,7 @@ def __init__(self, context: ConnectorContext) -> None:
146
164
}.items ()
147
165
if v
148
166
},
149
- command = ["connectors-qa" , "run" , f"--name={ context . connector . technical_name } " ],
167
+ command = ["connectors-qa" , "run" , f"--name={ technical_name } " ],
150
168
)
151
169
152
170
0 commit comments