-
Notifications
You must be signed in to change notification settings - Fork 204
Script run stage #4720
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
Script run stage #4720
Conversation
Signed-off-by: Yoshiki Fujikane <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4720 +/- ##
==========================================
- Coverage 30.83% 30.80% -0.04%
==========================================
Files 221 221
Lines 26005 26015 +10
==========================================
- Hits 8018 8013 -5
- Misses 17337 17352 +15
Partials 650 650 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Yoshiki Fujikane <[email protected]>
488f701 to
9351080
Compare
|
/review |
PR AnalysisMain themeEnhancement PR summaryThe PR introduces a new stage for running arbitrary scripts. This change enables Type of PREnhancement PR Feedback:General suggestionsThis enhancement is useful as it provides users with a flexible mechanism for running custom scripts during deployments. However, it's crucial to ensure the execution of arbitrary scripts does not compromise security or stability. Take care to manage environment variables and consider validation or sanitation of the scripts if necessary. Code feedback
Security concerns:yes Executing arbitrary scripts can be a security risk, especially if the script content is sourced from an untrusted input or manipulated before execution. Although the scripts seem to be specified in stage configurations, which may be from controlled sources (e.g., git repositories), it is important to ensure they are not susceptible to injection attacks and that proper measures, like sanitation and permissions checks, are in place for both the contents of the scripts and the environment variables used within them. |
|
| } | ||
|
|
||
| func (e *RollbackExecutor) Execute(sig executor.StopSignal) model.StageStatus { | ||
| return model.StageStatus_STAGE_NOT_STARTED_YET |
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.
Use stage failed, and print out unimplemented in stage log instead, or this will block the deployment forever 🤔
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.
fixed on 2594710 🙏
Signed-off-by: Yoshiki Fujikane <[email protected]>
pkg/config/application_test.go
Outdated
| } | ||
| } | ||
|
|
||
| // TODO: Add testcases for other kinds of applications. |
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.
What do we want here? I don't see any kinds here 👀
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.
b1e6555
Sorry this comment is meaningless 🙏 so deleted
Signed-off-by: Yoshiki Fujikane <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]>
|
I fixed the implementation like custom sync :) I will implement the rollback on another PR 🙏 |
khanhtc1202
left a comment
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.
Nice, thank you 🚀
|
@ffjlabo Please sign-off the commit 👀 |
Signed-off-by: Yoshiki Fujikane <[email protected]>
b1e6555 to
2dab4a3
Compare
|
@khanhtc1202 oops, sorry 🙏 signed! |
khanhtc1202
left a comment
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.
🚀
|
Also, I will create docs for it on another PR:) |
t-kikuc
left a comment
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.
🚀
* Add option script run stage Signed-off-by: Yoshiki Fujikane <[email protected]> * Implement Executor for script run Signed-off-by: Yoshiki Fujikane <[email protected]> * Use StageStatus_STAGE_FAILURE Signed-off-by: Yoshiki Fujikane <[email protected]> * Add error log Signed-off-by: Yoshiki Fujikane <[email protected]> * Add Copyright Signed-off-by: Yoshiki Fujikane <[email protected]> * Re-implement script run stage like custom sync Signed-off-by: Yoshiki Fujikane <[email protected]> * Delete comment Signed-off-by: Yoshiki Fujikane <[email protected]> --------- Signed-off-by: Yoshiki Fujikane <[email protected]> Signed-off-by: t-kikuc <[email protected]>
* Add option script run stage Signed-off-by: Yoshiki Fujikane <[email protected]> * Implement Executor for script run Signed-off-by: Yoshiki Fujikane <[email protected]> * Use StageStatus_STAGE_FAILURE Signed-off-by: Yoshiki Fujikane <[email protected]> * Add error log Signed-off-by: Yoshiki Fujikane <[email protected]> * Add Copyright Signed-off-by: Yoshiki Fujikane <[email protected]> * Re-implement script run stage like custom sync Signed-off-by: Yoshiki Fujikane <[email protected]> * Delete comment Signed-off-by: Yoshiki Fujikane <[email protected]> --------- Signed-off-by: Yoshiki Fujikane <[email protected]>



What this PR does / why we need it:
Implement SCRIPT_RUN stage to execute any command on the pipeline.
First, this PR is for just executing commands, not considered for rollbacking.
Which issue(s) this PR fixes:
Part of #4643
Does this PR introduce a user-facing change?:
yes