Skip to content

[BUG] Publisher v7.0.0 hangs indefinitely on "publish-artifacts-in-last-commit" when commit contains workspace artifact changes #838

@michelversluijs

Description

@michelversluijs

Release version

7.0.0 (v7.0.0-beta.1.0.0)

Describe the bug

When running the publisher with COMMIT_ID set to publish-artifacts-in-last-commit (the default), the publisher hangs indefinitely if and only if the triggering commit contains changes to workspace-scoped artifacts (i.e. files under workspaces).

Commits containing only service-level artifact changes are processed successfully and exit cleanly.

Expected behavior

When COMMIT_ID is set to publish-artifacts-in-last-commit and the triggering commit contains changes to workspace-scoped artifacts, the publisher should:

  1. Resolve the set of changed files from the provided commit SHA.
  2. Identify the affected workspace artifacts (APIs, policies, etc.) within those changed files.
  3. Publish those workspace artifacts to the target APIM instance via the appropriate workspace-scoped ARM/REST APIs.
  4. Log progress and exit with code 0, matching the behaviour already observed for service-level artifacts (e.g. products).

Actual behavior

The publisher starts, logs its configuration summary, and emits Using commit ID: . After this point it produces no further log output, does not return an exit code, and never terminates. The Azure DevOps task (Run publisher for [...] environment) blocks indefinitely and must be cancelled manually.

The hang is specific to workspace artifacts. When the same commit also contains service-level artifact changes (e.g. products), those are applied to APIM successfully before the publisher stalls — confirming that execution reaches the workspace processing stage and then deadlocks rather than failing fast with an error.

Running the pipeline with COMMIT_ID set to publish-all-artifacts-in-repo works as expected in all cases: both service-level and workspace artifacts are published successfully and the publisher exits cleanly.

Reproduction Steps

  1. Use the default pipelines from the v7.0.0-beta.1.0.0 Azure_DevOps.zip release asset, largely unmodified except for variable group / environment name customisation.
  2. Commit a change to a product artifact and trigger the pipeline with COMMIT_ID = publish-artifacts-in-last-commit. → Works. Publisher exits cleanly.
  3. Commit a change to a workspace artifact and trigger the pipeline with COMMIT_ID = publish-artifacts-in-last-commit. → Hangs indefinitely after "Using commit ID" log line. Publisher never exits.
  4. Commit changes to both a product and a workspace artifact in the same commit. → The product change is applied to APIM successfully, then the publisher hangs when it reaches workspace processing and never exits.

Artifacts folder structure:

artifacts/
├── products/
│   └── sample-product/
│       └── productInformation.json        ← changes here: publisher completes fine
└── workspaces/
    └── my-ws/
        └── apis/
            └── my-api/
                ├── apiInformation.json    ← changes here: publisher hangs
                └── specification.yaml     ← changes here: publisher hangs

Log at point of hang (workspace commit)

Publisher version is 7.0.0.
Configuration summary
apimServiceName ........................... API****
API_MANAGEMENT_SERVICE_OUTPUT_FOLDER_PATH . /home/vsts/work/1/s/artifacts
AZURE_BEARER_TOKEN ........................ eyJ****
AZURE_RESOURCE_GROUP_NAME ................. RG1****
AZURE_SUBSCRIPTION_ID ..................... 295****
COMMIT_ID ................................. a2426f29600eb59a0c07a90e0a7761d529f7175a
CONFIGURATION_YAML_PATH ................... /home/vsts/work/1/s/configuration.acc.yaml
...
dbug: Microsoft.Extensions.Hosting.Internal.Host[1]
Hosting starting
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: /home/vsts/work/1/s
dbug: Microsoft.Extensions.Hosting.Internal.Host[2]
Hosting started
info: publisher[0]
Running publisher...
info: publisher[0]
Using commit ID: a2426f29600eb59a0c07a90e0a7761d529f7175a

(No further output. Process never exits. Pipeline step must be cancelled manually.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions