From 3269ddd64dee9df3f9b50567c5eec34e23a00e52 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 28 Jan 2025 17:34:04 -0500 Subject: [PATCH 1/5] CI: Run the AWS peer discovery workflow on changes to the workflow file (cherry picked from commit b62a36d0140d52020ffad6d925960d35ae18851b) --- .github/workflows/rabbitmq_peer_discovery_aws.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rabbitmq_peer_discovery_aws.yaml b/.github/workflows/rabbitmq_peer_discovery_aws.yaml index 2e94da990fcd..e1183a2107d1 100644 --- a/.github/workflows/rabbitmq_peer_discovery_aws.yaml +++ b/.github/workflows/rabbitmq_peer_discovery_aws.yaml @@ -2,6 +2,7 @@ name: Peer Discovery AWS Integration Test on: push: paths: + - ".github/workflows/peer-discovery-aws.yaml" - "deps/rabbitmq_peer_discovery_aws/**" - "deps/rabbitmq_peer_discovery_common/**" - "deps/rabbit/src/rabbit_peer_discovery.erl" From ac2c411c06245a96b6cd2a77a5780c7e770ce74e Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 30 Jan 2025 17:39:50 -0500 Subject: [PATCH 2/5] Add back metadata labels to the OCI build This fixes a regression from 6692fcb6: setting the `labels` to the output of the metadata step attaches useful standardized labels like the git hash when built, the source URL and the created timestamp. Actions like `int128/wait-for-docker-image-action` used in the `peer-discovery-aws` workflow use the revision label to detect that the latest image has the desired hash. Without setting `labels` we seem to inherit the version label from the base erlang image: $ docker image inspect -f '{{ json .Config.Labels }}' \ pivotalrabbitmq/rabbitmq:sha-0e7b53c6a8b682411c3f0024691a4760d8219699-otp27 {"org.opencontainers.image.version":"27.2.1"} (cherry picked from commit ed522fea883fd31ea7cf2ebb1c30ae1cf12f445a) # Conflicts: # .github/workflows/oci-make.yaml --- .github/workflows/oci-make.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/oci-make.yaml b/.github/workflows/oci-make.yaml index 6c1a2ba61583..ef54732d4f93 100644 --- a/.github/workflows/oci-make.yaml +++ b/.github/workflows/oci-make.yaml @@ -107,6 +107,7 @@ jobs: uses: docker/build-push-action@v6 with: context: packaging/docker-image +<<<<<<< HEAD platforms: ${{ matrix.platform }} labels: ${{ steps.meta.outputs.labels }} cache-to: type=gha @@ -174,3 +175,13 @@ jobs: cat << 'EOF' | jq -e 'map(.result == "success") | all(.)' ${{ toJson(needs) }} EOF +======= + labels: ${{ steps.meta.outputs.labels }} + platforms: ${{ github.event.inputs.build_arm && 'linux/amd64, linux/arm64' || 'linux/amd64' }} + tags: ${{ steps.meta.outputs.tags }} + cache-to: type=gha,mode=max,scope=${{ matrix.otp_version }} + cache-from: type=gha,scope=${{ matrix.otp_version }} + build-args: | + OTP_VERSION=${{ matrix.otp_version }} + RABBITMQ_VERSION=${{ env.VERSION }} +>>>>>>> ed522fea8 (Add back metadata labels to the OCI build) From 7827e601a8ca96adbd8db599609a7765bf251001 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 30 Jan 2025 17:39:26 -0500 Subject: [PATCH 3/5] Switch AWS peer discovery tests from Bazel to make This change includes some fixes like setting the suffix for the metadata which is necessary since 6692fcb6. The main reason for this change though is to switch from running the integration_SUITE from the AWS peer discovery plugin from Bazel to make, a necessary step to dropping the Bazel files. (cherry picked from commit e01ab9b9cca5fb4aaf3e086ae2cc88d3705c2770) --- .../rabbitmq_peer_discovery_aws.yaml | 65 ++++++------------- 1 file changed, 19 insertions(+), 46 deletions(-) diff --git a/.github/workflows/rabbitmq_peer_discovery_aws.yaml b/.github/workflows/rabbitmq_peer_discovery_aws.yaml index e1183a2107d1..f8f643590cd2 100644 --- a/.github/workflows/rabbitmq_peer_discovery_aws.yaml +++ b/.github/workflows/rabbitmq_peer_discovery_aws.yaml @@ -12,6 +12,8 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} cancel-in-progress: true +env: + OTP_VERSION: "27" jobs: peer-discovery-aws-integration-test: name: Integration Test @@ -34,6 +36,8 @@ jobs: id: metadata with: images: pivotalrabbitmq/rabbitmq + flavor: | + suffix=-otp${{ env.OTP_VERSION }} tags: | type=sha,format=long - uses: int128/wait-for-docker-image-action@v1 @@ -42,23 +46,12 @@ jobs: tags: ${{ steps.metadata.outputs.tags }} timeout-seconds: 3600 polling-seconds: 60 - - name: COMPUTE REPO CACHE KEY - if: steps.authorized.outputs.authorized == 'true' - id: repo-cache-key - run: | - echo "value=bazel-repo-cache-${{ hashFiles('MODULE.bazel') }}" | tee -a $GITHUB_OUTPUT - - name: LOAD REPO CACHE - if: steps.authorized.outputs.authorized == 'true' - uses: actions/cache/restore@v4 - with: - key: ${{ steps.repo-cache-key.outputs.value }} - path: /home/runner/repo-cache/ - name: CONFIGURE OTP & ELIXIR if: steps.authorized.outputs.authorized == 'true' uses: erlef/setup-beam@v1.17 with: - otp-version: 26 - elixir-version: 1.15 + otp-version: ${{ env.OTP_VERSION }} + elixir-version: "1.17" - name: SETUP ecs-cli if: steps.authorized.outputs.authorized == 'true' env: @@ -67,40 +60,20 @@ jobs: curl -Lo /usr/local/bin/ecs-cli https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-linux-amd64-v${ECS_CLI_VERSION} && \ chmod +x /usr/local/bin/ecs-cli && \ ecs-cli --version - - name: AUTHENTICATE TO GOOGLE CLOUD - if: steps.authorized.outputs.authorized == 'true' - uses: google-github-actions/auth@v2.1.7 - with: - credentials_json: ${{ secrets.REMOTE_CACHE_CREDENTIALS_JSON }} - - name: CONFIGURE BAZEL - if: steps.authorized.outputs.authorized == 'true' - run: | - if [ -n "${{ secrets.REMOTE_CACHE_BUCKET_NAME }}" ]; then - cat << EOF >> user.bazelrc - build --remote_cache=https://storage.googleapis.com/${{ secrets.REMOTE_CACHE_BUCKET_NAME }} - build --google_default_credentials - - build --experimental_guard_against_concurrent_changes - EOF - fi - cat << EOF >> user.bazelrc - build --repository_cache=/home/runner/repo-cache/ - build --color=yes - EOF - - bazelisk info release - #! - name: Setup tmate session - #! uses: mxschmitt/action-tmate@v3 - name: RUN INTEGRATION TESTS if: steps.authorized.outputs.authorized == 'true' + env: + AWS_ACCESS_KEY_ID: "${{ secrets.CONCOURSE_AWS_ACCESS_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.CONCOURSE_AWS_SECRET_ACCESS_KEY }}" + RABBITMQ_IMAGE: "${{ steps.metadata.outputs.tags }}" run: | branch_or_tag="${GITHUB_REF##*/}" - bazelisk test //deps/rabbitmq_peer_discovery_aws:integration_SUITE \ - --test_tag_filters=aws \ - --build_tests_only \ - --test_env AWS_ACCESS_KEY_ID=${{ secrets.CONCOURSE_AWS_ACCESS_KEY_ID }} \ - --test_env AWS_SECRET_ACCESS_KEY=${{ secrets.CONCOURSE_AWS_SECRET_ACCESS_KEY }} \ - --test_env RABBITMQ_IMAGE="pivotalrabbitmq/rabbitmq:sha-${{ github.sha }}" \ - --test_env AWS_ECS_CLUSTER_NAME="rabbitmq-peer-discovery-aws-actions-${branch_or_tag//[._]/-}" \ - --test_output=streamed \ - --verbose_failures + export AWS_ECS_CLUSTER_NAME="rabbitmq-peer-discovery-aws-actions-${branch_or_tag//[._]/-}" + make -C deps/rabbitmq_peer_discovery_aws ct-integration + - name: UPLOAD TEST LOGS + if: always() + uses: actions/upload-artifact@v4 + with: + name: CT logs + path: "logs/" + if-no-files-found: ignore From 8dc02505749907702fc540c0dea86ebcf73ec27c Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 31 Jan 2025 09:11:27 -0500 Subject: [PATCH 4/5] Rename 'utf8_string' type in MQTT packet_prop_SUITE `proper-testing/proper` recently added `proper_unicode:utf8_string` which is automatically imported and conflicts with this custom generator. (cherry picked from commit 7baf39798bb8d9b2866723d8361a09152916ece0) --- deps/rabbitmq_mqtt/test/packet_prop_SUITE.erl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/deps/rabbitmq_mqtt/test/packet_prop_SUITE.erl b/deps/rabbitmq_mqtt/test/packet_prop_SUITE.erl index 0771b255b2bf..5a28c5df61f7 100644 --- a/deps/rabbitmq_mqtt/test/packet_prop_SUITE.erl +++ b/deps/rabbitmq_mqtt/test/packet_prop_SUITE.erl @@ -103,7 +103,7 @@ publish_packet() -> retain = boolean()}, variable = #mqtt_packet_publish{ packet_id = packet_id(Qos), - topic_name = utf8_string()}, + topic_name = mqtt_utf8_string()}, payload = binary()}). publish_with_properties_packet() -> @@ -135,15 +135,15 @@ publish_properties() -> list(elements([{'Payload-Format-Indicator', bit()}, {'Message-Expiry-Interval', four_byte_integer()}, {'Topic-Alias', two_byte_integer()}, - {'Response-Topic', utf8_string()}, + {'Response-Topic', mqtt_utf8_string()}, {'Correlation-Data', binary_data()}, user_property(), - {'Content-Type', utf8_string()}])), + {'Content-Type', mqtt_utf8_string()}])), maps:from_list(L)). puback_properties() -> ?LET(L, - list(elements([{'Reason-String', utf8_string()}, + list(elements([{'Reason-String', mqtt_utf8_string()}, user_property() ])), maps:from_list(L)). @@ -151,7 +151,7 @@ puback_properties() -> disconnect_properties() -> ?LET(L, list(elements([{'Session-Expiry-Interval', four_byte_integer()}, - {'Reason-String', utf8_string()}, + {'Reason-String', mqtt_utf8_string()}, user_property() ])), maps:from_list(L)). @@ -161,7 +161,7 @@ user_property() -> non_empty(list(frequency( [{5, utf8_string_pair()}, %% "The same name is allowed to appear more than once." [v5 3.3.2.3.7] - {1, {<<"same name">>, utf8_string()}}, + {1, {<<"same name">>, mqtt_utf8_string()}}, {1, {<<"same name">>, <<"same value">>}} ])))}. @@ -204,11 +204,11 @@ binary_up_to(N) -> %% v5 1.5.7 utf8_string_pair() -> - {utf8_string(), utf8_string()}. + {mqtt_utf8_string(), mqtt_utf8_string()}. %% "Unless stated otherwise all UTF-8 encoded strings can have any length %% in the range 0 to 65,535 bytes." v5 1.5.4 -utf8_string() -> +mqtt_utf8_string() -> %% Defining an upper size other than 'inf' is too slow because the %% test ?SIZE is not taken into account anymore. MaxCodePointSize = 4, From 0b227d281fcf0cdbda29027423e1e661955a4263 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 31 Jan 2025 09:04:05 -0500 Subject: [PATCH 5/5] erlang.mk: Update repository URL for proper dep Proper was moved under the `proper-testing` org. (cherry picked from commit 2f3422c495d5cc53ffebf5ef860a3da4f81b96b4) --- erlang.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erlang.mk b/erlang.mk index 1d2e3be2a9c4..44e76f558ac3 100644 --- a/erlang.mk +++ b/erlang.mk @@ -2680,7 +2680,7 @@ pkg_proper_name = proper pkg_proper_description = PropEr: a QuickCheck-inspired property-based testing tool for Erlang. pkg_proper_homepage = http://proper.softlab.ntua.gr pkg_proper_fetch = git -pkg_proper_repo = https://github.com/manopapad/proper +pkg_proper_repo = https://github.com/proper-testing/proper pkg_proper_commit = master PACKAGES += props