-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Don't allow stacks with the wrong project name in filestate #12033
Conversation
Changelog[uncommitted] (2023-02-01) |
3777422
to
434628c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -541,27 +542,57 @@ func TestProjectFolderStructure(t *testing.T) { | |||
assert.FileExists(t, path.Join(tmpDir, ".pulumi", "stacks", "testproj", "b.json")) | |||
} | |||
|
|||
func TestCanRenameStack(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep a test of rename?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
herp yes we should not sure how I managed that.
434628c
to
1b9107f
Compare
bors merge |
🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
12033: Don't allow stacks with the wrong project name in filestate r=Frassle a=Frassle <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes filestate to check that stacks with projects in their name match the current project, same as what httpstate does. ## Checklist <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change - Filestate projects aren't released yet, so this change is user facing compared to the first PR that added support for these. <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Service, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> Co-authored-by: Fraser Waters <fraser@pulumi.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll admit that I'm not as familiar with the codebase, but this feels like an abstraction leak. My gut says that the state backend should not have access to "current directory". That'll especially be a problem if/when we do plugin backends that run in separate processes.
All that said, this is fine since httpstate is also doing this, so if that boundary does exist, we'll have to refactor to enforce it anyway.
Timed out. |
The |
bors retry |
Build succeeded: |
Description
Fixes filestate to check that stacks with projects in their name match the current project, same as what httpstate does.
Checklist
make changelog
and committed thechangelog/pending/<file>
documenting my change - Filestate projects aren't released yet, so this change is user facing compared to the first PR that added support for these.