-
Notifications
You must be signed in to change notification settings - Fork 38
feat(dependecy-track): interpolated project name #282
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
Conversation
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
// We currently support the following template variables: | ||
// - material.annotations.<key> | ||
// For example, project-name => {{ material.annotations.my_annotation }} | ||
func resolveProjectName(projectNameTpl string, annotations map[string]string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the new part.
|
||
if ac.ProjectName != "" && !rc.AllowAutoCreate { | ||
return errors.New("auto creation of projects is not supported in this integration") | ||
if ac.ProjectName != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this validation at attachment time
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Enables annotations interpolation (#252) in the Dependency-Track plugin.
Now, during attachment, the project name can contain material annotations that will be resolved before pushing to the dep-track instance.
For example, let's say that you have the following contract with two SBOMs and a
component
annotation (note that the value of the annotation is set in the contract but it is also now possible to set it at runtime #281)This annotation can then be set during attachment.
The result of this at execution time would be sending
controlplane-sbom
=>miguel-test-controlplane
cas-sbom
=>miguel-test-cas
Some notes about the implementation