Skip to content

Make runtimeconfig.dev.json configProperties take precedence over runtimeconfig.json#128383

Draft
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-runtimeconfig-overwrite-issue
Draft

Make runtimeconfig.dev.json configProperties take precedence over runtimeconfig.json#128383
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-runtimeconfig-overwrite-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

configProperties set in .runtimeconfig.json currently overwrite values from .runtimeconfig.dev.json, preventing dev-only overrides. This makes them not actually useful in a dev scenario.

Technically a breaking change and we will file it as such, but it should be very low-impact. The SDK has disabled emitting runtimeconfig.dev.json by default since .NET 6 and it was never used for properties.

Copilot AI self-assigned this May 19, 2026
Copilot AI review requested due to automatic review settings May 19, 2026 19:01
Copilot AI review requested due to automatic review settings May 19, 2026 19:01
…nfig.json

Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 19, 2026 19:06
Copilot AI changed the title [WIP] Fix configurationProperties overwrite issue in runtimeconfig Make runtimeconfig.dev.json configProperties take precedence over runtimeconfig.json May 19, 2026
Copilot AI requested a review from elinor-fung May 19, 2026 19:07
Comment thread src/native/corehost/runtime_config.cpp Outdated
Comment thread src/native/corehost/runtime_config.cpp Outdated
Co-authored-by: Elinor Fung <elfung@microsoft.com>
Copilot AI review requested due to automatic review settings May 20, 2026 21:31
Copy link
Copy Markdown
Contributor

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

This PR changes host runtime configuration parsing so configProperties specified in *.runtimeconfig.dev.json are not overwritten by the same property name in *.runtimeconfig.json (dev config wins for configProperties only). It updates HostActivation tests to validate the new precedence.

Changes:

  • Update runtime_config_t::parse_opts to skip assigning a configProperties entry if that key already exists in m_properties.
  • Update the related HostActivation test to assert dev-config precedence.
Show a summary per file
File Description
src/native/corehost/runtime_config.cpp Implements “first value wins” for configProperties by skipping overwrites when a key is already present (dev config parsed first).
src/installer/tests/HostActivation.Tests/RuntimeProperties.cs Renames/updates a test to assert .runtimeconfig.dev.json overrides .runtimeconfig.json for the same property name.

Copilot's findings

Comments suppressed due to low confidence (1)

src/native/corehost/runtime_config.cpp:103

  • This adds an extra hash lookup and string conversion per property (count + later operator[] assignment), and the brace-less if is inconsistent with the surrounding style in this function. Consider using a single lookup/insert pattern (and braces) so existing entries are skipped without paying for two lookups.
        for (const auto& property : properties_obj)
        {
            if (m_properties.count(property.name.GetString()) != 0)
                continue;

            if (property.value.IsString())
            {
                m_properties[property.name.GetString()] = property.value.GetString();
            }
  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread src/native/corehost/runtime_config.cpp
Comment thread src/native/corehost/runtime_config.cpp Outdated
Copilot AI review requested due to automatic review settings May 20, 2026 21:41
Copy link
Copy Markdown
Contributor

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.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread src/native/corehost/runtime_config.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

configurationProperties specified in .runtimeconfig.json override those in .runtimeconfig.dev.json

3 participants