Skip to content

Commit 26d5198

Browse files
committed
disable unused hooks in PR and master workflows & fix '_Environment' object has no attribute 'INSTANCE_TYPE'
1 parent a006e8f commit 26d5198

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

ci/praktika/_environment.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class _Environment(MetaClasses.Serializable):
2626
BASE_BRANCH: str
2727
RUN_ID: str
2828
RUN_URL: str
29-
# INSTANCE_TYPE: str
30-
# INSTANCE_ID: str
31-
# INSTANCE_LIFE_CYCLE: str
29+
INSTANCE_TYPE: str
30+
INSTANCE_ID: str
31+
INSTANCE_LIFE_CYCLE: str
3232
PR_BODY: str
3333
PR_TITLE: str
3434
USER_LOGIN: str
@@ -138,7 +138,7 @@ def from_env(cls) -> "_Environment":
138138
else:
139139
assert False, "TODO: not supported"
140140

141-
# NOTE (strtgbb): Disable instance metadata, we don't use it
141+
# NOTE (strtgbb): Override instance metadata, we don't use it
142142
# INSTANCE_TYPE = (
143143
# os.getenv("INSTANCE_TYPE", None)
144144
# or Shell.get_output("ec2metadata --instance-type")
@@ -156,6 +156,9 @@ def from_env(cls) -> "_Environment":
156156
# )
157157
# or ""
158158
# )
159+
INSTANCE_TYPE = "altinity-self-hosted"
160+
INSTANCE_ID = "altinity-self-hosted"
161+
INSTANCE_LIFE_CYCLE = "altinity-self-hosted"
159162

160163
else:
161164
print("WARNING: Local execution - dummy Environment will be generated")
@@ -183,14 +186,14 @@ def from_env(cls) -> "_Environment":
183186
COMMIT_URL=COMMIT_URL,
184187
RUN_URL=RUN_URL,
185188
BASE_BRANCH=BASE_BRANCH,
186-
# INSTANCE_TYPE=INSTANCE_TYPE,
187-
# INSTANCE_ID=INSTANCE_ID,
189+
INSTANCE_TYPE=INSTANCE_TYPE,
190+
INSTANCE_ID=INSTANCE_ID,
188191
PR_BODY=PR_BODY,
189192
PR_TITLE=PR_TITLE,
190193
USER_LOGIN=USER_LOGIN,
191194
FORK_NAME=FORK_NAME,
192195
PR_LABELS=PR_LABELS,
193-
# INSTANCE_LIFE_CYCLE=INSTANCE_LIFE_CYCLE,
196+
INSTANCE_LIFE_CYCLE=INSTANCE_LIFE_CYCLE,
194197
REPORT_INFO=[],
195198
LINKED_PR_NUMBER=LINKED_PR_NUMBER,
196199
)

ci/workflows/master.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
pre_hooks=[
6767
"python3 ./ci/jobs/scripts/workflow_hooks/store_data.py",
6868
"python3 ./ci/jobs/scripts/workflow_hooks/version_log.py",
69-
"python3 ./ci/jobs/scripts/workflow_hooks/merge_sync_pr.py",
69+
# "python3 ./ci/jobs/scripts/workflow_hooks/merge_sync_pr.py", # NOTE (strtgbb): we don't do this
7070
],
7171
workflow_filter_hooks=[should_skip_job],
7272
post_hooks=[],

ci/workflows/pull_request.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,17 @@
8282
enable_merge_ready_status=True,
8383
enable_commit_status_on_failure=True,
8484
pre_hooks=[
85-
can_be_trusted,
85+
# can_be_trusted, # NOTE (strtgbb): relies on labels we don't use
8686
"python3 ./ci/jobs/scripts/workflow_hooks/store_data.py",
87-
"python3 ./ci/jobs/scripts/workflow_hooks/pr_description.py",
87+
# "python3 ./ci/jobs/scripts/workflow_hooks/pr_description.py", # NOTE (strtgbb): relies on labels we don't use
8888
"python3 ./ci/jobs/scripts/workflow_hooks/version_log.py",
89-
"python3 ./ci/jobs/scripts/workflow_hooks/quick_sync.py",
89+
# "python3 ./ci/jobs/scripts/workflow_hooks/quick_sync.py", # NOTE (strtgbb): we don't do this
9090
"python3 ./ci/jobs/scripts/workflow_hooks/new_tests_check.py",
9191
],
9292
workflow_filter_hooks=[should_skip_job],
9393
post_hooks=[
94-
"python3 ./ci/jobs/scripts/workflow_hooks/feature_docs.py",
95-
"python3 ./ci/jobs/scripts/workflow_hooks/can_be_merged.py",
94+
# "python3 ./ci/jobs/scripts/workflow_hooks/feature_docs.py", # NOTE (strtgbb): we don't build docs
95+
# "python3 ./ci/jobs/scripts/workflow_hooks/can_be_merged.py", # NOTE (strtgbb): relies on labels we don't use
9696
],
9797
)
9898

0 commit comments

Comments
 (0)