-
Notifications
You must be signed in to change notification settings - Fork 57
Chore: Workflow Step Definitions Refactoring and Enhancement #223
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
Conversation
Chore: refactor definitions and add local dev support - Refactored `apply-deployment`, `apply-object`, `clean-jobs`, `export2config`, and `export2secret` to use `vela/kube` and `vela/builtin` instead of `vela/op`. - Updated CUE templates to use `$params` syntax. - Added `custom.definition.oam.dev/category: Resource Management` annotation to definitions. - Removed `custom.definition.oam.dev/ui-hidden` label from definitions. - Added `core-install` and `def-install` targets to Makefile for local development. - Added `DEFINITION_NAMESPACE` to `makefiles/const.mk`. - Updated README.md with local development guide.
Refactor: update workflow step definitions and examples * refactor: update workflow step definitions - Refactored `print-message-in-status`, `suspend`, `request`, `read-object`, and `vela-cli` to use `vela/builtin`, `vela/kube`, and `vela/util`. - Added category annotations to steps and removed `ui-hidden` labels. - Added `message` parameter to `suspend` step. - Updated `read-object` parameters with default values. * chore: add and update workflow run examples - Added new examples: `test-vela-cli.yaml`, `test-suspend.yaml`, `test-step-group.yaml`, `test-request.yaml`, `test-read-object.yaml`, `test-print-message.yaml`. - Added testing steps comments to existing examples.
Refactor: update build-push-image workflow step definition * refactor: migrate build-push-image definition from `vela/op` to `vela/kube`, `vela/util`, and `vela/builtin` * update `kaniko` and `read` steps to use `kube.#Apply` and `kube.#Read` with `$params` * update `log` step to use `util.#Log` * update `wait` step to use `builtin.#ConditionalWait` and adjust status check logic * add `custom.definition.oam.dev/category` annotation * add `examples/workflow-run/test-build-push-image.yaml` example workflow
Fix: Refactor notification workflow step definition * Fix: Refactor notification workflow step definition - Replaced `vela/op` imports with `vela/http`, `vela/email`, `vela/kube`, and `vela/util` - Updated DingTalk, Lark, and Slack implementations to use `http.#HTTPDo` - Updated Email implementation to use `email.#SendEmail` - Refactored CUE parameter definitions and removed redundant null checks - Added `External Integration` category annotation - Added `examples/workflow-run/test-notification.yaml` for testing
…:v1.9.0 Signed-off-by: vishal210893 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #223 +/- ##
==========================================
+ Coverage 62.49% 70.19% +7.70%
==========================================
Files 62 62
Lines 4415 5009 +594
==========================================
+ Hits 2759 3516 +757
+ Misses 1324 1142 -182
- Partials 332 351 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
2 issues found across 29 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="charts/vela-workflow/templates/definitions/apply-deployment.yaml">
<violation number="1" location="charts/vela-workflow/templates/definitions/apply-deployment.yaml:47">
P2: Wait condition only checks readyReplicas, allowing workflows to continue before the new deployment generation is fully rolled out.</violation>
</file>
<file name="examples/workflow-run/test-build-push-image.yaml">
<violation number="1" location="examples/workflow-run/test-build-push-image.yaml:2">
P2: Example instructions create a secret named "docker-secret" but the workflow creates/uses "image-registry-secret" with placeholder credentials, so following the instructions will still use dummy creds and likely fail authentication.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
🎯 Overview
This PR refactors multiple workflow step definitions to use modern CUE imports and improves code maintainability, consistency, and usability. The changes include migrating from legacy
vela/opimports to more specific and modular imports, adding categorization annotations, and providing comprehensive test examples.📊 Summary Statistics
🔄 Changes by Category
1. Workflow Step Definition Refactoring
build-push-image Definition
vela/opwithvela/builtin,vela/kube, andvela/utilkanikostep to usekube.#Applywith$paramslogstep to useutil.#Logwith$paramsreadstep to usekube.#Readwith$paramswaitstep to usebuiltin.#ConditionalWaitwith improved status check logicoamdev/kaniko-executor:v1.9.1togcr.io/kaniko-project/executor:v1.9.0custom.definition.oam.dev/category: CI Integrationcharts/vela-workflow/templates/definitions/build-push-image.yamlnotification Definition
vela/opwithvela/http,vela/email,vela/kube, andvela/utilhttp.#HTTPDohttp.#HTTPDohttp.#HTTPDoemail.#SendEmail*nulldefault valuesclose()constraints#linkschema for DingTalk feedCardcustom.definition.oam.dev/category: External Integrationcharts/vela-workflow/templates/definitions/notification.yamlprint-message-in-status Definition
vela/opwithvela/builtinandvela/utilui-hiddenlabel to make the step visible in UIcharts/vela-workflow/templates/definitions/print-message-in-status.yamlread-object Definition
vela/opwithvela/kubekube.#Readwith$paramspatterncharts/vela-workflow/templates/definitions/read-object.yamlrequest Definition
vela/opwithvela/httphttp.#HTTPDowith$paramspatterncharts/vela-workflow/templates/definitions/request.yamlstep-group Definition
charts/vela-workflow/templates/definitions/step-group.yamlsuspend Definition
messageparameter to allow custom suspension messagescharts/vela-workflow/templates/definitions/suspend.yamlvela-cli Definition
vela/opwithvela/kubecharts/vela-workflow/templates/definitions/vela-cli.yaml2. New Test Examples
Comprehensive test examples have been added to validate and demonstrate the functionality of workflow step definitions:
Existing Examples Enhanced
New Test Examples
test-build-push-image.yaml (49 lines)
test-notification.yaml (23 lines)
test-print-message.yaml (64 lines)
test-read-object.yaml (78 lines)
test-request.yaml (46 lines)
test-step-group.yaml (95 lines)
test-suspend.yaml (68 lines)
test-vela-cli.yaml (55 lines)
Files Location:
examples/workflow-run/🔍 Testing
All changes have been validated with:
examples/workflow-run/Signed-off-by: vishal210893 [email protected]
Summary by cubic
Refactored built-in workflow step definitions to use modern CUE modules (vela/kube, vela/builtin, vela/util, vela/http, vela/email) and added category annotations. Added local dev targets and new examples to make testing and adoption easier.
Refactors
New Features
Written for commit 2411690. Summary will update on new commits.