feat: add generic sync target for project results in Makefile#61
Conversation
Signed-off-by: ianwhitney <ian.r.whitney@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a generic results-sync-path macro and a project-results-sync target to the Makefile for syncing test results. The review feedback correctly identifies a syntax error where spaces were used instead of tabs in the macro definition, which would cause the Makefile to fail. Additionally, suggestions were made to improve the robustness of the file copying process and variable quoting.
Signed-off-by: ianwhitney <ian.r.whitney@gmail.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a generic Makefile target project-results-sync that accepts RESULTS_DIR and PROJECT inputs to enable reuse across projects in a shared workflow.
Changes:
- New
results-sync-pathmacro that copies results from a given source directory into<project>-results. - New
project-results-synctarget requiringRESULTS_DIRandPROJECTvariables.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| exit 1; \ | ||
| fi |
| @rm -rf $(2) | ||
| @mkdir -p $(2) | ||
| @if [ -n "$(1)" ] && [ -d "$(1)" ]; then \ | ||
| echo "Copying results from $(1) → $(2)"; \ | ||
| cp -r "$(1)"/* $(2)/ ; \ | ||
| else \ | ||
| echo "$(1) not set or directory does not exist, skipping"; \ | ||
| fi |
| @mkdir -p $(2) | ||
| @if [ -n "$(1)" ] && [ -d "$(1)" ]; then \ | ||
| echo "Copying results from $(1) → $(2)"; \ | ||
| cp -r "$(1)"/* $(2)/ ; \ |
| ## Generic sync - make project-results-sync RESULTS_DIR=path/to/results PROJECT=myproject | ||
| project-results-sync: | ||
| @if [ -z "$(RESULTS_DIR)" ] || [ -z "$(PROJECT)" ]; then \ | ||
| echo "RESULTS_DIR and PROJECT must be set"; \ | ||
| exit 1; \ | ||
| fi | ||
| @echo "Syncing $(PROJECT) results..." | ||
| $(call results-sync-path,$(RESULTS_DIR),$(PROJECT)-results) |
|
|
||
|
|
|
|
||
|
|
||
|
|
||
| ## Setup environment; Install prequisites |
aabidsofi19
left a comment
There was a problem hiding this comment.
Looks good . should make it easier to extend the projects.
This PR aims to add a generic sync results so that it can be leveraged in a resuable workflow and the various projects would provide the inputs to the make command. As the workflow that will leverage this is adopted, the previous cmd could be deprecated at that time.
example useage:
make project-results-sync RESULTS_DIR=./allure-results PROJECT=mesherySo as a reusable workflow the inputs would includes results-dir and project.