Skip to content

Commit 9e1dfa2

Browse files
authored
Merge branch 'develop' into test/abac
2 parents ebe099f + d3511ea commit 9e1dfa2

File tree

4 files changed

+124
-31
lines changed

4 files changed

+124
-31
lines changed

.github/actions/build-docker/action.yml

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,25 +119,53 @@ runs:
119119
echo "Contents of /tmp/meta.json:"
120120
cat /tmp/meta.json
121121
122-
SERVICE_SUFFIX=${{ inputs.service == 'rocketchat' && inputs.type == 'coverage' && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
122+
if [[ "${{ inputs.publish-image }}" == 'true' ]]; then
123+
SERVICE_SUFFIX=${{ inputs.service == 'rocketchat' && inputs.type == 'coverage' && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
124+
125+
mkdir -p /tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}
123126
124-
mkdir -p /tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}
127+
# Get digest and image info
128+
DIGEST=$(jq -r '.["${{ inputs.service }}"].["containerimage.digest"]' "/tmp/meta.json")
129+
IMAGE_NO_TAG=$(echo "$IMAGE" | sed 's/:.*$//')
130+
FULL_IMAGE="${IMAGE_NO_TAG}@${DIGEST}"
125131
126-
# Get digest and image info
127-
DIGEST=$(jq -r '.["${{ inputs.service }}"].["containerimage.digest"]' "/tmp/meta.json")
128-
IMAGE_NO_TAG=$(echo "$IMAGE" | sed 's/:.*$//')
129-
FULL_IMAGE="${IMAGE_NO_TAG}@${DIGEST}"
132+
echo "Inspecting image: $FULL_IMAGE"
130133
131-
echo "Inspecting image: $FULL_IMAGE"
134+
# Inspect the image and save complete manifest with sizes (using -v for verbose)
135+
docker manifest inspect -v "$FULL_IMAGE" > "/tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/manifest.json"
136+
137+
echo "Saved manifest to /tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/manifest.json"
138+
cat "/tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/manifest.json" | jq '.'
139+
fi
132140
133-
# Inspect the image and save complete manifest with sizes (using -v for verbose)
134-
docker manifest inspect -v "$FULL_IMAGE" > "/tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/manifest.json"
141+
- name: Save Docker image as artifact
142+
if: inputs.publish-image == 'false' && inputs.arch == 'amd64'
143+
shell: bash
144+
run: |
145+
set -o xtrace
135146
136-
echo "Saved manifest to /tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/manifest.json"
137-
cat "/tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/manifest.json" | jq '.'
147+
# Get image name from docker-compose-ci.yml
148+
IMAGE=$(docker compose -f docker-compose-ci.yml config --format json 2>/dev/null | jq -r --arg s "${{ inputs.service }}" '.services[$s].image')
149+
150+
# Create directory for image archives
151+
mkdir -p /tmp/docker-images
152+
153+
# Save the image to a tar file
154+
docker save "${IMAGE}" -o "/tmp/docker-images/${{ inputs.service }}-${{ inputs.arch }}-${{ inputs.type }}.tar"
155+
156+
echo "Saved image to /tmp/docker-images/${{ inputs.service }}-${{ inputs.arch }}-${{ inputs.type }}.tar"
157+
ls -lh /tmp/docker-images/
158+
159+
- name: Upload Docker image artifact
160+
if: inputs.publish-image == 'false' && inputs.arch == 'amd64'
161+
uses: actions/upload-artifact@v4
162+
with:
163+
name: docker-image-${{ inputs.service }}-${{ inputs.arch }}-${{ inputs.type }}
164+
path: /tmp/docker-images/${{ inputs.service }}-${{ inputs.arch }}-${{ inputs.type }}.tar
165+
retention-days: 1
138166

139167
- uses: actions/upload-artifact@v4
140-
if: inputs.publish-image == 'true'
168+
if: inputs.publish-image == 'true' && inputs.arch == 'amd64'
141169
with:
142170
name: manifests-${{ inputs.service }}-${{ inputs.arch }}-${{ inputs.type }}
143171
path: /tmp/manifests

.github/workflows/ci-test-e2e.yml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ env:
6464
MONGO_URL: mongodb://localhost:27017/rocketchat?replicaSet=rs0&directConnection=true
6565
TOOL_NODE_FLAGS: ${{ vars.TOOL_NODE_FLAGS }}
6666
LOWERCASE_REPOSITORY: ${{ inputs.lowercase-repo }}
67-
DOCKER_TAG: ${{ inputs.gh-docker-tag }}
67+
DOCKER_TAG: ${{ inputs.gh-docker-tag }}-amd64
6868

6969
jobs:
7070
test:
@@ -135,17 +135,33 @@ jobs:
135135
run: |
136136
tar -xzf /tmp/RocketChat-packages-build.tar.gz -C .
137137
138-
# if we are testing a PR from a fork, we need to build the docker image at this point
139-
- uses: ./.github/actions/build-docker
140-
if: github.event_name == 'pull_request' && (github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]')
138+
# Download Docker images from build artifacts
139+
- name: Download Docker images
140+
uses: actions/download-artifact@v7
141+
if: github.event.pull_request.head.repo.full_name != github.repository && github.event_name != 'release' && github.ref != 'refs/heads/develop'
141142
with:
142-
CR_USER: ${{ secrets.CR_USER }}
143-
CR_PAT: ${{ secrets.CR_PAT }}
144-
# the same reason we need to rebuild the docker image at this point is the reason we dont want to publish it
145-
publish-image: false
146-
arch: amd64
147-
service: 'rocketchat'
148-
type: 'coverage'
143+
pattern: ${{ inputs.release == 'ce' && 'docker-image-rocketchat-amd64-coverage' || 'docker-image-*-amd64-coverage' }}
144+
path: /tmp/docker-images
145+
merge-multiple: true
146+
147+
# Load Docker images
148+
- name: Load Docker images
149+
if: github.event.pull_request.head.repo.full_name != github.repository && github.event_name != 'release' && github.ref != 'refs/heads/develop'
150+
shell: bash
151+
run: |
152+
set -o xtrace
153+
154+
# Load all downloaded images
155+
for image_file in /tmp/docker-images/*.tar; do
156+
if [ -f "$image_file" ]; then
157+
echo "Loading image from $image_file"
158+
docker load -i "$image_file"
159+
rm "$image_file"
160+
fi
161+
done
162+
163+
# List loaded images
164+
docker images
149165
150166
- name: Set DEBUG_LOG_LEVEL (debug enabled)
151167
if: runner.debug == '1'

.github/workflows/ci.yml

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ jobs:
314314
# we only build and publish the actual docker images if not a PR from a fork
315315
- name: Image ${{ matrix.service[0] }}
316316
uses: ./.github/actions/build-docker
317-
if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') && github.actor != 'dependabot[bot]'
317+
if: github.actor != 'dependabot[bot]'
318318
env:
319319
# add suffix for the extra images with coverage if building for production
320320
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ matrix.type == 'coverage' && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
@@ -325,10 +325,11 @@ jobs:
325325
arch: ${{ matrix.arch }}
326326
service: ${{ matrix.service[0] }}
327327
type: ${{ matrix.type }}
328+
publish-image: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop' }}
328329

329330
- name: Image ${{ matrix.service[1] || '"skipped"' }}
330331
uses: ./.github/actions/build-docker
331-
if: matrix.service[1] && (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') && github.actor != 'dependabot[bot]'
332+
if: matrix.service[1] && github.actor != 'dependabot[bot]'
332333
env:
333334
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ matrix.type == 'coverage' && '-cov' || '' }}
334335
with:
@@ -338,11 +339,12 @@ jobs:
338339
arch: ${{ matrix.arch }}
339340
service: ${{ matrix.service[1] }}
340341
type: ${{ matrix.type }}
342+
publish-image: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop' }}
341343
setup-docker: false
342344

343345
- name: Image ${{ matrix.service[2] || '"skipped"' }}
344346
uses: ./.github/actions/build-docker
345-
if: matrix.service[2] && (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') && github.actor != 'dependabot[bot]'
347+
if: matrix.service[2] && github.actor != 'dependabot[bot]'
346348
env:
347349
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ matrix.type == 'coverage' && '-cov' || '' }}
348350
with:
@@ -352,11 +354,12 @@ jobs:
352354
arch: ${{ matrix.arch }}
353355
service: ${{ matrix.service[2] }}
354356
type: ${{ matrix.type }}
357+
publish-image: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop' }}
355358
setup-docker: false
356359

357360
- name: Image ${{ matrix.service[3] || '"skipped"' }}
358361
uses: ./.github/actions/build-docker
359-
if: matrix.service[3] && (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') && github.actor != 'dependabot[bot]'
362+
if: matrix.service[3] && github.actor != 'dependabot[bot]'
360363
env:
361364
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ matrix.type == 'coverage' && '-cov' || '' }}
362365
with:
@@ -366,6 +369,7 @@ jobs:
366369
arch: ${{ matrix.arch }}
367370
service: ${{ matrix.service[3] }}
368371
type: ${{ matrix.type }}
372+
publish-image: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop' }}
369373
setup-docker: false
370374

371375
build-gh-docker-publish:
@@ -452,6 +456,7 @@ jobs:
452456

453457
- name: Track Docker image sizes
454458
uses: ./.github/actions/docker-image-size-tracker
459+
if: github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository
455460
with:
456461
github-token: ${{ secrets.GITHUB_TOKEN }}
457462
ci-pat: ${{ secrets.CI_PAT }}
@@ -580,10 +585,11 @@ jobs:
580585
REPORTER_ROCKETCHAT_URL: ${{ secrets.REPORTER_ROCKETCHAT_URL }}
581586
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
582587
REPORTER_JIRA_ROCKETCHAT_API_KEY: ${{ secrets.REPORTER_JIRA_ROCKETCHAT_API_KEY }}
588+
583589
test-federation-matrix:
584590
name: 🔨 Test Federation Matrix
585591
needs: [checks, build-gh-docker-publish, packages-build, release-versions]
586-
runs-on: ubuntu-24.04-arm
592+
runs-on: ubuntu-24.04
587593

588594
steps:
589595
- uses: actions/checkout@v6
@@ -621,15 +627,58 @@ jobs:
621627
sudo -- sh -c "echo '127.0.0.1 hs1' >> /etc/hosts"
622628
sudo -- sh -c "echo '127.0.0.1 rc1' >> /etc/hosts"
623629
630+
# Download Docker images from build artifacts
631+
- name: Download Docker images
632+
uses: actions/download-artifact@v7
633+
if: github.event.pull_request.head.repo.full_name != github.repository && github.event_name != 'release' && github.ref != 'refs/heads/develop'
634+
with:
635+
pattern: 'docker-image-rocketchat-amd64-coverage'
636+
path: /tmp/docker-images
637+
merge-multiple: true
638+
639+
# Load Docker images
640+
- name: Load Docker images
641+
if: github.event.pull_request.head.repo.full_name != github.repository && github.event_name != 'release' && github.ref != 'refs/heads/develop'
642+
shell: bash
643+
run: |
644+
set -o xtrace
645+
646+
# Load all downloaded images
647+
for image_file in /tmp/docker-images/*.tar; do
648+
if [ -f "$image_file" ]; then
649+
echo "Loading image from $image_file"
650+
docker load -i "$image_file"
651+
rm "$image_file"
652+
fi
653+
done
654+
655+
# List loaded images
656+
docker images
657+
624658
- name: Run federation integration tests with pre-built image
625659
working-directory: ./ee/packages/federation-matrix
626660
env:
627-
ROCKETCHAT_IMAGE: ghcr.io/${{ needs.release-versions.outputs.lowercase-repo }}/rocket.chat:${{ needs.release-versions.outputs.gh-docker-tag }}
628-
ENTERPRISE_LICENSE_RC1: ${{ secrets.ENTERPRISE_LICENSE_RC1 }}
661+
ROCKETCHAT_IMAGE: ghcr.io/${{ needs.release-versions.outputs.lowercase-repo }}/rocket.chat:${{ needs.release-versions.outputs.gh-docker-tag }}-amd64
662+
ENTERPRISE_LICENSE_RC1: ZEuDWcAxkdBZ0iOzn+JIi7Ri0GKPR43hTueeqEEeTjJhzhp1jM7+fA9LiT3aCzU/oJwudwWLFAwqjrtR13axza+Us6lHuAMdfut/1Z6upRWdSgose1LfDP9Nzce6xOVbO3InQonwTQVQJotlYEGRjiry7jn68TSIKhmjMgC6SVYt6v+syEKRgj+r2oT0xNkurQYGGG1AIYHDqGWa1cX0FVd1ddOKU/DNuCJQxH8Rz5aJC2grIKMIzmRVHfBDJAipeTDl6VI28VM5ExEl3w8zDlUk8wCxXawXGCht0A7jZGCd4IQLDNZs/3Zv+nHC4lcDVzjDu+o17vUIEad4m+nhZgGTNlHqkrH3cqEEEPa3bSh8GKBzLmKHB+i0H3dweT9iqGwz56Nue7twyt5yuGq6qYdtrEx0pEKjystU15DUiQxDPqkBL8yRkp5WScsvJIlhiY+4tU6yKI/GAYtU0g+fCYzjzwxXc7tLg5NeY9kiRMdQ+jRytl3ztHGiv5ERhjQKT9ZpUWiCSCmdr8L3njfLLW1e5/AKmXpg00D6HfJvI30xDcoJwmWnCzFvd7KlSbVwNVBlD6KE9+0j6GV1h0JEml1YrpXUxbpEBz5ALdLn2iVPQ3MT5RODRI5yffSX9ikFkwcH360ewU6Zp63WKRkHyfnzE+tsYe96XdaMZowe7Lw=
629663
QASE_TESTOPS_JEST_API_TOKEN: ${{ secrets.QASE_TESTOPS_JEST_API_TOKEN }}
630664
PR_NUMBER: ${{ github.event.number }}
631665
run: yarn test:integration --image "${ROCKETCHAT_IMAGE}"
632666

667+
- name: Show rc server logs if tests failed
668+
if: failure()
669+
working-directory: ./ee/packages/federation-matrix
670+
run: docker compose -f docker-compose.test.yml logs rc1-prebuilt
671+
672+
- name: Show hs server logs if tests failed
673+
if: failure()
674+
working-directory: ./ee/packages/federation-matrix
675+
run: docker compose -f docker-compose.test.yml logs hs1
676+
677+
- name: Show mongo logs if tests failed
678+
if: failure()
679+
working-directory: ./ee/packages/federation-matrix
680+
run: docker compose -f docker-compose.test.yml logs mongo
681+
633682
report-coverage:
634683
name: 📊 Report Coverage
635684
runs-on: ubuntu-24.04

apps/meteor/client/components/message/MessageHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const MessageHeader = ({ message }: MessageHeaderProps): ReactElement => {
4545

4646
const showRoles = useMessageListShowRoles();
4747
const roles = useMessageRoles(message.u._id, message.rid, showRoles);
48-
const shouldShowRolesList = roles.length > 0;
48+
const shouldShowRolesList = showRoles && roles.length > 0;
4949

5050
return (
5151
<FuselageMessageHeader>

0 commit comments

Comments
 (0)