Add TaskAction validation before finalizer registration#7006
Merged
AdilFayyaz merged 8 commits intov2from Mar 11, 2026
Merged
Conversation
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
pingsutw
reviewed
Mar 10, 2026
pingsutw
approved these changes
Mar 10, 2026
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
…te into adil/task-action-validation
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
afbrock
pushed a commit
that referenced
this pull request
Mar 18, 2026
* add: validation Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com> * fix Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com> * [V2] Add GitHub Actions workflow for Go unit tests (#6999) Signed-off-by: Kevin Su <pingsutw@apache.org> * add: validation Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com> * fix Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com> * minor fix Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com> * fix: tests Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com> --------- Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com> Signed-off-by: Kevin Su <pingsutw@apache.org> Co-authored-by: Kevin Su <pingsutw@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking issue
Closes #6934
Why are the changes needed?
In PR #6903, it was noted that plugin resolution (the check for whether a registered plugin exists for a given taskType) happened after the finalizer was added to the resource. This meant that if a TaskAction had an unrecognized taskType, the controller would:
At that point, deleting the resource requires the controller to run
handleAbortAndFinalizeto remove the finalizer even though no plugin ever ran and there is nothing to clean up. Additionally,validateSpeconly checked 4 of the 9 required spec fields, leaving runName, org, project, domain, and actionName unvalidated at the controller level.What changes were proposed in this pull request?
validateSpecfunction and inlineResolvePluginblock with a unifiedvalidateTaskActionfunction that validates all required spec fields and resolves the plugin in a single passpluginResolverinterface sovalidateTaskActionis testable without a real plugin registrytaskaction_validation_test.gowith standard Go unit tests covering all 9 required field checks and the plugin-not-found caseHow was this patch tested?
go test ./pkg/controller/... -run TestValidateTaskAction -vcovers all 9 missing-field cases and plugin-not-foundgo test ./pkg/controller/... -vconfirms reconcile completes without error and sets conditionsSetup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link
main