Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ jobs:
deno-version: ${{ needs.release-versions.outputs.deno-version }}
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
retries: ${{ (github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }}
retries: ${{ (github.event_name == 'release' || github.event_name == 'merge_group' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }}
secrets:
CR_USER: ${{ secrets.CR_USER }}
CR_PAT: ${{ secrets.CR_PAT }}
Expand Down Expand Up @@ -750,7 +750,7 @@ jobs:
deno-version: ${{ needs.release-versions.outputs.deno-version }}
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
retries: ${{ (github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }}
retries: ${{ (github.event_name == 'release' || github.event_name == 'merge_group' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }}
secrets:
CR_USER: ${{ secrets.CR_USER }}
CR_PAT: ${{ secrets.CR_PAT }}
Expand Down Expand Up @@ -821,7 +821,7 @@ jobs:
deno-version: ${{ needs.release-versions.outputs.deno-version }}
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
retries: ${{ (github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }}
retries: ${{ (github.event_name == 'release' || github.event_name == 'merge_group' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the job and the relevant condition/retry lines in the workflow.
rg -n -C 4 "test-ui-fips|contains\\(github\\.event\\.pull_request\\.labels|retries:" .github/workflows/ci.yml

Repository: RocketChat/Rocket.Chat

Length of output: 1973


🌐 Web query:

Rocket.Chat .github/workflows/ci.yml test-ui-fips merge_group contains(github.event.pull_request.labels)

💡 Result:

Based on the provided search results from the Rocket.Chat repository and general GitHub Actions practices, there is no evidence of a test-ui-fips job or configuration in the Rocket.Chat ci.yml file [1][2][3][4]. The repository's CI workflow focuses on standard UI and API tests (both Community and Enterprise editions) [1][2][3][4]. Regarding the technical concern about merge_group and contains(github.event.pull_request.labels), GitHub Actions merge_group events do not contain the pull_request object [5][6]. Consequently, using contains(github.event.pull_request.labels) within a job triggered by a merge_group event will fail because github.event.pull_request is undefined in that context [5][6]. To handle label-based logic in workflows that support both pull_request and merge_group events, best practices involve checking the event name [5][6]. For example: - if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'your-label') If a job must run for a merge group, it is common to either skip the label check or assume the necessary validation was completed during the original pull request check [5][6].

Citations:


🌐 Web query:

"contains(github.event.pull_request.labels.*.name, 'fips')" "Rocket.Chat" ".github/workflows/ci.yml"

💡 Result:

The expression contains(github.event.pull_request.labels.*.name, 'fips') is a GitHub Actions expression used to check if a pull request has a label named "fips" [1]. This pattern is commonly used in conditional logic within GitHub Actions workflow files to trigger specific jobs or steps [1]. While the "fips" label is used in Rocket.Chat's development context—such as in pull request #18661 regarding FIPS-compliant algorithms [2] and referenced in internal Jira tasks related to FIPS compliance [3]—there is no evidence that this specific contains expression is a hardcoded or standard part of the main Rocket.Chat .github/workflows/ci.yml file [4][5]. Rocket.Chat maintains FIPS-compliant Docker images for federal deployments [6], but the CI pipeline logic primarily relies on standard event triggers (e.g., pull_request, push, release) and input-driven workflows rather than label-based filtering for FIPS specifically [4][5][7]. If you are implementing this in a workflow, you must ensure that your job trigger includes the labeled or unlabeled types if you intend to run the workflow specifically when a label is added or removed [1]. Without these, the github.event.pull_request object may not contain the updated labels in all contexts [1].

Citations:


🌐 Web query:

site:github.com/RocketChat/Rocket.Chat/blob e75965c0 .github/workflows/ci.yml "test-ui-fips" "merge_group" "github.event.pull_request.labels"

💡 Result:

The query components refer to files and configuration logic within the Rocket.Chat repository (specifically at commit e75965c) [1][2][3]. 1. e75965c: This is a specific Git commit hash from the RocketChat/Rocket.Chat repository [1][2][3]. 2..github/workflows/ci.yml: This is the primary continuous integration workflow file for the project [1]. It defines the triggers for the CI pipeline, including pull_request, merge_group, and push events [1][4]. 3. test-ui-fips: This appears to be a specific CI job name or a referenced test suite configuration within the project's ecosystem, often utilized for FIPS-compliant UI testing [4][5]. 4. merge_group: This is a GitHub Actions trigger used to run workflows when a pull request is added to a merge group (part of GitHub's Merge Queue feature) [1][4]. 5. github.event.pull_request.labels: This is a GitHub Actions context expression used to access the labels associated with a pull request [4]. It is commonly used in conditional logic (if statements) within workflow steps or jobs to determine whether they should execute based on specific labels attached to a PR (e.g., triggering specialized tests only when a certain label is present) [4][5]. In the context of the Rocket.Chat repository, these elements are part of a complex CI/CD setup that utilizes reusable workflows (like ci-test-e2e.yml) [2][4] and conditional execution based on workflow events, branches, and PR metadata to manage testing, building, and deployment [1][4].

Citations:


🌐 Web query:

GitHub Actions merge_group event payload pull_request object official docs

💡 Result:

The merge_group event in GitHub Actions does not contain a pull_request object [1]. This is a frequent point of confusion, as the merge_group event is distinct from the pull_request event [2][3][4]. While the pull_request event payload provides comprehensive details about a specific pull request, the merge_group event payload is focused on the temporary merge group branch created by the merge queue to validate changes [5][4][6]. Key points regarding the merge_group event payload: 1. Payload Structure: The top-level object for a merge_group event includes a merge_group field (an object) [6], but it does not include a pull_request field [1]. 2. Event Purpose: The merge_group event is triggered when a pull request is added to a merge queue [2][4]. It notifies workflows that they need to run status checks on the merge group branch [5][6]. 3. Data Availability: Because a single merge group can contain multiple queued pull requests [4][6], the event payload is structurally different from a standard pull_request event, which typically relates to a single, specific pull request [1]. 4. Accessing Information: If your workflow needs to interact with the pull request that triggered the queue, you cannot rely on the event payload to provide a pull_request object. Developers often have to use the GitHub API to fetch details about the pull requests included in the merge group if that information is required [1]. For further details on the specific fields available in the merge_group object (such as head_sha and base_sha), refer to the official GitHub Webhook events and payloads documentation [6].

Citations:


Gate test-ui-fips for merge_group explicitly
.github/workflows/ci.yml still checks contains(github.event.pull_request.labels.*.name, 'fips'), which won’t work on merge_group runs because that event has no pull_request label context. If this job should run in the merge queue, split the condition by event name and skip the label lookup for merge_group.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml at line 824, Update the test-ui-fips job condition
near the retries configuration to handle merge_group explicitly: allow the job
based on the merge_group event without evaluating
github.event.pull_request.labels, while retaining the existing fips-label check
for pull request events and other current gating behavior.

secrets:
CR_USER: ${{ secrets.CR_USER }}
CR_PAT: ${{ secrets.CR_PAT }}
Expand Down
Loading