Skip to content

pipelineymlgen: make inlinerange more consistent and usable#462

Open
dagood wants to merge 5 commits intomainfrom
dev/dagood/inlinerange
Open

pipelineymlgen: make inlinerange more consistent and usable#462
dagood wants to merge 5 commits intomainfrom
dev/dagood/inlinerange

Conversation

@dagood
Copy link
Copy Markdown
Member

@dagood dagood commented Apr 6, 2026

Make the input requirements of pipelineymlgen more consistent and make the output more predictable. The current implementation tends to over-inline or result in a sequence when a map is needed, making some output impossible to achieve.

Copilot AI review requested due to automatic review settings April 6, 2026 23:41
@dagood dagood requested a review from a team as a code owner April 6, 2026 23:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates pipelineymlgen’s inlinerange behavior to make output shape more predictable (map vs sequence) and improves usability by making the loop body’s YAML type control how results are inlined, with updated docs and expanded test coverage/examples.

Changes:

  • Adjust inlinerange evaluation to merge mapping bodies into mappings and sequence bodies into sequences, and to error on bare scalar bodies.
  • Update and expand inlinerange tests (including new examples and new error-case fixtures) to reflect the new, more explicit YAML shapes.
  • Update pipelineymlgen README documentation to describe ordering, body-type semantics, and provide example links.

Reviewed changes

Copilot reviewed 24 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/pipelineymlgen/eval.go Changes how inlinerange bodies are collected/merged; tightens mapping/sequence conversion; adds scalar-body error.
cmd/pipelineymlgen/README.md Updates inlinerange semantics and adds examples describing mapping vs sequence insertion and scalar-body errors.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-processed-keys.gen.yml Adjusts typed-slice test input to the new sequence-body style.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-processed-keys.golden.yml Updates expected output for typed-slice test.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-map-order.gen.yml Adjusts map-order test to produce a mapping (not a sequence of singleton maps).
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-map-order.golden.yml Updates expected output for deterministic sorted map iteration.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-3arg.gen.yml Updates 3-arg form test to use explicit sequence body items.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-3arg.golden.yml New expected output for 3-arg form.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-2arg.gen.yml Updates 2-arg form test to use explicit sequence body items.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-2arg.golden.yml New expected output for 2-arg form.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-1arg.gen.yml Adds replacement for scalar/no-varname test using explicit sequence body items.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-1arg.golden.yml Expected output for 1-arg scalar iteration.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-1arg-map.gen.yml Adds 1-arg map iteration test (values only).
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-1arg-map.golden.yml Expected output for 1-arg map iteration.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-examples.gen.yml Adds a comprehensive “how to shape output” examples file.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-examples.golden.yml Golden output for the examples file.
internal/pipelineymlgen/testdata/TestEndToEnd/inlinerange-map-yaml-order/map-order.gen.yml Updates end-to-end YAML-sourced map iteration to the new sequence-body style.
internal/pipelineymlgen/testdata/TestEndToEnd/inlinerange-filter/inlinerange-filter.gen.yml Adjusts filtering example indentation/structure to the new style.
internal/pipelineymlgen/testdata/TestEndToEnd/inlinerange-filter/images-filter.gen.yml Adjusts filtering example indentation/structure to the new style.
internal/pipelineymlgen/testdata/TestIndividualFileErrors/inline-value-into-seq.gen.yml Adds a negative test for scalar body in sequence context.
internal/pipelineymlgen/testdata/TestIndividualFileErrors/inline-value-into-seq.golden.txt Expected error message for scalar body in sequence context.
internal/pipelineymlgen/testdata/TestIndividualFileErrors/inline-value-into-map.gen.yml Adds a negative test for scalar body in mapping context.
internal/pipelineymlgen/testdata/TestIndividualFileErrors/inline-value-into-map.golden.txt Expected error message for scalar body in mapping context.
internal/pipelineymlgen/testdata/TestIndividualFileErrors/inline-seq-into-map.gen.yml Adds a negative test for sequence body in mapping context.
internal/pipelineymlgen/testdata/TestIndividualFileErrors/inline-seq-into-map.golden.txt Expected error message for sequence body in mapping context.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-scalar.gen.yml Removes older scalar test fixture in favor of new 1-arg fixtures.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-replace-data.gen.yml Removes older “replace data entirely” test fixture.
internal/pipelineymlgen/testdata/TestIndividualFiles/inlinerange-replace-data.golden.yml Removes golden output for removed fixture.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dagood dagood requested a review from Copilot April 7, 2026 17:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 28 out of 32 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

dagood added 2 commits April 7, 2026 11:44
Not reachable from current usage, but this makes the code more consistent for the future.
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.

2 participants