Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension methods for using programmatic config #1623

Merged
merged 3 commits into from Mar 30, 2016

Conversation

jdom
Copy link
Member

@jdom jdom commented Mar 30, 2016

A few useful methods I found while doing a refactoring of the test infrastructure, which uses programmatic config as a first class citizen (PR coming soon, but not just yet)

}
}

private static IEnumerable<NodeConfiguration> GetDefinedNodeConfigurations(this ClusterConfiguration config)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the property is named Overrides, I think it'd be less confusing if we stick to that: GetOverrides or GetOverrideConfigurations instead of GetDefinedNodeConfigurations and UpdateOverrides orUpdateOverrideConfigurationinstead ofApplyToAllNodes`.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point is that this gets the "Defaults" node, as well as the defined overrides

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize Defaults is part of Overrides. Hmm. Does that even make sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's fine - we can have it as GetDefinedNodeConfigurations. This is for testing anyway. Maybe move it to Tester then, so that it doesn't pollute the public API?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, Defaults is not part of overrides, that's the whole point. This applies the changes to both "Defaults" and the currently defined configuration overrides

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not know Overrides was used exclusively in tests, then yes. I think moving to TestingHost project (instead of Tester) might be appropriate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, Overrides can be used elsewhere. Practically, they were needed for the case of a single static config file for multiple silos. With the move to programmatic config, the point becomes moot.

@sergeybykov sergeybykov self-assigned this Mar 30, 2016
@sergeybykov
Copy link
Contributor

I think it's fine. I don't have a strong opinion on any of these questions.

@jdom
Copy link
Member Author

jdom commented Mar 30, 2016

Moved the Apply method to TestingHost project. Now there's no question that it needs to be an extension method :)

@sergeybykov sergeybykov merged commit 1077f5e into dotnet:master Mar 30, 2016
@jdom jdom deleted the config-extensions branch March 31, 2016 13:12
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants