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

Adds branchName in buildrun results if revision is not specified #933

Merged

Conversation

sm43
Copy link
Contributor

@sm43 sm43 commented Nov 2, 2021

If user doesn't specify revision in Build object, then default
branch is used.
This patch adds support for adding the branch name in BuildRun results
if revision is not specified in Build Object.

Fixes #923

Signed-off-by: Shivam Mukhade smukhade@redhat.com

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

Adds branchName in buildrun results if revision is not specified in Build

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Label for when a PR has specified a release note labels Nov 2, 2021
@SaschaSchwarze0 SaschaSchwarze0 added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. labels Nov 3, 2021
@openshift-ci openshift-ci bot added release-note-none Label for when a PR does not need a release note and removed release-note Label for when a PR has specified a release note labels Nov 3, 2021
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

Very nice work @sm43. Code and tests are all perfect. I only look for an extension of https://github.com/shipwright-io/build/blob/main/docs/buildrun.md#step-results-in-buildrun-status to document the new status field. Edit: and I just approved the test runs, have a look at the failure. Should be easy to fix.

@sm43
Copy link
Contributor Author

sm43 commented Nov 3, 2021

Very nice work @sm43. Code and tests are all perfect. I only look for an extension of https://github.com/shipwright-io/build/blob/main/docs/buildrun.md#step-results-in-buildrun-status to document the new status field. Edit: and I just approved the test runs, have a look at the failure. Should be easy to fix.

Thanks @SaschaSchwarze0
Fixed most of them but not sure why the below test is failing 🤔

Git Resource
/home/smukhade/go/src/github.com/shipwright-io/build/cmd/git/main_test.go:22
  cloning repositories with submodules
  /home/smukhade/go/src/github.com/shipwright-io/build/cmd/git/main_test.go:330
    should Git clone a repository with a submodule [It]
    /home/smukhade/go/src/github.com/shipwright-io/build/cmd/git/main_test.go:333

    Unexpected error:
        <*fs.PathError | 0xc0006842d0>: {
            Op: "open",
            Path: "",
            Err: <syscall.Errno>0x2,
        }
        open : no such file or directory
    occurred

    /home/smukhade/go/src/github.com/shipwright-io/build/cmd/git/main_test.go:338

any idea?
also how do I trigger the CI? is there any command I need comment to trigger it?

@SaschaSchwarze0
Copy link
Member

also how do I trigger the CI? is there any command I need comment to trigger it?

Some maintainer needs to do this for you until you become a regular contributor.

cmd/git/main.go Outdated Show resolved Hide resolved
@sm43 sm43 force-pushed the branch-name-in-results branch from 20c05e0 to 7ff9fb8 Compare November 3, 2021 13:18
@sm43 sm43 changed the title [WIP] Adds branch name used in buildrun results Adds branchName in buildrun results if revision is not specified Nov 3, 2021
@openshift-ci openshift-ci bot added release-note Label for when a PR has specified a release note and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Label for when a PR does not need a release note labels Nov 3, 2021
@sm43 sm43 requested a review from SaschaSchwarze0 November 3, 2021 13:29
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

Okay, let's see if the tests get green now. One final request for the documentation.

docs/buildrun.md Show resolved Hide resolved
@sm43 sm43 force-pushed the branch-name-in-results branch from 7ff9fb8 to 9158028 Compare November 3, 2021 15:56
@sm43 sm43 requested a review from SaschaSchwarze0 November 3, 2021 15:57
cmd/git/main.go Outdated Show resolved Hide resolved
@gabemontero
Copy link
Member

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 3, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gabemontero

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 3, 2021
@sbose78
Copy link
Member

sbose78 commented Nov 3, 2021

+1 on this, this is very helpful.

If user doesn't specify revision in Build object, then default
branch is used.
This patch adds support for adding the branch name in BuildRun results
if revision is not specified in Build Object.

Closes shipwright-io#923

Signed-off-by: Shivam Mukhade <smukhade@redhat.com>
@sm43 sm43 force-pushed the branch-name-in-results branch from 9158028 to 7d9c960 Compare November 4, 2021 05:42
@sm43 sm43 requested a review from gabemontero November 4, 2021 05:43
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2021
@openshift-merge-robot openshift-merge-robot merged commit bae38e1 into shipwright-io:main Nov 4, 2021
@sm43 sm43 deleted the branch-name-in-results branch November 4, 2021 13:14
@SaschaSchwarze0 SaschaSchwarze0 added this to the release-v0.7.0 milestone Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Label for when a PR has specified a release note
Projects
None yet
5 participants