Skip to content

ci: add github actions#12

Draft
Khady wants to merge 29 commits intomasterfrom
louis/ci
Draft

ci: add github actions#12
Khady wants to merge 29 commits intomasterfrom
louis/ci

Conversation

@Khady
Copy link
Copy Markdown
Contributor

@Khady Khady commented Nov 10, 2025

Probably needs to be updated. For an unknown reason I created the branch but not a corresponding PR at the time.

@Khady
Copy link
Copy Markdown
Contributor Author

Khady commented Nov 10, 2025

@rr0gi
Copy link
Copy Markdown
Contributor

rr0gi commented Nov 13, 2025

i don't have opinion on this and i cannot read yaml so merge when you see fit

Atlas07 and others added 23 commits March 9, 2026 19:53
The _shards type was added to search results in PR #15 but the test
expected outputs were not regenerated. Update all test output.atd files
to match the current code generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements GitHub issue #5. The multi_terms aggregation groups documents
by multiple fields simultaneously (like SQL GROUP BY a, b), returning
composite keys as JSON arrays.

Changes:
- common.ml: Add Tuple variant to result_type for composite keys
- aggregations.ml: Add Multi_terms variant, parsing, and type inference
- atdgen.ml: Map Tuple to ATD tuple type (serialized as JSON array)
- test/multi_terms_agg: Test with keyword and numeric fields, variable size

The composite key is represented as an ATD tuple, which naturally maps to
JSON arrays matching the ES multi_terms response format.

Closes #5

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Include shard failure details (reason type+text, shard, index, node,
status) as optional fields in the generated _shards ATD type for Search
queries, matching the ES ShardStatistics spec:
- failures: optional (may be absent even when failed > 0)
- reason: required on each failure (ErrorCause)
- reason.type: required string (becomes type_ in OCaml)
- reason.reason: optional string (human-readable message)
- shard, index, node, status: all optional

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All search query output.atd files updated to include the new reason,
failure types and expanded _shards type. Get/Mget tests unaffected.

Note: other_bucket gains failure (shard) and failure1 (aggregation
bucket) types — automatic deduplication when a query already had a
field named 'failure' in its aggregations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Support $(var:field:<type>) syntax alongside existing $(var:list).
No behavioral changes yet — field_type is parsed but unused.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Field_var carries a Tjson.var and a simple_type parsed from the
field type annotation. typeof_value returns Simple typ directly,
bypassing the mapping lookup.

Also adds parse_field_type helper to convert user-facing type
strings ("string", "int", "float", "int64") to simple_type.

Note: the value type definition was moved after pp_simple_type
because [@@deriving show] on Field_var needs the printer in scope.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Parse $(var:field:<type>) in aggregation field position
- Register field variables as string input parameters
- Skip numeric/date field validation for dynamic fields

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests $(group_by:field:string) syntax: verifies string input parameter
and string bucket key output type.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add field variable section under Variables with usage example
and supported type annotations.
Use descriptive names like _typ, _name, _metric, _keys etc.
instead of bare _ in pattern matches added by this PR.
Type annotations now use ES type names (keyword, long, double)
instead of custom names (string, int, float).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The :field: segment was redundant — the type annotation is useful
regardless of context, and the usage site already determines semantics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The annotated type is known at codegen time, so we can warn when
a non-numeric type is used in a numeric context — same as Field.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Eliminates redundant second match on aggregation type. Each arm now
handles its own field_var_constraints inline, matching the existing
pattern for on_int_var and Field_num/Field_date constraints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
String is the type of the variable value (field name passed at
runtime), not the aggregation result type.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
External users don't know what simple_of_es_type is.
List supported types directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The field is no longer field-specific after the syntax simplification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The parser branches already prevent this, but the explicit check
makes the invariant visible.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests $(bucket_field:long) in a histogram aggregation, exercising
the Field_num constraint validation path and float bucket key output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add variable field support in aggregations
Comment thread atdgen.ml
Comment on lines +20 to +24
let ends_with s suffix =
let s_len = Stdlib.String.length s in
let suffix_len = Stdlib.String.length suffix in
s_len >= suffix_len
&& Stdlib.String.sub s (s_len - suffix_len) suffix_len = suffix
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

but i have an opinion on copy-pasting stdlib functions inline multiple times and you don't want to hear it

@rr0gi rr0gi force-pushed the master branch 2 times, most recently from fe4d76e to 131cba2 Compare March 27, 2026 16:21
@Khady Khady marked this pull request as draft March 30, 2026 03:40
@Khady
Copy link
Copy Markdown
Contributor Author

Khady commented Mar 30, 2026

sorry I had an agent running in a loop to fix the CI and wasn't looking at all at its output, I should have switched to draft PR before to run it. Still haven't done a human review of the changes

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.

3 participants