-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show source image URL in summary #853
Show source image URL in summary #853
Conversation
Tested with the following cases: Case 1
Result: task summary runs and source image URL is shown in summary. Case 2
Result: task summary runs and source image URL is not shown in the summary logs. Case 3
Result: task summary runs and no source image URL is shown in the summary logs. |
task/summary/0.1/summary.yaml
Outdated
if [ -e "$SOURCE_BUILD_RESULT_FILE" ]; then | ||
found= | ||
fields=($(cat "$SOURCE_BUILD_RESULT_FILE")) | ||
for f in ${fields[@]}; do | ||
if [ -n "$found" ]; then | ||
echo "Generated Source Image is in : $(echo $f | tr -d '",')" | ||
break | ||
fi | ||
if [ "$f" == '"image_url":' ]; then | ||
found=yes | ||
fi | ||
done | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of parsing JSON in Bash, can the source-build task write something more easily parse-able to the workspace file? Maybe just the image url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was intended to make the result file be general for sharing with other tasks, not only for summary even though only summary uses for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you remind me that we can use https://github.com/redhat-appstudio/build-tasks-dockerfiles/tree/main/task-toolset @mmorhun
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make the result file be general for sharing with other tasks
IMO that's generally a bad idea. Files in the workspace can't really be trusted, since the user can always add a custom task that modifies the workspace content. That's also why the EC team is doing the Trusted Artifacts work #791
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(although for the show-summary task this is fine, it's purpose is just to inform the user)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8c9ee14
to
e6333dc
Compare
/test build-definitions-pull-request |
1 similar comment
/test build-definitions-pull-request |
ebb42b8
to
e32ec50
Compare
/retest |
f77363f
to
d4df87f
Compare
/retest |
STONEBLD-1608 This is a rework for the reverted version. In this implementation, the source-build task writes the build result to a file inside workspace so that any other task can read it. Task summary reads source image URL from this file and if the result file does not exist yet, just skip silently. The workspace mount is optional for task summary. It works for users who update task summary bundle but not PipelineRun YAML. Signed-off-by: Chenxiong Qi <[email protected]>
Signed-off-by: Chenxiong Qi <[email protected]>
a3c3080
to
671dddc
Compare
Quality Gate passedIssues Measures |
Rebased. No update to the changes. |
/retest |
STONEBLD-1608
This is a rework for the reverted version. In this implementation, the source-build task writes the build result to a file inside workspace so that any other task can read it. Task summary reads source image URL from this file and if the result file does not exist yet, just skip silently.
The workspace mount is optional for task summary. It works for users who update task summary bundle but not PipelineRun YAML.