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

chore: add typing support to regex-related adjudicators #1484

Draft
wants to merge 56 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
1137b84
Create full mocks of AdmissionRequest<KubernetesObject>
samayer12 Nov 7, 2024
9546791
Add return type to Admission Request adjudicators
samayer12 Nov 7, 2024
5d673d5
Address potentially undefined input to adjudicator
samayer12 Nov 7, 2024
12c8c4a
Add funciton return types
samayer12 Nov 7, 2024
cc3e810
Use consistent enum property names
samayer12 Nov 7, 2024
d94543d
Reworking types to remove typescript warnings so that I can actually …
samayer12 Nov 7, 2024
a169536
Work on resolving typing issues by using actual objects instead of pa…
samayer12 Nov 18, 2024
8300b37
use explicit imports in test file
samayer12 Nov 18, 2024
bf38e38
Fix failing tests in bindingadjudicator
samayer12 Nov 18, 2024
984660f
tidy test exports, add typing, get passing tests
samayer12 Nov 18, 2024
ecdd130
Merge branch 'main' into 1397-type-adjudicators
samayer12 Nov 18, 2024
f5c3a8d
Add typing to mismatchedEvent()
samayer12 Nov 18, 2024
2a0c025
Merge branch 'main' into 1397-type-adjudicators
samayer12 Nov 19, 2024
e7f9a5b
Update imports
samayer12 Nov 19, 2024
19a7dcd
Remove obsolete test cases now that we have typing support
samayer12 Nov 19, 2024
1eb7cde
Remove undefined return type on definedName()
samayer12 Nov 19, 2024
9aa94e9
Remove obsolete test cases now that we use typing, manage typing for …
samayer12 Nov 19, 2024
6fb930a
Update imports
samayer12 Nov 19, 2024
e7a2a86
Merge branch 'main' into 1397-type-adjudicators
samayer12 Nov 19, 2024
4c78fe0
Use regexes in test data to match typing
samayer12 Nov 20, 2024
dd2f84d
Update test case to handle typing with a null test case
samayer12 Nov 20, 2024
eaf481f
Resolve test failure for mismatchedNamespaceRegex()
samayer12 Nov 20, 2024
b790be3
Merge branch 'main' into 1397-type-adjudicators
samayer12 Nov 20, 2024
d7da7cf
Merge branch 'main' into 1397-type-adjudicators
samayer12 Nov 20, 2024
25081c2
Move default test objects to central location
samayer12 Nov 20, 2024
5cc5667
Use defaultTestObjects in bindingAdjudicators.test.ts
samayer12 Nov 20, 2024
aa24a30
Centralize more default test values
samayer12 Nov 20, 2024
dfa4eee
Merge branch 'main' into 1397-type-adjudicators
samayer12 Nov 20, 2024
2bdad5c
Undo type coversion to RexExp, use string
samayer12 Nov 21, 2024
e08e896
Remove unecessary message output sanitization
samayer12 Nov 21, 2024
786c1a2
Rearrange import and managed regex usage in tests
samayer12 Nov 21, 2024
9cc9267
Move filesystem helper to specific file
samayer12 Nov 21, 2024
a0dab61
Remove a test case obviated by the use of typing
samayer12 Nov 21, 2024
8bbcfd1
Remove kfc mock
samayer12 Nov 21, 2024
6ca317b
Use it() instead of test() to match domain-driven test naming style
samayer12 Nov 21, 2024
909e890
Rewrite test using full objects and it.each()
samayer12 Nov 21, 2024
937ce19
Remove unnecessary regex edge case now that we use typing
samayer12 Nov 21, 2024
a98e0df
Update regex to match test condition
samayer12 Nov 21, 2024
5a0753d
Restructure test format
samayer12 Nov 21, 2024
d983481
Restructure name equality test
samayer12 Nov 21, 2024
d887b53
Remove mockK8s.mockImplementation()
samayer12 Nov 21, 2024
2e44cc9
Restructure test
samayer12 Nov 21, 2024
5ac5159
Put related tests into a describe() block
samayer12 Nov 21, 2024
7c2ae10
Extract large function to new file
samayer12 Nov 21, 2024
7434ce8
Remove mocks and set return type
samayer12 Nov 21, 2024
172ebf4
Update import from cli
samayer12 Nov 21, 2024
ac8aa24
Update imports
samayer12 Nov 21, 2024
1a4e7dd
Merge branch 'main' into 1397-type-adjudicators
samayer12 Nov 21, 2024
06ea6cc
Update imports after file move
samayer12 Nov 21, 2024
0eb3f1e
Move some helper functions to deploymentChecks
samayer12 Nov 21, 2024
cb1d7bb
Remove file restructure for next commit
samayer12 Nov 21, 2024
7f98a9c
Merge branch '1397-split-helpers' into 1397-type-adjudicators
samayer12 Nov 21, 2024
8ecce94
Merge branch 'main' into 1397-type-adjudicators
samayer12 Nov 22, 2024
70c1178
Merge branch 'main' into 1397-type-adjudicators
samayer12 Nov 22, 2024
257c4b8
Undo regexp work to revisit on a separate PR
samayer12 Nov 22, 2024
7f1bbec
Revert "Undo regexp work to revisit on a separate PR"
samayer12 Nov 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib/capability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@
return { ...commonChain, WithName, WithNameRegex };
}

function InNamespaceRegex(...namespaces: RegExp[]): BindingWithName<T> {
function InNamespaceRegex(...namespaces: string[]): BindingWithName<T> {

Check warning on line 348 in src/lib/capability.ts

View check run for this annotation

Codecov / codecov/patch

src/lib/capability.ts#L348

Added line #L348 was not covered by tests
Log.debug(`Add regex namespaces filter ${namespaces}`, prefix);
binding.filters.regexNamespaces.push(...namespaces.map(regex => regex.source));
binding.filters.regexNamespaces.push(...namespaces);

Check warning on line 350 in src/lib/capability.ts

View check run for this annotation

Codecov / codecov/patch

src/lib/capability.ts#L350

Added line #L350 was not covered by tests
return { ...commonChain, WithName, WithNameRegex };
}

Expand All @@ -357,9 +357,9 @@
return commonChain;
}

function WithNameRegex(regexName: RegExp): BindingFilter<T> {
function WithNameRegex(regexName: string): BindingFilter<T> {

Check warning on line 360 in src/lib/capability.ts

View check run for this annotation

Codecov / codecov/patch

src/lib/capability.ts#L360

Added line #L360 was not covered by tests
Log.debug(`Add regex name filter ${regexName}`, prefix);
binding.filters.regexName = regexName.source;
binding.filters.regexName = regexName;

Check warning on line 362 in src/lib/capability.ts

View check run for this annotation

Codecov / codecov/patch

src/lib/capability.ts#L362

Added line #L362 was not covered by tests
return commonChain;
}

Expand Down
Loading
Loading