* Re: [PATCH] tools: run check-meson.py in create_series_artifact
2024-10-15 21:32 [PATCH] tools: run check-meson.py in create_series_artifact Manit Mahajan
@ 2024-10-15 22:26 ` Patrick Robb
2024-10-15 22:27 ` Patrick Robb
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Patrick Robb @ 2024-10-15 22:26 UTC (permalink / raw)
To: Manit Mahajan; +Cc: ci, thomas, aconole, bruce.richardson
[-- Attachment #1: Type: text/plain, Size: 784 bytes --]
Looks good, thanks Manit.
I know we have discussed this in person, but I'll just flag here that
obviously in building our check-meson CI testing usage around parsing the
human readable stdout, we expose ourselves to a slight risk in that someone
could change what the script prints without realizing it is being read in
CI. But, this is unlikely to happen - there are not so many devtools
scripts and I think developers understand these are in use in CI testing.
If we want, we can offer to add a flag for the script which would produce a
standard output (some json perhaps). But, we don't need to do this now.
Aaron (the ci project maintainer) is out of office this week, but we can
touch base with him next week to get this merged. And I'll add it to the CI
minutes for Thursday.
[-- Attachment #2: Type: text/html, Size: 876 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tools: run check-meson.py in create_series_artifact
2024-10-15 21:32 [PATCH] tools: run check-meson.py in create_series_artifact Manit Mahajan
2024-10-15 22:26 ` Patrick Robb
@ 2024-10-15 22:27 ` Patrick Robb
2024-10-18 17:24 ` Patrick Robb
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Patrick Robb @ 2024-10-15 22:27 UTC (permalink / raw)
To: Manit Mahajan; +Cc: ci, thomas, aconole, bruce.richardson
[-- Attachment #1: Type: text/plain, Size: 71 bytes --]
Woops, I almost forgot.
Reviewed-by: Patrick Robb <probb@iol.unh.edu>
[-- Attachment #2: Type: text/html, Size: 164 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tools: run check-meson.py in create_series_artifact
2024-10-15 21:32 [PATCH] tools: run check-meson.py in create_series_artifact Manit Mahajan
2024-10-15 22:26 ` Patrick Robb
2024-10-15 22:27 ` Patrick Robb
@ 2024-10-18 17:24 ` Patrick Robb
2024-10-18 17:28 ` Adam Hassick
2024-10-24 18:35 ` Manit Mahajan
4 siblings, 0 replies; 6+ messages in thread
From: Patrick Robb @ 2024-10-18 17:24 UTC (permalink / raw)
To: Manit Mahajan; +Cc: ci, thomas, aconole, bruce.richardson
Actually, it looks like this fails checkpatch for a too long commit
message line.
Manit I will show you checkpatch on Monday and you can submit a new version.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tools: run check-meson.py in create_series_artifact
2024-10-15 21:32 [PATCH] tools: run check-meson.py in create_series_artifact Manit Mahajan
` (2 preceding siblings ...)
2024-10-18 17:24 ` Patrick Robb
@ 2024-10-18 17:28 ` Adam Hassick
2024-10-24 18:35 ` Manit Mahajan
4 siblings, 0 replies; 6+ messages in thread
From: Adam Hassick @ 2024-10-18 17:28 UTC (permalink / raw)
To: Manit Mahajan; +Cc: ci, probb, thomas, aconole, bruce.richardson
On Tue, Oct 15, 2024 at 5:34 PM Manit Mahajan <mmahajan@iol.unh.edu> wrote:
>
> The check-meson.py is a python script that runs checks on meson.build
> files in DPDK. Checks include, splitting a line into a code part and a
> comment part, list of files are correctly indented, and more. Updating
> create_series_artifact.py to run the check-meson.py so check-meson.py can
> be run on all incoming patches. In UNH CI, we will report a build failure if the
Looks like the two lines above are too long, I am seeing a warning
when running checkpatch.
> check-meson.py reports an error.
>
> Signed-off-by: Manit Mahajan <mmahajan@iol.unh.edu>
> ---
> tools/create_series_artifact.py | 26 +++++++++++++++++++++++++-
> 1 file changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/tools/create_series_artifact.py b/tools/create_series_artifact.py
> index 550ea82..bfc97f8 100755
> --- a/tools/create_series_artifact.py
> +++ b/tools/create_series_artifact.py
> @@ -251,6 +251,24 @@ class ProjectTree(object):
> self.set_properties(apply_error=error)
> return not error
>
> +
> + def check_meson(self) -> bool:
> +
> + result = subprocess.run(
> + ['python', os.path.join(self.path, "devtools/check-meson.py"), '-d', str(self.path), '-v'],
> + cwd=self.path,
> + stdout=subprocess.PIPE,
> + stderr=subprocess.PIPE,
> + )
> +
> + self.log("Running Check Meson")
> + self.log(result.stdout.decode())
> + self.log(result.stderr.decode())
> +
> + error = "Error" in result.stdout.decode()
> + self.set_properties(meson_error=error)
> + return not error
> +
> def test_build(self) -> bool:
> ninja_result: Optional[subprocess.CompletedProcess] = None
> meson_result: subprocess.CompletedProcess = subprocess.run(
> @@ -454,8 +472,14 @@ def collect_series_info(args: argparse.Namespace) -> CreateSeriesParameters:
>
>
> def try_to_apply(tree: ProjectTree) -> bool:
> - return tree.apply_patch_series() and tree.test_build() and tree.create_tarball()
>
> + artifact_build_result = True
> + artifact_build_result &= tree.apply_patch_series()
> + artifact_build_result &= tree.check_meson()
> + artifact_build_result &= tree.test_build()
> + artifact_build_result &= tree.create_tarball()
> +
> + return artifact_build_result
>
> def main() -> int:
> data = collect_series_info(parse_args())
> --
> 2.41.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] tools: run check-meson.py in create_series_artifact
2024-10-15 21:32 [PATCH] tools: run check-meson.py in create_series_artifact Manit Mahajan
` (3 preceding siblings ...)
2024-10-18 17:28 ` Adam Hassick
@ 2024-10-24 18:35 ` Manit Mahajan
4 siblings, 0 replies; 6+ messages in thread
From: Manit Mahajan @ 2024-10-24 18:35 UTC (permalink / raw)
Cc: ci, probb, thomas, aconole, bruce.richardson, Manit Mahajan
The check-meson.py is a python script that runs checks on
Meson.build files in DPDK. Checks include, splitting a line into a
code part and a comment part, list of files are correctly indented,
and more. Updating create_series_artifact.py to run the
check-meson.py so check-meson.py can be run on all
incoming patches. In UNH CI, we will report a build failure if the
check-meson.py reports an error.
Signed-off-by: Manit Mahajan <mmahajan@iol.unh.edu>
---
tools/create_series_artifact.py | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/tools/create_series_artifact.py b/tools/create_series_artifact.py
index 550ea82..bfc97f8 100755
--- a/tools/create_series_artifact.py
+++ b/tools/create_series_artifact.py
@@ -251,6 +251,24 @@ class ProjectTree(object):
self.set_properties(apply_error=error)
return not error
+
+ def check_meson(self) -> bool:
+
+ result = subprocess.run(
+ ['python', os.path.join(self.path, "devtools/check-meson.py"), '-d', str(self.path), '-v'],
+ cwd=self.path,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ )
+
+ self.log("Running Check Meson")
+ self.log(result.stdout.decode())
+ self.log(result.stderr.decode())
+
+ error = "Error" in result.stdout.decode()
+ self.set_properties(meson_error=error)
+ return not error
+
def test_build(self) -> bool:
ninja_result: Optional[subprocess.CompletedProcess] = None
meson_result: subprocess.CompletedProcess = subprocess.run(
@@ -454,8 +472,14 @@ def collect_series_info(args: argparse.Namespace) -> CreateSeriesParameters:
def try_to_apply(tree: ProjectTree) -> bool:
- return tree.apply_patch_series() and tree.test_build() and tree.create_tarball()
+ artifact_build_result = True
+ artifact_build_result &= tree.apply_patch_series()
+ artifact_build_result &= tree.check_meson()
+ artifact_build_result &= tree.test_build()
+ artifact_build_result &= tree.create_tarball()
+
+ return artifact_build_result
def main() -> int:
data = collect_series_info(parse_args())
--
2.41.0
^ permalink raw reply [flat|nested] 6+ messages in thread