Skip to content

[heft-config-file] Let null reset properties#5195

Merged
dmichon-msft merged 3 commits intomicrosoft:mainfrom
dmichon-msft:config-file-null
Apr 16, 2025
Merged

[heft-config-file] Let null reset properties#5195
dmichon-msft merged 3 commits intomicrosoft:mainfrom
dmichon-msft:config-file-null

Conversation

@dmichon-msft
Copy link
Contributor

@dmichon-msft dmichon-msft commented Apr 16, 2025

Summary

Allows configuration files to use the value null to reset a property to the behavior it would have if it was not present in the file at all. This is useful when extending another configuration file, for example to delete a task or phase when extending a Heft configuration.

Details

If a property is set to null in a configuration file, regardless of any specified custom merge behavior, the resulting merged configuration file will omit that property, as if it was not specified in the first place.

This follows prior art in TypeScripts tsconfig inheritance, which uses the same method to reset a value to "not specified".

How it was tested

Added a test case in the simple extends scenario for a property that starts with a value but is then set to null when extended.

Impacted documentation

Documentation for heft-config-file. See microsoft/rushstack-websites#278

@dmichon-msft dmichon-msft enabled auto-merge (squash) April 16, 2025 17:49
@dmichon-msft dmichon-msft merged commit 28f98a5 into microsoft:main Apr 16, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage Apr 16, 2025
@dmichon-msft dmichon-msft deleted the config-file-null branch April 16, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants