Skip to content

Commit fc3545d

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

5 files changed

Lines changed: 19 additions & 14 deletions

File tree

scripts/dev/upstream_merge/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ 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.
102+
Usage example: [username]@[hostname or IP address]
102103

103104
**`Note`**:
104105
- 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: 11 additions & 7 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:
@@ -170,6 +171,7 @@ def push_submodules_and_create_PRs(
170171
pr_description
171172
)
172173

174+
os.chdir(current_dir)
173175
return push_and_pr_results
174176

175177

@@ -181,18 +183,20 @@ def get_pr_description(work_item_id):
181183
:return: A formatted string containing the PR checklist and work item.
182184
"""
183185
checklist = (
186+
"# Testing\n"
187+
"- [x] Built pyrex container\n"
184188
"- [x] bitbake packagefeed-ni-core\n"
185189
"- [x] bitbake packagegroup-ni-desirable\n"
186190
"- [x] bitbake package-index && bitbake nilrt-base-system-image\n"
187191
"- [x] Installed BSI on a VM and verified it boots successfully"
188192
)
189193
work_item_line = (
190-
f"\n\nAB#{work_item_id}\n"
194+
f"\n# Justification\nAB#{work_item_id}\n"
191195
if work_item_id is not None else ""
192196
)
193197
return (
194198
f"Merge latest from upstream. No conflicts."
195-
f"{work_item_line}\n\n{checklist}"
199+
f"{work_item_line}\n\n{checklist}\n@ni/rtos"
196200
)
197201

198202

@@ -293,7 +297,7 @@ def main():
293297
else:
294298
build_and_test_details = build_and_test(
295299
clean_build=skip_merge,
296-
rt_target_IP=json_config_obj.rt_target_IP,
300+
ssh_connection=json_config_obj.ssh_connection,
297301
build_args=json_config_obj.build_args,
298302
)
299303

@@ -305,7 +309,7 @@ def main():
305309
get_pr_description(json_config_obj.work_item_id),
306310
json_config_obj.username,
307311
)
308-
merge_report["Push and pr"] = push_and_pr_results
312+
merge_report["Push and PR"] = push_and_pr_results
309313

310314
merge_report["Build and Test"] = build_and_test_details
311315

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)