Skip to content

Keep a consumer's package metadata and ContinuousIntegrationBuild [patch] - #98

Open
matt-edmondson wants to merge 1 commit into
mainfrom
fix/91-keep-consumer-package-metadata
Open

matt-edmondson wants to merge 1 commit into
mainfrom
fix/91-keep-consumer-package-metadata

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #91

What was wrong

Sdk.props is evaluated after the consumer's Directory.Build.props, and it assigned these properties unconditionally:

  • PackageDescription=$(Description)
  • PackageTags=$(Tags)
  • PackageProjectUrl=$(ProjectUrl)
  • ContinuousIntegrationBuild=false, flipped to true only on GitHub Actions or Azure Pipelines

With no DESCRIPTION.md, TAGS.md or PROJECT.url, a consumer's own values were replaced by empty ones, or by NuGet's "Package Description" placeholder. On GitLab, Jenkins or TeamCity, an explicit ContinuousIntegrationBuild=true was discarded.

Change (Sdk/Sdk.props)

  • PackageDescription, PackageTags and PackageProjectUrl are assigned only when their source (Description, Tags, ProjectUrl) has a value. Where the metadata files exist, they still set these properties, as before.
  • ContinuousIntegrationBuild is only a default. It is true on GitHub Actions or Azure Pipelines and false elsewhere, and only when the consumer left it empty.
  • CLAUDE.md now records the rule.

This covers the scalar-metadata part of the "Sdk.props overwrites consumer values" family named in the triage. #71 and #72 remain separate.

Tests

New ConsumerMetadataOverrideTests (4 tests):

  • the four values set in Directory.Build.props survive without metadata files
  • the metadata files still win
  • CI auto-detection still defaults correctly
  • an explicit false is kept on GitHub Actions

With the Sdk.props change reverted, the two override tests fail: Expected:<https://example.com/foo>. Actual:<> and Expected:<false>. Actual:<true>. The other two cover behaviour that must not change, so they pass either way.

Full Sdk.Examples.Tests suite on this branch (Linux): 110 passed, 0 failed.


Generated by Claude Code

…tch]

Sdk.props assigned PackageDescription, PackageTags and PackageProjectUrl
unconditionally, after the consumer's Directory.Build.props, so without
DESCRIPTION.md, TAGS.md or PROJECT.url the consumer's values were replaced
by empty ones or NuGet's placeholder. ContinuousIntegrationBuild was forced
to false off GitHub Actions and Azure Pipelines. Assign each only from a
value, and default ContinuousIntegrationBuild only when it is empty.

Fixes #91

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW5RdbhA7TAMDQD8QTG
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

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.

PackageProjectUrl, PackageDescription, PackageTags and ContinuousIntegrationBuild set in Directory.Build.props are silently overwritten by Sdk.props

2 participants