jenkins-x / lighthouse

Apache License 2.0
183 stars 114 forks source link

fix: prevent repo from stop being handled #1523

Closed msvticket closed 1 year ago

msvticket commented 1 year ago

Fix of errors

Error creating agent for PushEvent.: failed to create agent: failed to calculate in repo config: failed to load trigger config for repository jenkins-x/jx3-versions for ref : failed to switch to ref : failed to merge repository jenkins-x/jx3-versions: failed to run command in dir /var/tmp/gitrepo2428068395: git, [merge FETCH_HEAD]: Updating 3e21ade2..3bebed28 error: Your local changes to the following files would be overwritten by merge:
    src/get-selectors-and-clean.sh
Please commit your changes or stash them before you merge. Aborting: exit status 1

Explanation

--no-checkout stages the deletion of all files which causes problem when merging upstreams changes to working directory. This is fixed by bypassing working directory when fetching upstreams changes to local branch no conflict occurs. Conflicts are then ignored during checking out with --force.

Other fixes

Stop using deprecated diff.ObjectReflectDiff

Sparse checkout is not working in the latest release of lighthouse since it got a new version of git with a different default handling of sparse checkouts. This is also addressed in this PR.

Make event specific logging fields get logged again

Ignore push events for deletion of branches that would otherwise cause error messages

Wrap more errors go get context

msvticket commented 1 year ago

/cc ankitm123 tomhobson babadofar

jenkins-x-bot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tomhobson

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](https://github.com/jenkins-x/lighthouse/blob/main/OWNERS)~~ [tomhobson] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
jenkins-x-bot commented 1 year ago

Failed to merge this PR due to:

failed merging [1523]: [Method Not Allowed]