feat: link workflows to projects and tags#70
Merged
Conversation
kh project and kh tag could already create and list projects and tags, but kh workflow create/update had no way to associate a workflow with one, so workflows could not be organized into projects or labeled from the CLI. Add --project and --tag to workflow create and workflow update; on update an empty value sends an explicit null so the assignment is cleared, while an untouched flag is omitted. Add --project and --tag filters to workflow list. The update body is now a map so null (unassign) and omit are distinguishable. Covered by tests for the assign, unassign, and omit paths.
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.
Problem
kh projectandkh tagcan already create and list projects and tags, butkh workflow createandkh workflow updatehad no way to associate a workflow with one. Their request bodies only carried name/description/nodes/edges, so a workflow could not be placed in a project or labeled with a tag from the CLI, and an existing assignment could not be cleared.Change
kh workflow creategains--projectand--tagto assign a project/tag on creation (omitted from the request when unset).kh workflow updategains--projectand--tag. An empty value sends an explicit JSONnullto unassign; an untouched flag is omitted so unrelated updates never disturb the assignment. The update body is now a map sonull(unassign) and omit are distinguishable.kh workflow listgains--projectand--tagfilters, forwarded to the API asprojectId/tagIdquery params.Tests
New
project_tag_test.gocovers the assign, unassign (empty value tonull), and omit-when-unset paths for create and update, plus the list filter query params.