Skip to content

Commit dc47c03

Browse files
committed
chore(cli): move action package to pkg
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
1 parent 6bcd889 commit dc47c03

64 files changed

Lines changed: 93 additions & 102 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/cli/cmd/artifact_download.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func newArtifactDownloadCmd() *cobra.Command {
3939
}
4040

4141
// Retrieve temporary credentials for uploading
42-
artifactCASConn, err = wrappedArtifactConn(actionOpts.CPConnection,
42+
artifactCASConn, err = wrappedArtifactConn(ActionOpts.CPConnection,
4343
pb.CASCredentialsServiceGetRequest_ROLE_DOWNLOADER, digest)
4444
if err != nil {
4545
return err
@@ -49,7 +49,7 @@ func newArtifactDownloadCmd() *cobra.Command {
4949
},
5050
RunE: func(cmd *cobra.Command, args []string) error {
5151
opts := &action.ArtifactDownloadOpts{
52-
ActionsOpts: actionOpts,
52+
ActionsOpts: ActionOpts,
5353
ArtifactsCASConn: artifactCASConn,
5454
Stdout: cmd.OutOrStdout(),
5555
}

app/cli/cmd/artifact_upload.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func newArtifactUploadCmd() *cobra.Command {
3333
var err error
3434

3535
// Retrieve temporary credentials for uploading
36-
artifactCASConn, err = wrappedArtifactConn(actionOpts.CPConnection, pb.CASCredentialsServiceGetRequest_ROLE_UPLOADER, "")
36+
artifactCASConn, err = wrappedArtifactConn(ActionOpts.CPConnection, pb.CASCredentialsServiceGetRequest_ROLE_UPLOADER, "")
3737
if err != nil {
3838
return err
3939
}
@@ -42,7 +42,7 @@ func newArtifactUploadCmd() *cobra.Command {
4242
},
4343
RunE: func(cmd *cobra.Command, args []string) error {
4444
opts := &action.ArtifactUploadOpts{
45-
ActionsOpts: actionOpts,
45+
ActionsOpts: ActionOpts,
4646
ArtifactsCASConn: artifactCASConn,
4747
}
4848

app/cli/cmd/attached_integration_add.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ func newAttachedIntegrationAttachCmd() *cobra.Command {
3636
chainloop integration attached add --workflow deadbeef --project my-project --integration dependency-track --opt projectName=MyProject --opt filter="environment=prod,team=security"`,
3737
RunE: func(_ *cobra.Command, _ []string) error {
3838
// Find the integration to extract the kind of integration we care about
39-
integration, err := action.NewRegisteredIntegrationDescribe(actionOpts).Run(integrationName)
39+
integration, err := action.NewRegisteredIntegrationDescribe(ActionOpts).Run(integrationName)
4040
if err != nil {
4141
return err
4242
}
4343

4444
// Retrieve schema for validation and options marshaling
45-
item, err := action.NewAvailableIntegrationDescribe(actionOpts).Run(integration.Kind)
45+
item, err := action.NewAvailableIntegrationDescribe(ActionOpts).Run(integration.Kind)
4646
if err != nil {
4747
return err
4848
}
@@ -57,7 +57,7 @@ func newAttachedIntegrationAttachCmd() *cobra.Command {
5757
return err
5858
}
5959

60-
res, err := action.NewAttachedIntegrationAdd(actionOpts).Run(integrationName, workflowName, projectName, opts)
60+
res, err := action.NewAttachedIntegrationAdd(ActionOpts).Run(integrationName, workflowName, projectName, opts)
6161
if err != nil {
6262
return err
6363
}

app/cli/cmd/attached_integration_delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func newAttachedIntegrationDeleteCmd() *cobra.Command {
2828
Aliases: []string{"detach"},
2929
Short: "Detach an integration that's attached to a workflow",
3030
RunE: func(cmd *cobra.Command, args []string) error {
31-
if err := action.NewAttachedIntegrationDelete(actionOpts).Run(attachmentID); err != nil {
31+
if err := action.NewAttachedIntegrationDelete(ActionOpts).Run(attachmentID); err != nil {
3232
return err
3333
}
3434

app/cli/cmd/attached_integration_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func newAttachedIntegrationListCmd() *cobra.Command {
3434
Aliases: []string{"ls"},
3535
Short: "List integrations attached to workflows",
3636
RunE: func(cmd *cobra.Command, args []string) error {
37-
res, err := action.NewAttachedIntegrationList(actionOpts).Run(projectName, workflowName)
37+
res, err := action.NewAttachedIntegrationList(ActionOpts).Run(projectName, workflowName)
3838
if err != nil {
3939
return err
4040
}

app/cli/cmd/attestation_add.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func newAttestationAddCmd() *cobra.Command {
6868
RunE: func(cmd *cobra.Command, _ []string) error {
6969
a, err := action.NewAttestationAdd(
7070
&action.AttestationAddOpts{
71-
ActionsOpts: actionOpts,
71+
ActionsOpts: ActionOpts,
7272
CASURI: viper.GetString(confOptions.CASAPI.viperKey),
7373
CASCAPath: viper.GetString(confOptions.CASCA.viperKey),
7474
ConnectionInsecure: apiInsecure(),

app/cli/cmd/attestation_init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func newAttestationInitCmd() *cobra.Command {
7272
RunE: func(cmd *cobra.Command, _ []string) error {
7373
a, err := action.NewAttestationInit(
7474
&action.AttestationInitOpts{
75-
ActionsOpts: actionOpts,
75+
ActionsOpts: ActionOpts,
7676
DryRun: attestationDryRun,
7777
Force: force,
7878
UseRemoteState: useAttestationRemoteState,
@@ -112,7 +112,7 @@ func newAttestationInitCmd() *cobra.Command {
112112
logger.Info().Msg("Attestation initialized! now you can check its status or add materials to it")
113113

114114
// Show the status information
115-
statusAction, err := action.NewAttestationStatus(&action.AttestationStatusOpts{ActionsOpts: actionOpts, UseAttestationRemoteState: useAttestationRemoteState, LocalStatePath: attestationLocalStatePath})
115+
statusAction, err := action.NewAttestationStatus(&action.AttestationStatusOpts{ActionsOpts: ActionOpts, UseAttestationRemoteState: useAttestationRemoteState, LocalStatePath: attestationLocalStatePath})
116116
if err != nil {
117117
return newGracefulError(err)
118118
}

app/cli/cmd/attestation_push.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func newAttestationPushCmd() *cobra.Command {
6868
return fmt.Errorf("getting executable information: %w", err)
6969
}
7070
a, err := action.NewAttestationPush(&action.AttestationPushOpts{
71-
ActionsOpts: actionOpts, KeyPath: pkPath, BundlePath: bundle,
71+
ActionsOpts: ActionOpts, KeyPath: pkPath, BundlePath: bundle,
7272
CLIVersion: info.Version, CLIDigest: info.Digest,
7373
LocalStatePath: attestationLocalStatePath,
7474
SignServerOpts: &action.SignServerOpts{

app/cli/cmd/attestation_reset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func newAttestationResetCmd() *cobra.Command {
4141
return nil
4242
},
4343
RunE: func(cmd *cobra.Command, args []string) error {
44-
a, err := action.NewAttestationReset(&action.AttestationResetOpts{ActionsOpts: actionOpts, LocalStatePath: attestationLocalStatePath})
44+
a, err := action.NewAttestationReset(&action.AttestationResetOpts{ActionsOpts: ActionOpts, LocalStatePath: attestationLocalStatePath})
4545
if err != nil {
4646
return fmt.Errorf("failed to load action: %w", err)
4747
}

app/cli/cmd/attestation_status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func newAttestationStatusCmd() *cobra.Command {
4646
a, err := action.NewAttestationStatus(
4747
&action.AttestationStatusOpts{
4848
UseAttestationRemoteState: attestationID != "",
49-
ActionsOpts: actionOpts,
49+
ActionsOpts: ActionOpts,
5050
LocalStatePath: attestationLocalStatePath,
5151
},
5252
)

0 commit comments

Comments
 (0)