-
Notifications
You must be signed in to change notification settings - Fork 103
Notices manifest schema #2562
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
Notices manifest schema #2562
Conversation
| }), | ||
| z.object({ | ||
| type: z.literal('backendComponent'), | ||
| backendComponent: z.enum(['data', 'auth', 'function', 'storage']), |
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.
do we need ai 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.
we can add it.
|
|
||
| const noticePredicateSchema = z.discriminatedUnion('type', [ | ||
| z.object({ | ||
| type: z.literal('packageVersion'), |
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 don't think the node version will be captured by this, if not, we should add that as a predicate. What about OS as well?
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.
good ideas, will do.
| z.object({ | ||
| type: z.literal('frequency'), | ||
| frequency: z.enum(['command', 'deployment', 'once', 'daily']), | ||
| }), |
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.
Didn't we also want the expiration to be part of the notices?
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 was on the edge if we should add it now or just "unpublish" a notice.
I guess it won't hurt to include it.
| export type Notice = z.infer<typeof noticeSchema>; | ||
|
|
||
| export const noticesManifestSchema = z.object({ | ||
| currentNotices: z.array(noticeSchema), |
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.
why current not just notices?
| assert.ok( | ||
| !ids.has(notice.id), | ||
| `Notice ids must be unique. ${notice.id} is duplicated.` | ||
| ); |
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.
should we throw AmplifyFault instead?
| z.object({ | ||
| type: z.literal('packageVersion'), | ||
| packageName: z.string(), | ||
| versionRange: z.string(), |
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 have seen some cdk notices with an upper bound and lower bound for the range (EX: Affected versions: cli: >=2.0.0 <=2.1005.0) in these cases, would the version range look like this '>=2.0.0 <=2.1005.0'?
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.
Yes. Here's the spec https://docs.npmjs.com/cli/v6/using-npm/semver#ranges .
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.
or here as well https://www.npmjs.com/package/semver#ranges
🦋 Changeset detectedLatest commit: 2b9bf1b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Changes
This PR:
Validation
Added tests
Checklist
run-e2elabel set.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.