From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, nicola.vetrini@bugseng.com,
consulting@bugseng.com
Subject: Re: [PATCH] automation: fix eclair scanning for merge requests
Date: Sat, 03 Aug 2024 08:17:01 +0200 [thread overview]
Message-ID: <f5990dbcf0131768fdfd35bfdfd8930c@bugseng.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2408011500280.114241@ubuntu-linux-20-04-desktop>
On 2024-08-02 00:06, Stefano Stabellini wrote:
> The ECLAIR jobs part of the Gitlab CI pipeline fail reliably when the
> pipeline is started from a merge request. This is the error:
>
> Unexpected event pull_request
>
> The error is a consequence of action.settings setting
> event=pull_request
> for merge_request_event. Given that we don't need any special behavior
> from ECLAIR for merge requests, just run the regular scan, change
> action.settings to set event=push for merge_request_event (same as for
> pipeline triggered by git push).
>
According to my analysis, the error stems from the fact that
automation/scripts/eclair unconditionally calls action_push.sh, which is
not designed to handle merge requests (that would be
action_pull_request.sh). One approach, that needs to be tested, could be
to execute that second script based on the value of
${CI_PIPELINE_SOURCE}.
The main difference the approach taken in this patch is that the
analysis results will be relative to the nearest merge point with the
staging tree. If that's not something that is desired, then this
approach looks good to me.
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
>
> ---
> Example of a failure:
> https://gitlab.com/xen-project/hardware/xen/-/jobs/7486162928
>
> Example of a success with this patch applies:
> https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/1397672866
>
> diff --git a/automation/eclair_analysis/ECLAIR/action.settings
> b/automation/eclair_analysis/ECLAIR/action.settings
> index 1577368b61..1bfb22b1c1 100644
> --- a/automation/eclair_analysis/ECLAIR/action.settings
> +++ b/automation/eclair_analysis/ECLAIR/action.settings
> @@ -64,14 +64,11 @@ gitlab)
>
> case "${CI_PIPELINE_SOURCE}" in
> merge_request_event)
> - event=pull_request
> - pullRequestId="${CI_MERGE_REQUEST_IID}"
> - pullRequestHeadRef="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
> - pullRequestHeadRepo="${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}"
> - pullRequestBaseRef="${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
> - pullRequestUser="${GITLAB_USER_LOGIN}"
> + event=push
> + ref_kind=branch
> + ref="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
> headCommitId="${CI_COMMIT_SHA}"
> - baseCommitId="${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
> + pushUser="${GITLAB_USER_NAME}"
> ;;
> push | pipeline | web | schedule)
> event=push
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
next prev parent reply other threads:[~2024-08-03 6:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 22:06 [PATCH] automation: fix eclair scanning for merge requests Stefano Stabellini
2024-08-03 6:17 ` Nicola Vetrini [this message]
2024-08-06 1:03 ` Stefano Stabellini
2024-08-06 6:35 ` Simone Ballarin
2024-08-06 18:25 ` Stefano Stabellini
2024-08-06 19:15 ` Simone Ballarin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f5990dbcf0131768fdfd35bfdfd8930c@bugseng.com \
--to=nicola.vetrini@bugseng.com \
--cc=consulting@bugseng.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.