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

feat!: Proper environment usage enforced #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kogitant
Copy link

  • EnvironmentContext.isValid method added to validate provided environment name is allowed
  • ProjectContect.tryGetEnvironment modified to return undefined if in the scope of AccountWrapper
  • EnvironmentWrapper modified to throw an error if passed scope specifies an invalid environment (undefined or name does not match accepted patterns)
  • Tests added to cover these cases
  • npm run test passes
  • npm run eslint passes
  • npm run build passes and updated API.md

…environment name being used when naming things
…ent name is allowed

ProjectContect.tryGetEnvironment modified to return undefined if in the scope of AccountWrapper
EnvironmentWrapper modified to throw an error if passed scope specifies an invalid environment (undefined or name does not match accepted patterns)
Tests added to cover these cases
@kogitant kogitant requested a review from aripalo October 12, 2022 08:12
@kogitant kogitant changed the title Account wrapper does not guard against using environment in naming feat!: Proper environment usage enforced Oct 12, 2022
});

test('Stack name is account wide even in environment context', () => {
expect(stack.stackName).toBe('TestProject-Account-TestStack');
Copy link
Author

Choose a reason for hiding this comment

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

Getting this stackName was the problem that started this whole ball rolling. Before the other changes in this PR this would return a stack name that had Environment-development included in it. As far as I understand, that should not happen because we're creating the stack within AccountWrapper context (MockAccount class).

@aripalo
Copy link
Contributor

aripalo commented Nov 25, 2024

This feature will be address in upcoming V2/V3 major versions, as the whole account/environment handling will be redesigned.

See roadmap: #36

Leaving this issue still open for reference.

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