-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
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.
/ok-to-test |
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.
Thanks @dibbles for the PR, that should fix the issue, just had a couple of comments about the test
Additional commit added after review comments from @pivotal-nader-ziada |
looks good to me, thanks @dibbles /lgtm |
[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:
Approvers can indicate their approval by writing |
@imjasonh @shashwathi might be a good idea to port a similar change to |
Excellent @dibbles !! Thanks so much for taking care of this :D (I'm gonna update the release notes to include the bug fix info) |
copying solution from tektoncd pipeline: tektoncd/pipeline#555 Credit to @dibbles on the original PR
* 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
* 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
* 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
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
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.