Repository navigation
feedback on sam config design - #1546
diablodale wants to merge 10 commits into
Conversation
* feat: sam deploy without aws cli pre-installed - Not breaking parameter overrides formats - still requires refactoring and error handling * feat: new click types for deploy parameters * feat: show changeset and stack events - needs refactoring * refactor: move deploy classes to lib - wire up command.py for `sam deploy` - move deploy specific exceptions to inherit from UserException * rebase: latest from `sam package` port * feat: decorator for printing tables - `sam deploy` now has tables while showcasing the changeset and showcasing events happening during deploy. * fix: wrap text on resource status column on `sam deploy` - fixed unit tests - linting fixes - doc strings - further unit tests and integration tests need to be added. * fix: cleaner text formatting for tables * tests: add unit tests for full suite of `sam deploy` * tests: add integration tests for `sam deploy` * tests: regression test suite for `sam deploy` - exercise all command line parameters for `aws` and `sam` * fix: deploy command now showcases stack outputs * fix: address comments * fix: return stack outputs from `get_stack_outputs` * fix: width margins on table prints * fix: address comments - add retries - more regression testing - remove types for capabilities * tests: tests for pprint of tables * usability: add table headers - show cases Add, Modify, Delete with +, * and -
* design: sam-app-config - an app level configuration that provides parameter pass throughs for sam cli commands * design: move config file location to project root * design: add open questions * fix: add `identifiers` to use configuration file. * fix: address comments - todo add more scope * fix: address future and scope * phases: implementation phases * fix: add docs section for samconfig
* feat: configuration file for sam cli commands - add passthroughs to the CLI command line interface via a configuration file - local defaults are set at: `.aws-sam/samconfig.toml` - This commit contains code copied and modified from https://github.com/phha/click_config_file/blob/master/click_config_file.py under MIT license * fix: add identifier name argument instead of configuration files. * rework: change command key construction logic - descope environment variables - move samconfig.toml back to project root * docstring: TomlProvider class * fix: allow spaces on certain deploy options * fix: REGEX for parameter overrides * fix: infer config path name from ctx * fix: set abs path to `ctx.config_path` * fix: set dirname for config_path not template file name.
* feat: beginnings of package and deploy together * fix: plumb through configuration - need to add additional parameters over from package. * fix: conditional check to print text on package during deploy * fix: exceptions for `package` * lint: local variables rule - `samcli/commands/deploy/command.py` has high number of local variables, because of the nature of command, it has high number of arguments.
* WIP: Managed S3 Stack * Managed S3 Bucket Command With Tests Missing: Integration with config files. We may also want to move some of the echo commands to debug logging. * Setup Design Doc * Setup Design Document * Rename to and remove CLI interface * Fix lint errors * Adding metadata to stack * fixing black formatting
* feat: colors for deploy command * lint: fixes
feedback as requested by @sanathkr
ac31eab to
6d70440
Compare
| Why samconfig under `.aws-sam` | ||
| --------------------------------- | ||
|
|
||
| > The below two don't answer the above question. Instead, they give technical implementation answers to questions not asked like "How is the .aws-sam directory made?" and "Are any files in .aws-sam git ignored?". The ideas surfaced in the previous PR's discussion were lost. For example, in the PR threads it was for a short time in the root of the project but then put back into .aws-sam. I recommend clearly stating here an answer to the above question in terms of goals, not technical implementations. |
There was a problem hiding this comment.
This is a good point and callout on the back and forth during the PR discussion. Will update the design doc with the decision and why it was taken.
|
|
||
| The configuration file: `samconfig.toml` will come with a top level version key that specifies the grammar version of the configuration file. This version can then be used to determine if a given configuration file works with a version of SAM CLI. A given version of SAM CLI may support one or more configuration file grammar versions. | ||
|
|
||
| > The above clarifies that the version is not the version of the file itself (like an ever increasing commit version), instead it is the version of the grammar/DTD/spec of the file. |
There was a problem hiding this comment.
👍 can make this more explicit.
|
|
||
| Users can pass an environment `--env` for the section that will be scanned within the configuration file to pass parameters through. | ||
|
|
||
| > I hesitate in using `--env` as the param that controls what prefix of TOML tables/sections is parsed/loaded. Using `--env` strongly associates a specific usage scenario (environment choice) to a feature that is much broader in potential usage. Also, `--env` doesn't to me clarify what it controls/changes. At first read, I think it controls environment variables. Perhaps an alternative like `--config-prefix` which is no longer limited to a specific usage scenario while more clearly describing what it controls. |
There was a problem hiding this comment.
Yes, this is the reason why the --env is hidden and ignored right now. To be able to support a better naming nomenclature.
| version = 0.1 | ||
| ``` | ||
|
|
||
| > What is behavior of SAM CLI for different scenarios, e.g.: |
There was a problem hiding this comment.
1 & 2 are covered in the implementation, whereas 3 is not. Can document what the behaviors will be.
|
|
||
| ``` | ||
|
|
||
| > I am not in favor of having empty TOML tables/sections like `[default.package]`. |
There was a problem hiding this comment.
This might probably be due to implementation details with tomlkit, Will create an explicit issue for this.
| `--env` dev will refer to `.aws-sam/samconfig-dev.toml` and so on. | ||
|
|
||
| > I'm not in favor of parsing file names in lieu of TOML table/section prefixes. What are the TOML tables in the first file? Does it contain `[dev.build.parameters]` or just `[build.parameters]` or `[default.build.parameters]`. First is redundant, second is out-of-spec, third is potentially confusing since there could be defaults elsewhere. | ||
| > Instead, I support loading of multiple config files in order they are specified. Similar to how `docker-compose` can have multiple `-f filename` parameters. However, then comes the discussion of merge rules: overwrite/append keys, extend arrays, and application of these merge rules across files across defaults, merge rules for config files of different spec versions, etc.? |
There was a problem hiding this comment.
This was infact part of the first implementation and then removed for design on this particular hierachy first. But definitely on the radar and will create another issue for this.
|
|
||
| `--env` dev will refer to `.aws-sam/samconfig-dev.toml` and so on. | ||
|
|
||
| > I'm not in favor of parsing file names in lieu of TOML table/section prefixes. What are the TOML tables in the first file? Does it contain `[dev.build.parameters]` or just `[build.parameters]` or `[default.build.parameters]`. First is redundant, second is out-of-spec, third is potentially confusing since there could be defaults elsewhere. |
There was a problem hiding this comment.
default is the name of the profile (config-env) here and showcases granularity and depth of where the configuration values affect the behavior of samcli.
|
|
||
| * Not focusing on a global configuration. SAM CLI already has a notion of a global config at `~/.aws-sam/metadata.json` | ||
|
|
||
| > This is confusing/conflicting with a few paragraphs above is written, "This way, configuration that might be global can be placed...". While technically such could be possible, I recommend not writing of a technically possible scenario that conflicts with what is stated as out-of-scope. |
There was a problem hiding this comment.
I think this was the effect of the back and forth on the design, will take this into consideration with the refactor on the design doc to accurately reflect present day and paths forward.
|
Closing this PR, Thanks for the feedback on the design, really useful. |
feedback as requested by @sanathkr in issue #1490
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.