-
Notifications
You must be signed in to change notification settings - Fork 1
KEH-1220 - Add config file support #65
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
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
4ffaca5
Add config.json
smstone0 fd32d61
Get config file in handler
smstone0 5ea8af3
Add local logging support
smstone0 4b4ee5f
Add local writes
smstone0 3c3fb48
Comment out local script execution
smstone0 c94fcf3
Add configuration.md
smstone0 d9fefce
Capitalise Copilot
smstone0 29676fe
Add local_data to .gitignore
smstone0 41da37a
Resolve todos and add local_data to clean command
smstone0 6b1f425
Lint config.json
smstone0 0a33bdf
Lint main.py
smstone0 4da30a7
fix(logging): Simplify local log writing.
TotalDwarf03 698a28a
docs(readme): reorganise for clarity
TotalDwarf03 f75ee4a
lint(python): Fix pylint issues
TotalDwarf03 c177f42
test(main): Fix failing tests
TotalDwarf03 1c02017
style(md tables): Fix formatting to comply with megalinter
TotalDwarf03 1ea19aa
test: add tests
TotalDwarf03 67c9fe8
chore: Add comments to justify missing testing coverage
TotalDwarf03 2f4688b
fix(Makefile): update make clean to rm renamed outputs
TotalDwarf03 6614e5c
chore: address PR comments
TotalDwarf03 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "features": { | ||
| "show_log_locally": false, | ||
| "write_data_locally": false | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Configuration | ||
|
|
||
| The Copilot lambda uses a local configuration file to manage its settings, located within `./config/config.json`. | ||
|
|
||
| ## `config.json` | ||
|
|
||
| The `config.json` file contains the following: | ||
|
|
||
| ```json | ||
| { | ||
| "features": { | ||
| "show_log_locally": false, | ||
| "write_data_locally": false | ||
| }, | ||
| } | ||
| ``` | ||
|
|
||
| ### `features` Section | ||
|
|
||
| This section contains feature flags that control which of the tool's features are enabled or disabled. | ||
|
|
||
| #### `show_log_locally` | ||
|
|
||
| If set to `true`, the tool will output logs to the terminal. | ||
|
|
||
| When deploying to AWS, this should be set to `false` to avoid files being written to the local filesystem. | ||
|
|
||
| #### `write_data_locally` | ||
|
|
||
| If set to `true`, the tool will skip writing to the appropriate AWS S3 bucket and instead write data for copilot teams, historic usage, and teams history to `local_data`. | ||
|
|
||
| **When deploying to AWS, this must be set to `false` to ensure the tool writes to AWS.** | ||
TotalDwarf03 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| When debugging locally, you can set this to `true` to use the local configuration file. This is useful if you need to see the logs locally, without affecting the cloud deployment. | ||
|
|
||
| ### Example During Local Testing | ||
|
|
||
| When testing locally, you might set the `config.json` file as follows: | ||
|
|
||
| ```json | ||
| { | ||
| "features": { | ||
| "show_log_locally": true, | ||
| "write_data_locally": true | ||
| }, | ||
| } | ||
| ``` | ||
|
|
||
| ### Example On AWS | ||
|
|
||
| When deploying to AWS, the `config.json` file should be set as follows: | ||
|
|
||
| ```json | ||
| { | ||
| "features": { | ||
| "show_log_locally": false, | ||
| "write_data_locally": false | ||
| }, | ||
| } | ||
| ``` | ||
|
|
||
| This configuration ensures that the tool does not log or write data locally. | ||
|
|
||
| **It is essential that `write_data_locally` is set to `false` when deploying to AWS.** | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.