Skip to content

CCM-15633: Add Pact tests for channel status published event#289

Open
gareth-allan wants to merge 19 commits intomainfrom
feature/CCM-15633_channel_status_update_pact_tests
Open

CCM-15633: Add Pact tests for channel status published event#289
gareth-allan wants to merge 19 commits intomainfrom
feature/CCM-15633_channel_status_update_pact_tests

Conversation

@gareth-allan
Copy link
Copy Markdown
Contributor

@gareth-allan gareth-allan commented Apr 14, 2026

Description

This PR adds Pact tests for the uk.nhs.notify.channel.status.PUBLISHED.v1 event that will be consumed by digital letters to identify when a user has opted out of receiving the paper copy of their digital letter.

Changes:

  • Added Pact tests in tests/pact-tests
    • A consumer test (in channel-status-published.consumer.pact.test.ts) that declares what Digital Letters expects in a uk.nhs.notify.channel.status.PUBLISHED.v1 event and makes sure the handler code we've implemented can properly handle an event matching our contract. Note: As we have not yet completed CCM-15676 there is no actual handler code to test, so a dummy function is used for the time-being
    • A "pact-verification" test (in channel-status-published.provider.pact.test.ts). This is a provider test in Pact terminology and is implemented here to allow us to verify the Pacts produced by the consumer test against the example events provided by the @nhsdigital/nhs-notify-event-schemas-status-published` that core publishes
  • Added a scripts/tests/contract.sh script so that the make test-contract Make target now runs the contract tests
  • Added an empty pact-contracts package (for pacts to be copied into by the CI workflow) and a scripts/publish-pact-contracts.sh script that will publish the pact-contracts package as an NPM package called @nhsdigital/notify-digital-letters-consumer-contracts to our Github package repo, so it can be consumed by core
  • Updated the Github workflows so that the contract tests are now run as part of "stage 2" (the test stage), rather than "stage 4" (the acceptance stage). This was because we'd otherwise be waiting until we'd deployed a dynamic environment before running contract tests, which is unnecessary (as they don't run against deploy instances of applications). The contract test run uploads the contracts produced as an artifact and they are then published as part of "stage 5" (the publish stage) alongside the steps that publish schemas, etc. This stage only runs on main.
  • Updated src/cloudevents/domains/common.mk so that it works on both Mac and the Github runners (thanks @Ian-Hodges!)

Context

As the uk.nhs.notify.channel.status.PUBLISHED.v1 event is published by core, we want to ensure there are tests in place that will identify is changes are made to core that would be incompatible with Digital Letters. Contract tests allow us to do this by ensuring that core is validating the events it produces against the requirements Digital Letters has declared (in the consumer test added as part of this PR).

Validation

Publishing of the Contracts Package

Downloaded the latest pact contracts artifact from the CI workflow and extracted it to pact-contracts/pacts:
Screenshot 2026-04-16 at 16 59 20

Updated scripts/publish-pact-contracts.sh to pass the --dry-run argument to npm publish, then ran it:
Screenshot 2026-04-16 at 17 03 28

Using the Contracts Package

Downloaded the latest pact contracts artifact from the CI workflow and extracted it to pact-contracts/pacts:
Screenshot 2026-04-16 at 16 59 20

Ran npm pack ./pact-contracts:
Screenshot 2026-04-16 at 17 07 48

Copied the nhsdigital-notify-digital-letters-consumer-contracts-1.0.0.tgz file into my comms-mgr repository.

Installed the package from file:
Screenshot 2026-04-16 at 17 32 15

With the changes from this PR, ran the comms-mgr component tests:
Screenshot 2026-04-17 at 10 00 05

Checking that Contract Tests Fail if the Schema Package is Outdated

I installed an outdated version of the @nhsdigital/nhs-notify-event-schemas-status-published package, tried to run the contract tests, then installed the latest version of the package and ran the contract tests again:
Screenshot 2026-04-17 at 16 48 45

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming - Produced with Copilot's assistance

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@gareth-allan gareth-allan force-pushed the feature/CCM-15633_channel_status_update_pact_tests branch 6 times, most recently from 5cae08f to eae77f1 Compare April 14, 2026 12:14
@gareth-allan gareth-allan force-pushed the feature/CCM-15633_channel_status_update_pact_tests branch from eae77f1 to 393d599 Compare April 14, 2026 13:57
Comment thread scripts/config/sonar-scanner.properties Outdated
@gareth-allan gareth-allan force-pushed the feature/CCM-15633_channel_status_update_pact_tests branch from 040a8fb to a4f5437 Compare April 14, 2026 15:13
@gareth-allan gareth-allan requested a review from Copilot April 14, 2026 15:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Pact-based consumer/provider verification for the Channel Status Published event, and aligns Digital Letters CloudEvents to a new plane/dataschemaversion-driven convention (removing /data-plane/ from source), with CI automation to run and publish generated pact contracts.

Changes:

  • Introduce a new tests/pact-tests workspace with consumer + provider verification, plus CI job + scripts to generate and publish pact contract artifacts.
  • Update CloudEvents schemas, generators, lambdas, and test fixtures to include plane: "data" / dataschemaversion: "1.0.0" and adjust source patterns accordingly.
  • Update several workspaces’ axios dependency version specifier.

Reviewed changes

Copilot reviewed 113 out of 116 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
utils/utils/src/tests/event-publisher/event-publisher.test.ts Updates test CloudEvent source strings to match new source convention.
utils/utils/package.json Updates axios version specifier.
utils/py-utils/dl_utils/tests/test_event_publisher.py Updates expected CloudEvent envelope fields (plane, dataschemaversion, source).
utils/comms-utils/package.json Adds a local stub package to satisfy an upstream dependency.
utils/comms-utils/index.js Exports empty module for stub package.
utils/comms-utils/index.d.ts Provides empty type surface for stub package.
utils/comms-utils/README.md Documents the stub package workaround.
tests/playwright/helpers/report-helpers.ts Updates reporting event fixtures (plane, dataschemaversion, source).
tests/playwright/helpers/event-builders.ts Updates shared builder to add plane/dataschemaversion and new source format.
tests/playwright/digital-letters-component-tests/ttl-handle.component.spec.ts Updates test events to include plane/dataschemaversion and new source.
tests/playwright/digital-letters-component-tests/ttl-create.component.spec.ts Updates test events to include plane/dataschemaversion and new source.
tests/playwright/digital-letters-component-tests/send-reports-trust.component.spec.ts Updates test events to include plane/dataschemaversion and new source.
tests/playwright/digital-letters-component-tests/print-sender.component.spec.ts Updates test events to include plane/dataschemaversion and new source.
tests/playwright/digital-letters-component-tests/print-analyser.component.spec.ts Updates test events to include plane/dataschemaversion and new source.
tests/playwright/digital-letters-component-tests/pdm-uploader.component.spec.ts Updates test events to include plane/dataschemaversion and new source.
tests/playwright/digital-letters-component-tests/pdm-poll.component.spec.ts Updates test events to include plane/dataschemaversion and new source.
tests/playwright/digital-letters-component-tests/mesh-poll-download.component.spec.ts Updates test events (plane, dataschemaversion, datacontenttype, source).
tests/playwright/digital-letters-component-tests/mesh-acknowledge.component.spec.ts Updates test events to include plane/dataschemaversion and new source.
tests/playwright/digital-letters-component-tests/file-scanner.component.spec.ts Updates queue event fixtures to include plane/dataschemaversion and new source.
tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts Updates PDM event fixtures to include plane/dataschemaversion and new source.
tests/pact-tests/utils/pact-config.ts Adds shared Pact config constants and pact file location.
tests/pact-tests/tsconfig.json Adds tsconfig for the pact-tests workspace.
tests/pact-tests/pact-verification/channel-status-published.provider.pact.test.ts Adds local provider verification against generated pact(s).
tests/pact-tests/package.json Adds pact-tests workspace package + scripts.
tests/pact-tests/jest.config.ts Adds jest config for pact-tests (based on repo base config).
tests/pact-tests/consumer/channel-status-published.consumer.pact.test.ts Adds consumer pact test validating schema parsing of the message.
tests/pact-tests/README.md Documents pact-tests scope and command.
src/typescript-schema-generator/PLAN.md Updates example source strings to the new format.
src/eventcatalog/package.json Updates axios version specifier used in overrides.
src/digital-letters-events/README.md Updates documentation examples for plane/dataschemaversion and new source format.
src/cloudevents/tools/generator/example-generator/example-generator.ts Ensures generated examples include plane + dataschemaversion.
src/cloudevents/domains/digital-letters/2025-10-draft/supplierapi-profile.schema.yaml Removes temporary Supplier API profile schema file.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.sent.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.generated.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.generate.report.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.invalid.attachment.received.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.file.safe.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.file.quarantined.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.unavailable.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.submitted.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.submission.rejected.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.retries.exceeded.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.available.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.submitted.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.skipped.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.rejected.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.received.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.invalid.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.acknowledged.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.letter.available.v1.schema.yaml Updates source pattern to remove /data-plane/.
src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-viewer-profile.schema.yaml Updates profile source pattern and minLength.
src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-reporting-profile.schema.yaml Updates profile source pattern and minLength.
src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-queue-profile.schema.yaml Updates profile source pattern and minLength.
src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-profile.schema.yaml Updates base profile ref and adds plane/dataschemaversion/datacontenttype.
src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-print-profile.schema.yaml Updates profile source pattern and minLength.
src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-pdm-profile.schema.yaml Updates profile source pattern and minLength.
src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-messages-profile.schema.yaml Updates profile source pattern and minLength.
src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-mesh-profile.schema.yaml Updates profile source pattern and minLength.
src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-letter-profile.schema.yaml Updates profile source pattern and minLength.
src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-fhir-profile.schema.yaml Updates profile source pattern and minLength.
src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-event-bus-profile.schema.yaml Updates profile source pattern and minLength.
scripts/tests/contract.sh Adds contract test runner script for make test-contract.
scripts/publish-pact-contracts.sh Adds script to publish pact contracts package to GitHub Packages.
scripts/config/sonar-scanner.properties Excludes utils/comms-utils from coverage scanning.
project.code-workspace Adds pact-tests workspace folder to VS Code workspace file.
pact-contracts/package.json Adds a publishable package for generated pact JSON artifacts.
package.json Adds test:contract script and includes tests/pact-tests workspace.
lambdas/ttl-handle-expiry-lambda/src/tests/apis/dynamodb-stream-handler.test.ts Updates DynamoDB stream test fixture to match new CloudEvent envelope fields.
lambdas/ttl-create-lambda/src/tests/data.ts Updates test fixture to include plane/dataschemaversion and new source.
lambdas/ttl-create-lambda/src/tests/apis/sqs-trigger-lambda.test.ts Updates SQS-trigger TTL create test fixture source.
lambdas/report-sender/report_sender/report_sender_processor.py Updates reporting event source and adds new envelope fields.
lambdas/report-sender/report_sender/tests/test_report_sender_processor.py Updates expected event envelope fields (plane, dataschemaversion, source).
lambdas/report-scheduler/src/apis/scheduled-event-handler.ts Adds envelope fields and updates source/dataschema for generate-report events.
lambdas/report-scheduler/src/tests/apis/scheduled-event-handler.test.ts Updates assertions for new event envelope fields.
lambdas/report-generator/src/tests/app/report-generator.test.ts Updates test event fixture to include envelope fields.
lambdas/report-generator/src/tests/apis/sqs-trigger-lambda.test.ts Updates SQS record fixture to include envelope fields and new source.
lambdas/report-event-transformer/src/tests/test-data.ts Updates fixture source string.
lambdas/refresh-apim-access-token/package.json Updates axios version specifier.
lambdas/print-status-handler/src/apis/sqs-handler.ts Updates output event source and sets plane/dataschemaversion.
lambdas/print-status-handler/src/tests/apis/sqs-handler.test.ts Updates expected source and includes plane/dataschemaversion in fixtures.
lambdas/print-sender-lambda/src/tests/app/print-sender.test.ts Updates PDFAnalysed fixture and validates plane.
lambdas/print-sender-lambda/src/tests/apis/sqs-trigger-lambda.test.ts Updates PDFAnalysed fixture to include envelope fields and new source.
lambdas/print-analyser/src/apis/sqs-handler.ts Updates generated event source string.
lambdas/print-analyser/src/tests/test-data.ts Updates fixture to include plane/dataschemaversion and new source.
lambdas/print-analyser/src/tests/apis/sqs-handler.test.ts Updates expected source string.
lambdas/pdm-uploader-lambda/src/tests/data.ts Updates fixture to include plane/dataschemaversion and new source.
lambdas/pdm-uploader-lambda/package.json Updates axios version specifier.
lambdas/pdm-poll-lambda/src/tests/test-data.ts Updates fixture to include plane/dataschemaversion and new source.
lambdas/move-scanned-files-lambda/src/domain/mapper.ts Adds envelope fields (plane, dataschema, dataschemaversion, datacontenttype) and updates source.
lambdas/move-scanned-files-lambda/src/tests/domain/mapper.test.ts Updates expected events with new envelope fields and updated source.
lambdas/move-scanned-files-lambda/src/tests/apis/sqs-handler.test.ts Updates SQS handler fixtures to include new envelope fields.
lambdas/move-scanned-files-lambda/package.json Updates axios version specifier.
lambdas/mesh-poll/mesh_poll/processor.py Updates source and adds envelope fields to published MESH events.
lambdas/mesh-download/mesh_download/processor.py Adds envelope fields to published downloaded event.
lambdas/mesh-download/mesh_download/tests/test_processor.py Updates fixtures and assertions for new envelope fields and source.
lambdas/mesh-acknowledge/mesh_acknowledge/events.py Adds envelope fields to acknowledged event.
lambdas/mesh-acknowledge/mesh_acknowledge/tests/test_events.py Updates fixtures/expected outputs for new envelope fields and source.
lambdas/mesh-acknowledge/mesh_acknowledge/tests/fixtures.py Updates downloaded event fixture source and adds envelope fields.
lambdas/file-scanner-lambda/src/tests/apis/sqs-handler.test.ts Updates fixtures to include plane/dataschemaversion and new source.
lambdas/core-notifier-lambda/src/tests/domain/mapper.test.ts Updates fixture to include plane/dataschemaversion.
lambdas/core-notifier-lambda/src/tests/constants.ts Updates PDM fixture to include envelope fields and dataschema.
lambdas/core-notifier-lambda/package.json Updates axios version specifier.
infrastructure/terraform/components/dl/modules_eventpub.tf Updates SNS publish policy condition to allow new EventBridge rule.
infrastructure/terraform/components/dl/cloudwatch_event_rule_data_plane.tf Adds EventBridge rule/target routing “data plane” events to SNS topic.
eslint.config.mjs Adds eslint override for tests/pact-tests relative import rule.
.gitignore Ignores generated pact outputs and published pact package artifacts.
.github/workflows/stage-5-publish.yaml Downloads pact contracts artifact and publishes pact-contracts package.
.github/workflows/stage-2-test.yaml Adds a dedicated “Contract tests” job and uploads generated pact artifacts.
.github/workflows/cicd-1-pull-request.yaml Changes workflow-level GitHub token permissions.

Comment thread src/digital-letters-events/README.md
Comment thread lambdas/print-sender-lambda/src/__tests__/app/print-sender.test.ts
Comment thread scripts/tests/contract.sh Outdated
Comment thread scripts/publish-pact-contracts.sh
Comment thread scripts/publish-pact-contracts.sh Outdated
Comment thread .github/workflows/cicd-1-pull-request.yaml
Comment thread utils/comms-utils/README.md Outdated
Comment thread src/digital-letters-events/README.md
@gareth-allan gareth-allan force-pushed the feature/CCM-15633_channel_status_update_pact_tests branch from a4f5437 to d529b58 Compare April 14, 2026 15:36
@gareth-allan gareth-allan requested a review from Copilot April 14, 2026 15:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 29 changed files in this pull request and generated 6 comments.

Comment thread .github/workflows/stage-2-test.yaml
Comment thread .github/workflows/stage-5-publish.yaml
Comment thread utils/comms-utils/README.md Outdated
Comment thread tests/pact-tests/tsconfig.json
Comment thread scripts/publish-pact-contracts.sh
@NHSDigital NHSDigital deleted a comment from Copilot AI Apr 14, 2026
Comment thread tests/pact-tests/pact-verification/channel-status-published.provider.pact.test.ts Outdated
@gareth-allan gareth-allan marked this pull request as ready for review April 16, 2026 15:23
@gareth-allan gareth-allan requested review from a team as code owners April 16, 2026 15:23
@tdroza-nhs tdroza-nhs self-assigned this Apr 17, 2026
tdroza-nhs
tdroza-nhs previously approved these changes Apr 17, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 21 changed files in this pull request and generated 1 comment.

Comment thread scripts/publish-pact-contracts.sh Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 21 changed files in this pull request and generated 2 comments.

Comment thread scripts/tests/contract.sh Outdated
Comment thread scripts/publish-pact-contracts.sh
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 21 changed files in this pull request and generated 2 comments.

Comment thread scripts/tests/contract.sh
Comment on lines +15 to +18
if [[ $outdated_status -eq 1 ]]; then
echo "The provider schema package ($schema_package) is outdated."
echo "Please run npm update $schema_package to update to the latest version and re-run."
echo
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

The guidance message suggests running npm update @nhsdigital/nhs-notify-event-schemas-status-published, but this dependency is declared in the tests/pact-tests workspace (not the repo root). To avoid confusion and ensure the right lockfile entry is updated, consider pointing users at a workspace-scoped install/update command (and remind to commit package-lock.json).

Copilot uses AI. Check for mistakes.
exit 0
fi

if ! ls pact-contracts/pacts/**/*.json >/dev/null 2>&1; then
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

ls pact-contracts/pacts/**/*.json relies on Bash globstar to expand **, but globstar is disabled by default. This will often make the check fail even when pact JSON files exist, preventing publishing. Use find pact-contracts/pacts -type f -name '*.json' (or enable shopt -s globstar nullglob) to reliably detect pact files.

Suggested change
if ! ls pact-contracts/pacts/**/*.json >/dev/null 2>&1; then
if ! find pact-contracts/pacts -type f -name '*.json' -print -quit | grep -q .; then

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants