Skip to content

Default config updates to recognize more defaults #622

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

Merged

Conversation

clairernovotny
Copy link

This addresses #620

@JakeGinnivan
Copy link
Contributor

We need to do a config upgrade for all these.

If someone has provided config overrides for these different branch configurations we can't have the new configs taking over

@@ -31,15 +31,15 @@ public static void ApplyDefaultsTo(Config config)
var configBranches = config.Branches.ToList();

ApplyBranchDefaults(config, GetOrCreateBranchDefaults(config, "master"), defaultTag: string.Empty, defaultPreventIncrement: true);
ApplyBranchDefaults(config, GetOrCreateBranchDefaults(config, "release[/-]"), defaultTag: "beta", defaultPreventIncrement: true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Add another parameter to this which is migrate: and then it takes an array. You can then add migrate: new[] { "release[/-]" } and ApplyBranchDefaults should rename the configs to be migrated, then apply the defaults.

Just one idea on how to solve.

Copy link
Author

Choose a reason for hiding this comment

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

I guess I'm not sure how the migration should work? Should apply branch defaults look for the old keys and rename them?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah exactly. So I have:

branches:
  develop:
    tag: beta

The effective config will have both develop and dev(elop)?.... We need to look for develop, rename it to the new one then delete it

@clairernovotny
Copy link
Author

Okay this should be working now. Also, the CanReadDocument test is now CanReadDocumentAndMigrate as that proves that it works.

JakeGinnivan added a commit that referenced this pull request Sep 7, 2015
Default config updates to recognize more defaults
@JakeGinnivan JakeGinnivan merged commit 07e0be4 into GitTools:master Sep 7, 2015
@clairernovotny clairernovotny deleted the default-branch-config-updates branch October 13, 2015 14:01
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.

2 participants