Skip to content

feat: auto-create workflow during attestation #1416

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

Merged

Conversation

migmartri
Copy link
Member

It adds support to automatically, during att init, to create the workflow referenced by its name, project and optional contract name.

I added this feature as an additional API endpoint in the attestation service instead of re-using the workflow service because I want to make sure this feature can be authenticated, authorized, and potentially toggled in the future, using the attestation token, not a user token.

In fact, I'd say that moving forward, I'd remove the ability of the API token to create workflows by default through regular wf create

Closes #1415

@migmartri migmartri requested review from jiparis and javirln October 20, 2024 20:52
@migmartri
Copy link
Member Author

Tests are failing until we merge and rebase #1414

@@ -70,7 +70,7 @@ func NewAttestationInit(cfg *AttestationInitOpts) (*AttestationInit, error) {
}

// returns the attestation ID
func (action *AttestationInit) Run(ctx context.Context, contractRevision int, projectName, workflowName string) (string, error) {
func (action *AttestationInit) Run(ctx context.Context, contractRevision int, projectName, workflowName, newWorkflowContractName string) (string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

This changes the current behaviour a little bit. Currently, contract is not mandatory.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not mandatory here either. The name can be empty string

@migmartri migmartri force-pushed the 1415-create-workflow-automatically branch from 246d884 to cd976a8 Compare October 21, 2024 09:38
@migmartri migmartri merged commit 84729f1 into chainloop-dev:main Oct 21, 2024
13 checks passed
@migmartri migmartri deleted the 1415-create-workflow-automatically branch October 21, 2024 09:47
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.

feat: automatically create workflow during attestation
3 participants