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

Implement CreateBuild rpc #3

Merged
merged 8 commits into from
Mar 25, 2021
Merged

Implement CreateBuild rpc #3

merged 8 commits into from
Mar 25, 2021

Conversation

alexashley
Copy link
Contributor

@alexashley alexashley commented Mar 23, 2021

  • converted config package tests to Ginkgo
  • added commit id to CreateBuildRequest to populate revision id in the build occurrence

Example payload:

{
	"commitId": "639550538727a298ed0757cdf8d1526d65eb5328",
	"repository": "https://github.com/rode/collector-build",
	"artifacts": [
		"ghcr.io/rode/collector-build@sha256:12345"
	]
}

Example response:

{
  "buildOccurrenceId": "projects/rode/occurrences/fa9eb4fc-89d5-4d2f-99ce-2ca31eaf8099"
}

Resulting build occurrence:

{
  "name": "projects/rode/occurrences/fa9eb4fc-89d5-4d2f-99ce-2ca31eaf8099",
  "resource": {
    "name": "",
    "uri": "git://github.com/rode/collector-build@639550538727a298ed0757cdf8d1526d65eb5328",
    "contentHash": null
  },
  "noteName": "projects/rode/notes/build_collector",
  "kind": "BUILD",
  "remediation": "",
  "createTime": "2021-03-23T20:52:36.837221100Z",
  "updateTime": null,
  "build": {
    "provenance": {
      "id": "167503e7-a9c5-4176-ae25-4c915373d105",
      "projectId": "projects/rode",
      "commands": [],
      "builtArtifacts": [
        {
          "checksum": "",
          "id": "ghcr.io/rode/collector-build@sha256:12345",
          "names": []
        }
      ],
      "createTime": "2021-03-23T20:52:36.823508Z",
      "startTime": null,
      "endTime": null,
      "creator": "",
      "logsUri": "",
      "sourceProvenance": {
        "artifactStorageSourceUri": "",
        "fileHashes": {},
        "context": {
          "git": {
            "url": "https://github.com/rode/collector-build",
            "revisionId": "639550538727a298ed0757cdf8d1526d65eb5328"
          },
          "labels": {}
        },
        "additionalContexts": []
      },
      "triggerId": "",
      "buildOptions": {},
      "builderVersion": ""
    },
    "provenanceBytes": ""
  }
}

Copy link

@aalsabag aalsabag left a comment

Choose a reason for hiding this comment

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

Lookin good. lgtm


return &grafeas_go_proto.Occurrence{
Resource: &grafeas_go_proto.Resource{
Uri: fmt.Sprintf("git://%s%s@%s", repositoryURL.Host, repositoryURL.Path, request.CommitId),

Choose a reason for hiding this comment

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

@pickjasmine probably needs to be aware of this resource uri format

Choose a reason for hiding this comment

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

I don't think it is included in our current resource-utils

Choose a reason for hiding this comment

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

I'll make an issue to handle this format in the UI git://{host}{path}@{commit}. thanks @aalsabag !

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.

4 participants