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

Git pull on fetch fail plus tests #555

Merged
merged 2 commits into from
Feb 27, 2019

Conversation

dibbles
Copy link
Member

@dibbles dibbles commented Feb 27, 2019

Fixes #543 a bug where the code source fails to be extracted from git, this happens when an old commit id is used that is not the HEAD of any branch.

Changes

If the git fetch happens to error, a git pull is attempted. Whilst the run method has been modified to return an error, the error is only checked in the case of the git fetch, this was done to minimize the code change at this time.

Some tests have been added that use differing revisions (short commitID, long commitID, branch name etc...) and ensure pipelines run to completion. An additional test was added to ensure that if a revision is specified that is not valid, we receive the expected errors from git fetch and git pull.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

Release Notes

- Bug fix: Arbitrary git commits can now be specified in Git PipelineResources (previously it only supported commits which can be `git fetch`-ed)

No user facing changes - bug fix - no doc changes needed

Additional Note - running tests locally required changing some timeouts. These changes have not been added with this initial commit as unknown whether this was specific to the environment in which I was running.

Fixes tektoncd#543 where the code source fails to be extracted from git,
this happens when an old commit id is used that is not the HEAD of any branch.
@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Feb 27, 2019
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 27, 2019
@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 27, 2019
@vdemeester
Copy link
Member

/ok-to-test

@knative-prow-robot knative-prow-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 27, 2019
Copy link
Member

@nader-ziada nader-ziada left a comment

Choose a reason for hiding this comment

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

Thanks @dibbles for the PR, that should fix the issue, just had a couple of comments about the test

@dibbles
Copy link
Member Author

dibbles commented Feb 27, 2019

Additional commit added after review comments from @pivotal-nader-ziada

@nader-ziada
Copy link
Member

looks good to me, thanks @dibbles

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2019
@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibbles, pivotal-nader-ziada

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:
  • OWNERS [pivotal-nader-ziada]

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2019
@nader-ziada
Copy link
Member

@imjasonh @shashwathi might be a good idea to port a similar change to build

@knative-prow-robot knative-prow-robot merged commit 218af43 into tektoncd:master Feb 27, 2019
@bobcatfish
Copy link
Collaborator

Excellent @dibbles !! Thanks so much for taking care of this :D

(I'm gonna update the release notes to include the bug fix info)

shashwathi pushed a commit to shashwathi/build that referenced this pull request Mar 25, 2019
copying solution from tektoncd pipeline: tektoncd/pipeline#555
Credit to @dibbles on the original PR
knative-prow-robot pushed a commit to knative/build that referenced this pull request Mar 26, 2019
* Add support for git commit sha

copying solution from tektoncd pipeline: tektoncd/pipeline#555
Credit to @dibbles on the original PR

* Add verification of default SA creation in e2e

- Previous e2e test failed as namespace did not have default SA. Now the
test setup verifies this exists
vdemeester pushed a commit to vdemeester/knative-build that referenced this pull request Apr 3, 2019
* Add support for git commit sha

copying solution from tektoncd pipeline: tektoncd/pipeline#555
Credit to @dibbles on the original PR

* Add verification of default SA creation in e2e

- Previous e2e test failed as namespace did not have default SA. Now the
test setup verifies this exists
vdemeester pushed a commit to vdemeester/knative-build that referenced this pull request Apr 3, 2019
* Add support for git commit sha

copying solution from tektoncd pipeline: tektoncd/pipeline#555
Credit to @dibbles on the original PR

* Add verification of default SA creation in e2e

- Previous e2e test failed as namespace did not have default SA. Now the
test setup verifies this exists
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. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't specify any arbitrary commit id in git resource
6 participants