Skip to content
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

CLI: Implement workflow commands #67

Merged
merged 7 commits into from
May 28, 2021
Merged

Conversation

flaviodsr
Copy link
Member

Implements the following workflow commands:

  • create
  • get
  • assign
  • list-assignments
  • list-run

Besides that:

  • for workflow create, return "409 Conflict" when creating
    a workflow with the same name as another existing workflow.
  • set the column names to uppercase

Implements the workflow create command. The workflow is created from
a file containing its definition. A validation for the workflow still
needs to be implemented.

Additionally workflow create returns "409 Conflict" when creating
a workflow with the same name as another existing workflow.
Implements the workflow get command. The workflow get command can be
used to retrieve detailed information about an existing workflow.
Implements the workflow assign command. The workflow assing command can be
used to assign a workflow to a codeset.
There is no reason to expose such functions/types.
Implements the workflow list-assignments command. This command can be
used to list assignments between workflows and codesets.
Implements the workflow list-runs command. This command can be used to
list workflow runs.
Set the column names as uppercase for the CLI outputs.
Copy link
Member

@stefannica stefannica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't wait to try this !

"github.com/jedib0t/go-pretty/v6/table"
"github.com/jonboulle/clockwork"
"github.com/spf13/cobra"
"github.com/tektoncd/cli/pkg/formatted"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be risky to include a sub-package package from the Tekton CLI, given that it is not a public library and no guarantee that the exposed interface will change from version to version in a backwards-compatible way. But I really like what you've done with it and I think it's worth the risk. Great idea !

Comment on lines +92 to +93
cmd.Flags().StringVarP(&o.codesetName, "codeset-name", "c", "", "filter workflow runs by the codeset name")
cmd.Flags().StringVarP(&o.codesetProject, "codeset-project", "p", "", "filter workflow runs by the codeset project")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The project is not directly associated with a workflow run, but I'd like to think we'll make that happen really soon. When that happens, these two would be better named codeset and project. Basically, all workflow runs created from a codeset would "belong" to the same project as the codeset. And if you only use the codeset name here without specifying the project, you should be able to find the codeset by using the same project that the workflow run is associated with.

But these are just thoughts about the future... all is good here otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants