-
Notifications
You must be signed in to change notification settings - Fork 52
feat(online-eval): support sessionTimeoutMinutes and filters in add/import flows #1161
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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,99 @@ | ||
| import { parseFilterFlag, parseFilterFlags } from '../filter-flag-parser'; | ||
| import { describe, expect, it } from 'vitest'; | ||
|
|
||
| describe('parseFilterFlag', () => { | ||
| it('parses a string filter', () => { | ||
| expect(parseFilterFlag('key=userId,op=Equals,type=string,value=abc')).toEqual({ | ||
| key: 'userId', | ||
| operator: 'Equals', | ||
| value: { stringValue: 'abc' }, | ||
| }); | ||
| }); | ||
|
|
||
| it('parses a double filter', () => { | ||
| expect(parseFilterFlag('key=score,op=GreaterThan,type=double,value=0.75')).toEqual({ | ||
| key: 'score', | ||
| operator: 'GreaterThan', | ||
| value: { doubleValue: 0.75 }, | ||
| }); | ||
| }); | ||
|
|
||
| it('parses a boolean filter (true)', () => { | ||
| expect(parseFilterFlag('key=isPremium,op=Equals,type=boolean,value=true')).toEqual({ | ||
| key: 'isPremium', | ||
| operator: 'Equals', | ||
| value: { booleanValue: true }, | ||
| }); | ||
| }); | ||
|
|
||
| it('parses a boolean filter (false)', () => { | ||
| expect(parseFilterFlag('key=isPremium,op=NotEquals,type=boolean,value=false')).toEqual({ | ||
| key: 'isPremium', | ||
| operator: 'NotEquals', | ||
| value: { booleanValue: false }, | ||
| }); | ||
| }); | ||
|
|
||
| it('keeps "true" as a string when type=string', () => { | ||
| expect(parseFilterFlag('key=k,op=Equals,type=string,value=true')).toEqual({ | ||
| key: 'k', | ||
| operator: 'Equals', | ||
| value: { stringValue: 'true' }, | ||
| }); | ||
| }); | ||
|
|
||
| it('accepts fields in any order', () => { | ||
| expect(parseFilterFlag('value=abc,type=string,op=Contains,key=label')).toEqual({ | ||
| key: 'label', | ||
| operator: 'Contains', | ||
| value: { stringValue: 'abc' }, | ||
| }); | ||
| }); | ||
|
|
||
| it('throws on unknown operator', () => { | ||
| expect(() => parseFilterFlag('key=k,op=StartsWith,type=string,value=x')).toThrow(/op/); | ||
| }); | ||
|
|
||
| it('throws on unknown type', () => { | ||
| expect(() => parseFilterFlag('key=k,op=Equals,type=int,value=1')).toThrow(/type/); | ||
| }); | ||
|
|
||
| it('throws on missing required field', () => { | ||
| expect(() => parseFilterFlag('key=k,op=Equals,type=string')).toThrow(/value/); | ||
| }); | ||
|
|
||
| it('throws on duplicate keys', () => { | ||
| expect(() => parseFilterFlag('key=k,key=other,op=Equals,type=string,value=v')).toThrow(/Duplicate/); | ||
| }); | ||
|
|
||
| it('throws on invalid double value', () => { | ||
| expect(() => parseFilterFlag('key=k,op=Equals,type=double,value=notanumber')).toThrow(/double/); | ||
| }); | ||
|
|
||
| it('throws on invalid boolean value', () => { | ||
| expect(() => parseFilterFlag('key=k,op=Equals,type=boolean,value=yes')).toThrow(/boolean/); | ||
| }); | ||
|
|
||
| it('throws on empty input', () => { | ||
| expect(() => parseFilterFlag('')).toThrow(); | ||
| expect(() => parseFilterFlag(' ')).toThrow(); | ||
| }); | ||
|
|
||
| it('throws on syntactic garbage', () => { | ||
| expect(() => parseFilterFlag('not_a_kv_pair')).toThrow(); | ||
| }); | ||
| }); | ||
|
|
||
| describe('parseFilterFlags', () => { | ||
| it('returns undefined for missing/empty input', () => { | ||
| expect(parseFilterFlags(undefined)).toBeUndefined(); | ||
| expect(parseFilterFlags([])).toBeUndefined(); | ||
| }); | ||
|
|
||
| it('parses multiple filters', () => { | ||
| const out = parseFilterFlags(['key=a,op=Equals,type=string,value=x', 'key=b,op=GreaterThan,type=double,value=2']); | ||
| expect(out).toHaveLength(2); | ||
| expect(out![0]!.key).toBe('a'); | ||
| expect(out![1]!.value).toEqual({ doubleValue: 2 }); | ||
| }); | ||
| }); |
Oops, something went wrong.
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.
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.
Blocker — snapshot out of date.
Bumping this to
^0.1.0-alpha.29changes the vended CDKpackage.json, which is captured verbatim bysrc/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap(line ~360 still pins^0.1.0-alpha.19). The assets snapshot test will fail in CI.The PR description's checklist says:
That's not quite right — the assets snapshot test iterates every file under
src/assets/and snapshots the raw contents, so any change topackage.json(including a version pin) needs snapshot regeneration.Please run
npm run test:snapshots:update(ornpm run test:update-snapshots, per your Testing section) and commit the updated.snapfile.Second blocker on this same line:
@aws/agentcore-cdk@0.1.0-alpha.29is not published to npm yet (latest published on registry.npmjs.org isalpha.28). Merging this PR as-is will break:npm installfor any CDK project generated byagentcore create(caret won't resolve)npm run bundle) and anything else that touches the vended CDK projectOptions:
alpha.29is published to npm, then rebase.27ce126removed one), confirm it still applies here — the removal of that auto-sync is what makes this manual coordination necessary.