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

App Builder experience for Configurable Logging #502

Merged
merged 8 commits into from
Jan 24, 2022

Conversation

buskamuza
Copy link
Contributor

@buskamuza buskamuza commented Nov 18, 2021

Added commands for managing log forwarding configuration.

  • added app:config:get:log-forwarding command
  • added app:config:set:log-forwarding command
  • added app:config:get:log-forwarding:errors command
  • updated log forwarding config on server during app:deploy command
  • updated app:logs command to display info message in case custom log forwarding is configured
  • save log forwarding settings to project config

Description

See #501 and https://jira.corp.adobe.com/browse/DEVX-1244 (internal)

Related Issue

Motivation and Context

See #501

How Has This Been Tested?

Automated and manual testing.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@buskamuza buskamuza marked this pull request as ready for review November 18, 2021 19:42
@codecov
Copy link

codecov bot commented Nov 22, 2021

Codecov Report

Merging #502 (bad8b16) into master (0a4f10e) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            master      #502    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           43        50     +7     
  Lines         2324      2556   +232     
  Branches       422       453    +31     
==========================================
+ Hits          2324      2556   +232     
Impacted Files Coverage Δ
src/commands/app/config/get/index.js 100.00% <100.00%> (ø)
src/commands/app/config/get/log-forwarding.js 100.00% <100.00%> (ø)
...c/commands/app/config/get/log-forwarding/errors.js 100.00% <100.00%> (ø)
src/commands/app/config/index.js 100.00% <100.00%> (ø)
src/commands/app/config/set/index.js 100.00% <100.00%> (ø)
src/commands/app/config/set/log-forwarding.js 100.00% <100.00%> (ø)
src/commands/app/deploy.js 100.00% <100.00%> (ø)
src/commands/app/logs.js 100.00% <100.00%> (ø)
src/lib/log-forwarding.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0a4f10e...bad8b16. Read the comment docs.

@buskamuza buskamuza force-pushed the log-forwarding branch 2 times, most recently from 311657d to c1601dc Compare December 22, 2021 14:45
- added app:config:get:log-forwarding command
- added app:config:set:log-forwarding command
- update log forwarding config on server during app:deploy command
- save log forwarding settings to project config
- added log-forwarding lib
Copy link
Member

@purplecabbage purplecabbage left a comment

Choose a reason for hiding this comment

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

mostly nitpicky stuff, but this seems to be a lot more code than required ... more code, more bugs

Deploy can be called with --[no-]actions in which case we should not be doing anything with log-forwarding.

package.json Outdated Show resolved Hide resolved
src/lib/log-forwarding.js Show resolved Hide resolved
src/lib/log-forwarding.js Outdated Show resolved Hide resolved
src/lib/log-forwarding.js Show resolved Hide resolved
src/lib/log-forwarding.js Show resolved Hide resolved
src/lib/log-forwarding.js Show resolved Hide resolved
src/lib/log-forwarding.js Show resolved Hide resolved
src/lib/log-forwarding.js Outdated Show resolved Hide resolved
- update log forwarding only if actions are deployed
@buskamuza
Copy link
Contributor Author

mostly nitpicky stuff, but this seems to be a lot more code than required ... more code, more bugs

Deploy can be called with --[no-]actions in which case we should not be doing anything with log-forwarding.

Updated

@purplecabbage
Copy link
Member

a couple issues I have found.

  • when setting with https:// the server does not return an https:// url so aio app config get log-forwarding always shows a mismatch
  • changing type via aio app config set log-forwarding overwrites values in .aio but leaves keys in .env

@buskamuza
Copy link
Contributor Author

changing type via aio app config set log-forwarding overwrites values in .aio but leaves keys in .env

This was discussed with Manik. It leaves keys in .env if you change destination type. If you use the same destination type the key is overwritten. So far we agreed that this is expected behavior.

- save log forwarding settings returned by the Runtime `PUT` API to take into account any sanitization
@buskamuza
Copy link
Contributor Author

when setting with https:// the server does not return an https:// url so aio app config get log-forwarding always shows a mismatch

Fixed. Updated Runtime API to return sanitized settings and aio CLI then stores this instead of what the user provided. Secrets are not exchanged and stored as provided by the user. See also new PR adobe/aio-lib-runtime#93 necessary to cover this.

@purplecabbage purplecabbage merged commit 3c53535 into adobe:master Jan 24, 2022
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