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

Create package evidence using cli #21

Merged
merged 20 commits into from
Aug 12, 2024
Merged

Create package evidence using cli #21

merged 20 commits into from
Aug 12, 2024

Conversation

osaidwtd
Copy link
Contributor

No description provided.


// Unique evidence flags
predicate = "predicate"
predicateType = "predicate-type"
subjectRepoPath = "subject-repo-path"
subjectSha256 = "subject-sha256"
key = "key"
keyId = "key-name"
KeyAlias = "key-alias"

Choose a reason for hiding this comment

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

No need to export this constant, can be keyAlias.

Copy link
Contributor Author

@osaidwtd osaidwtd Aug 12, 2024

Choose a reason for hiding this comment

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

done

"github.com/jfrog/jfrog-client-go/utils/log"
)

const leadArtifactQueryTemplate = `{
Copy link
Contributor

Choose a reason for hiding this comment

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

Why putting a const if you dont use it as const?
Also, it is used only in one place just copy it to line 124

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i tried to change it, but i think also is not bad to have it private const here since its too long and a bit confusing to have it directly inside the small method.


func (epc *evidencePackageCommand) validateEvidencePackageContext(ctx *components.Context) error {
if !ctx.IsFlagSet(packageVersion) || assertValueProvided(ctx, packageVersion) != nil {
return errorutils.CheckErrorf("'packageVersion' is a mandatory field for creating a Package evidence: --%s", packageVersion)

Choose a reason for hiding this comment

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

In this command, and also in the existing build/release-bundle commands: we should not log the internal names of the variables - having packageVersion or packageRepoName in the logs is confusing.

Instead, we should mention only those names, which a client is supposed to use, for example:
--%s is a mandatory parameter for creating a Package evidence

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,26 @@
package model

Copy link

@denys-jfrog denys-jfrog Aug 12, 2024

Choose a reason for hiding this comment

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

Sounds like metadata.go and MetadataResponse / PackageVersionsResponse.
(the "graphql" like "REST" is very generic - it can refer to anything)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@osaidwtd osaidwtd merged commit fa7f868 into jfrog:main Aug 12, 2024
6 checks passed
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.

3 participants