Skip to content

NX release releaseTagPattern is overridden by docker versionSchemes #32900

@patriklarssson

Description

@patriklarssson

Current Behavior

Bug Report: --dockerVersionScheme overrides releaseTagPattern for Git tags

Current Behavior

When using --dockerVersionScheme=production with nx release, the version scheme affects both Docker image tags AND Git tags, ignoring the releaseTagPattern configuration.

Expected Behavior

According to the documentation, releaseTagPattern should control Git tag format independently of Docker versioning schemes. Git tags should follow the releaseTagPattern while Docker images should follow the dockerVersionScheme.

Actual Result

Environment

  • NX Version: 21.5.3
  • Node Version: 20.12.2

Additional Context

The https://nx.dev/reference/nx-json#release states it's "the source of truth for changelog generation and release tagging" but this doesn't work when --dockerVersionScheme is specified.

Expected Behavior

  • Git tag: [email protected] (using semantic versioning from releaseTagPattern)
  • Docker image tag: 2509.30.{BUILD_NUMBER} (using production scheme)

GitHub Repo

No response

Steps to Reproduce

  1. Configure nx.json with:
    {
      "release": {
        "releaseTagPattern": "{projectName}@{version}",
        "groups": {
          "apps": {
            "projects": ["my-app"],
            "projectsRelationship": "independent",
            "docker": {
              "registryUrl": "my-registry.com",
              "versionSchemes": {
                "production": "{currentDate|YYMM.DD}.{env.BUILD_NUMBER}"
              }
            }
          }
        },
        "version": {
          "conventionalCommits": true
        }
      }
    }
    
  2. Run: npx nx release --dockerVersionScheme=production --projects=my-app --yes (in github actions)

Nx Report

Node           : 20.12.2
OS             : win32-x64
Native Target  : x86_64-windows
npm            : 10.9.3

nx                     : 21.5.3
@nx/js                 : 21.5.3
@nx/jest               : 21.5.3
@nx/eslint             : 21.5.3
@nx/workspace          : 21.5.3
@nx/devkit             : 21.5.3
@nx/eslint-plugin      : 21.5.3
@nx/module-federation  : 21.5.3
@nx/react              : 21.5.3
@nx/rollup             : 21.5.3
@nx/vite               : 21.5.3
@nx/web                : 21.5.3
@nx/docker             : 21.5.3
typescript             : 5.9.2
---------------------------------------
Registered Plugins:
@nx/vite/plugin
@nx/eslint/plugin
@nx/jest/plugin
@nx/docker
---------------------------------------

Failure Logs

Package Manager Version

npm

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions