Skip to content

Commit 4cc4908

Browse files
committed
Updated Automating upstream merge files
Signed-off-by: Shreejit-03 <shreejit.c@emerson.com>
1 parent 9a691ad commit 4cc4908

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

scripts/dev/upstream_merge/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ The script is user configurable and uses `automation_conf.json` to define variou
9797
- **`build_args`**:
9898
String of extra arguments to pass to the build process (e.g., `"--org"` for NI corporate network builds).
9999

100-
- **`rt_target_IP`**:
101-
The IP address or hostname of the RT target where images will be installed and tested via SSH.
100+
- **`ssh_connection`**:
101+
The SSH connection of the RT target where images will be installed.
102102

103103
**`Note`**:
104104
- If the configuration file is `automation_conf.json`, you do not need to specify its path explicitly, as it is set as default. However, if you are using a different configuration file, you must provide its path using the `-c` argument.

scripts/dev/upstream_merge/automation_conf.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"fork_name": "myfork",
99
"email_log_level": 1,
1010
"log_level": 10,
11-
"email_from": "shreejit.c@emerson.com",
12-
"email_to": "pratheeksha.s.n@emerson.com",
11+
"email_from": "",
12+
"email_to": "",
1313
"username": "",
1414
"build_args":"",
15-
"rt_target_IP":""
15+
"ssh_connection":""
1616
}

scripts/dev/upstream_merge/json_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ def __init__(self, automation_conf_path, work_item_id):
2626
self.email_log_level = config.get("email_log_level")
2727
self.log_level = config.get("log_level")
2828
self.build_args = config.get("build_args", "")
29-
self.rt_target_IP = config.get("rt_target_IP")
29+
self.ssh_connection = config.get("ssh_connection")

scripts/dev/upstream_merge/upstream_merge_and_test.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,20 @@ def merge_submodules_with_upstream(
120120
return merge_report
121121

122122

123-
def build_and_test(clean_build, rt_target_IP, build_args):
123+
def build_and_test(clean_build, ssh_connection, build_args):
124124
"""
125125
Build images and run tests on a VM if there are no merge errors.
126126
127127
:param clean_build: Boolean indicating whether to perform a clean build.
128-
:param rt_target_IP: The target IP address of the RT system.
128+
:param ssh_connection: The SSH connection string for the RT system.
129129
:param build_args: To build with NI specific arguments.
130130
:return: A tuple (status_code, message).
131131
Returns (0, None) on success, or error details on failure.
132132
"""
133133
success = setup_env_and_build_packages(build_args, clean_build)
134134
if success[0] != 0:
135135
return success
136-
success = install_and_test_image(rt_target_IP)
136+
success = install_and_test_image(ssh_connection)
137137
return success
138138

139139

@@ -158,6 +158,7 @@ def push_submodules_and_create_PRs(
158158
:param username: GitHub username owning the downstream fork.
159159
:return: Dictionary with push and PR results for each sub-module.
160160
"""
161+
current_dir = os.getcwd()
161162
push_and_pr_results = {}
162163
for git_obj, (status, message) in list(merge_report.items()):
163164
if status == 0 and message is not None:
@@ -169,6 +170,7 @@ def push_submodules_and_create_PRs(
169170
pr_title,
170171
pr_description
171172
)
173+
os.chdir(current_dir)
172174

173175
return push_and_pr_results
174176

@@ -192,7 +194,7 @@ def get_pr_description(work_item_id):
192194
)
193195
return (
194196
f"Merge latest from upstream. No conflicts."
195-
f"{work_item_line}\n\n{checklist}"
197+
f"{work_item_line}\n\n{checklist}\n@ni/rtos"
196198
)
197199

198200

@@ -293,7 +295,7 @@ def main():
293295
else:
294296
build_and_test_details = build_and_test(
295297
clean_build=skip_merge,
296-
rt_target_IP=json_config_obj.rt_target_IP,
298+
ssh_connection=json_config_obj.ssh_connection,
297299
build_args=json_config_obj.build_args,
298300
)
299301

@@ -305,7 +307,7 @@ def main():
305307
get_pr_description(json_config_obj.work_item_id),
306308
json_config_obj.username,
307309
)
308-
merge_report["Push and pr"] = push_and_pr_results
310+
merge_report["Push and PR"] = push_and_pr_results
309311

310312
merge_report["Build and Test"] = build_and_test_details
311313

scripts/dev/upstream_merge/utils/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def clean_feeds_and_images(args=""):
7676
"""
7777
print("\nCleaning build feeds and images...\n")
7878
return execute_and_stream_cmd_output(
79-
"bash scripts/pipelines/clean_build.core-feeds_and_core-images.sh "
79+
"bash scripts/pipelines/clean.core-feeds_and_core-images.sh "
8080
f"{args}"
8181
)
8282

0 commit comments

Comments
 (0)