-
Notifications
You must be signed in to change notification settings - Fork 12
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
docs(toolkit-lib): CODE_REGISTRY.md tracks valid codes and their documentation #44
Conversation
@@ -0,0 +1,29 @@ | |||
| Code | Description | Level | Data Interface | | |||
|------|-------------| ----- | -------------- | | |||
| CDK_TOOLKIT_I1000 | Provides synthesis times. | info | undefined | |
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.
the real interesting stuff is in the Data Interface
section, which I haven't approached yet
@@ -0,0 +1,29 @@ | |||
| Code | Description | Level | Data Interface | | |||
|------|-------------| ----- | -------------- | | |||
| CDK_TOOLKIT_I1000 | Provides synthesis times. | info | undefined | |
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.
probably n/a
if no data is send
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.
This is the right direction I think.
One think I'm going to be interested in is how we can soft-enforce to correct level
and data structure when using codes. Would love to see your ideas for that.
262b4b6
to
b08ec0e
Compare
b08ec0e
to
1d4833f
Compare
| Code | Description | Level | Data Interface | | ||
|------|-------------|-------|----------------| | ||
| CDK_TOOLKIT_I1000 | Provides synthesis times. | info | n/a | | ||
| CDK_TOOLKIT_I1901 | Provides stack data | result | [StackData](docs/interfaces/StackData.html) | |
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.
doc pages aren't committed so i don't know exactly what to do here
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 think we can link to the public page once it's available.
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.
if you're ok with me naming and exposing these values here, then I will add docstrings. I'm also not sure what to do with successfuldeploystackresult because we are using that interface from aws-cdk so it otherwise doesn't show up in the generated docs
@@ -107,10 +108,10 @@ export const warn = <T>(message: string, code?: VALID_CODE, payload?: T) => { | |||
/** | |||
* Creates an info level message. | |||
*/ | |||
export const info = <T>(message: string, code?: VALID_CODE, payload?: T) => { | |||
export const info = <T>(message: string, code?: CodeInfo, payload?: 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.
i forgot how we said we wanted to soft enforce that we call info
on a code with level info
. can you jog my memory @mrgrain ?
Object.values(codes).forEach((code) => { | ||
table += `| ${code.code} | ${code.description} | ${code.level} | ${code.interface ? linkInterface(code.interface) : 'n/a'} |\n`; | ||
}); |
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 think we can check here that the key and code are the same and otherwise throw
Co-authored-by: Momo Kornher <kornherm@amazon.co.uk>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #44 +/- ##
==========================================
- Coverage 84.57% 84.51% -0.06%
==========================================
Files 196 196
Lines 35187 35187
Branches 4522 4524 +2
==========================================
- Hits 29760 29740 -20
- Misses 5281 5301 +20
Partials 146 146
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
closes aws/aws-cdk#33434
generates
CODE_REGISTRY.md
using information gathered incodes.ts
. this pr:codes.ts
to have additional information storedCODES
objectCODE_REGISTRY.md
as a post-build stepBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license