Skip to content

Fixes #36341 - Extract Ansible artifacts reader - #118

Open
jakduch wants to merge 1 commit into
theforeman:masterfrom
jakduch:fix/36341
Open

Fixes #36341 - Extract Ansible artifacts reader#118
jakduch wants to merge 1 commit into
theforeman:masterfrom
jakduch:fix/36341

Conversation

@jakduch

@jakduch jakduch commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #36341.

Artifact discovery, ordering, file reads, JSON parsing, event routing, and result publication all lived in AnsibleRunner. This made the incremental file behavior difficult to test independently and coupled filesystem details to event interpretation.

Extract an instance-owned ArtifactsReader with a small new_artifacts API. It is responsible only for finding the runner artifact directory, ignoring partial files, ordering complete events by counter, reading each file once, and returning path/content values. AnsibleRunner remains responsible for parsing and interpreting the contents, preserving event IDs, timestamps, logging, and output behavior.

Unlike the earlier WIP in #84, the reader has no class-level state and does not replace raw events with objects that lose metadata. Add focused tests for ordering, partial files, incremental reads, and an artifact directory that appears after polling starts.

Testing

  • Ruby syntax checks pass
  • Standalone reader smoke test passes for ordering, partial-file filtering, and incremental reads
  • Added focused reader unit tests; CI runs the full suite with the repository's supported dependency bundle

AI usage disclosure

Per the community discussion on AI policy, the issue was investigated and the changes, tests, and PR wording were prepared with the assistance of Codex 5.6 Sol High. The resulting changes were reviewed before submitting. The commit also includes an Assisted-By trailer.

Separate incremental artifact file discovery and reading from runner event parsing and processing.

Assisted-By: Codex 5.6 Sol High
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant