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

Deprecate Config, replace with StackConfigDir #9145

Merged
merged 14 commits into from Mar 13, 2022
Merged

Conversation

Frassle
Copy link
Member

@Frassle Frassle commented Mar 8, 2022

Description

We want to re-purpose the config key for hierarchical config, but currently it's used to set the directory to store stack config in. This adds a new property to specify the stacks directory (stacksDirectory, name open to change) but maintains backwards comparability by also checking if config is a non-empty string and using that if set.

Relates to #2307

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

Copy link
Member

@AaronFriel AaronFriel left a comment

Choose a reason for hiding this comment

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

lgtm, the lints & question I asked are non-blocking

CHANGELOG_PENDING.md Outdated Show resolved Hide resolved
sdk/go/common/workspace/paths_test.go Outdated Show resolved Hide resolved
sdk/go/common/workspace/paths_test.go Show resolved Hide resolved

// StacksDirectory indicates where to store the Pulumi.<stack-name>.yaml files, combined with the folder
// Pulumi.yaml is in.
StacksDirectory string `json:"stacksDirectory,omitempty" yaml:"stacksDirectory,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

only comment here is for such a visible change which will need to be reflected in docs, might want to get wider feedback on the name. up to you

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I want to get a few OKs on this before committing to this name.

Copy link
Member

@jkodroff jkodroff Mar 8, 2022

Choose a reason for hiding this comment

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

StackConfigFilesPath? Might be a little clearer, since we're pointing to config files, not the stacks themselves (obviously).

Copy link
Member Author

Choose a reason for hiding this comment

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

Thinking off Josh's comment, maybe this should be "ConfigDirectory"? It used to just be called Config, how much do we need to make it clear its for stacks config?
Other ideas, "Stack[s]ConfigDirectory". "Dir" or "FilesPath" instead of "Directory"?

Copy link
Member

Choose a reason for hiding this comment

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

@Frassle What's the proper term for Pulumi.yaml versus Pulumi.stackname.yaml?

Copy link
Member Author

Choose a reason for hiding this comment

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

shrug "Project settings file" and "stack config file" I think.
@pgavlin or @lukehoban might have a definitive answer to that.

Copy link
Member

Choose a reason for hiding this comment

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

In our docs - these are currently "project file" and "stack configuration file". (Though this page includes a weird title that I feel like we should change "Project Configuration Reference").

From that page - the description of the current option is:

config: (optional) directory to store stack-specific configuration files, relative to location of Pulumi.yaml.

Here's suggestions in my order of preference:

  • stackConfigDir
  • stackDir
  • stackConfigPath
  • stackPath
  • stacksDir
  • stacksPath

Copy link
Member Author

Choose a reason for hiding this comment

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

stackConfigDir seems fine to me, will update.

Frassle and others added 3 commits March 8, 2022 17:12
CHANGELOG_PENDING.md Outdated Show resolved Hide resolved
Co-authored-by: Vlad Gorodetsky <v@gor.io>
// Back compat: If StacksDirectory is not present and Config is given and it's a non-empty string use it
// for the stacks directory.
if hasConfigValue {
return filepath.Join(filepath.Dir(projPath), configValue, fileName), nil
Copy link
Member

@iwahbe iwahbe Mar 11, 2022

Choose a reason for hiding this comment

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

Should we issue a deprecation warning, suggesting that the user switches to use StacksDirectory?

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 wasn't sure how well that would display, this is called into from a few different places.

@Frassle Frassle changed the title Deprecate Config, replace with StacksDirectory Deprecate Config, replace with StackConfigDir Mar 11, 2022
@Frassle Frassle merged commit 2b3fbdb into master Mar 13, 2022
@pulumi-bot pulumi-bot deleted the fraser/renameConfig branch March 13, 2022 21:39
@mikhailshilkov
Copy link
Member

Do we have an issue to track the docs update?

@Frassle
Copy link
Member Author

Frassle commented Mar 14, 2022

No but I was planning on doing that, I'll update the title as suggested by Luke as well.

rswiernik added a commit to rswiernik/pulumi that referenced this pull request Aug 30, 2022
Mirror the changes to the Go SDK made in pulumi#9145 (2b3fbdb)
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.

None yet

7 participants