feat: Add AdfBuilder for Jira tickets generation#54
Closed
Conversation
This was referenced Mar 3, 2026
1217069 to
846cb0b
Compare
846cb0b to
698e096
Compare
Adds OpenTelemetry observability URL helpers that mirror Opsbox::OpenTelemetry. Provides Grafana Tempo trace URLs, local Jaeger URLs (dev/development), and Kibana Discover log URLs — all returning nil gracefully when OTEL is unconfigured. Adds opentelemetry_api ~> 1.4 and jason ~> 1.4 dependencies. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds two new utility modules required by the AutoEscalation feature: - Zexbox.JiraClient: Req-based client for the Jira Cloud REST API v3. Supports search, create, transition, and add_comment operations. Authenticates via JIRA_USER_EMAIL_ADDRESS / JIRA_API_TOKEN env vars or :jira_email / :jira_api_token application config. - Zexbox.OpenTelemetry: Reads the current process OTEL context (baggage and active span) to produce Datadog session, Grafana Tempo trace, and Kibana Discover URLs. Returns nil gracefully when OTEL is unconfigured. Adds :req, :jason, and :opentelemetry_api dependencies to mix.exs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…uests search_latest_issues was using GET with query params, which means the response body was not guaranteed to be JSON-decoded by Req (Req only auto-decodes based on the response Content-Type, not the request method). Two changes: - search_latest_issues now uses POST /rest/api/3/search/jql with a JSON body — the preferred Jira v3 approach. This also allows fields to be sent as a proper JSON array rather than a comma-separated string. - build_client adds Accept: application/json to every request so the remaining GET (transitions fetch) also explicitly signals JSON intent and Req's decode_body step has a clear content-type to act on. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces keyword list opts (Keyword.fetch!/get) with typed positional
arguments throughout, consistent with the rest of the repo's style:
search_latest_issues(jql, project_key \\ nil)
create_issue(project_key, summary, description, issuetype, priority, custom_fields \\ %{})
transition_issue(issue_key, status_name)
add_comment(issue_key, comment)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f1ce788 to
6d6528f
Compare
Adds Zexbox.AutoEscalation.AdfBuilder, which builds Atlassian Document Format (ADF) maps for new Jira issue descriptions and occurrence comments. Structure produced: - Telemetry paragraph (Datadog | Tempo | Kibana links, or "(Missing)") - Optional divider + custom description paragraphs - User context and additional context bullet lists - Error Details heading, exception class/message, expandable stack trace Both build_description/4 and build_comment/5 accept keyword opts for the optional custom_description and stacktrace arguments. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0c230ce to
4ec7726
Compare
Jaeger is not available locally. generate_trace_url/0 now returns nil for non-production/sandbox environments instead of a localhost Jaeger URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds two new utility modules required by the AutoEscalation feature: - Zexbox.JiraClient: Req-based client for the Jira Cloud REST API v3. Supports search, create, transition, and add_comment operations. Authenticates via JIRA_USER_EMAIL_ADDRESS / JIRA_API_TOKEN env vars or :jira_email / :jira_api_token application config. - Zexbox.OpenTelemetry: Reads the current process OTEL context (baggage and active span) to produce Datadog session, Grafana Tempo trace, and Kibana Discover URLs. Returns nil gracefully when OTEL is unconfigured. Adds :req, :jason, and :opentelemetry_api dependencies to mix.exs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…uests search_latest_issues was using GET with query params, which means the response body was not guaranteed to be JSON-decoded by Req (Req only auto-decodes based on the response Content-Type, not the request method). Two changes: - search_latest_issues now uses POST /rest/api/3/search/jql with a JSON body — the preferred Jira v3 approach. This also allows fields to be sent as a proper JSON array rather than a comma-separated string. - build_client adds Accept: application/json to every request so the remaining GET (transitions fetch) also explicitly signals JSON intent and Req's decode_body step has a clear content-type to act on. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces keyword list opts (Keyword.fetch!/get) with typed positional
arguments throughout, consistent with the rest of the repo's style:
search_latest_issues(jql, project_key \\ nil)
create_issue(project_key, summary, description, issuetype, priority, custom_fields \\ %{})
transition_issue(issue_key, status_name)
add_comment(issue_key, comment)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds Zexbox.AutoEscalation.AdfBuilder, which builds Atlassian Document Format (ADF) maps for new Jira issue descriptions and occurrence comments. Structure produced: - Telemetry paragraph (Datadog | Tempo | Kibana links, or "(Missing)") - Optional divider + custom description paragraphs - User context and additional context bullet lists - Error Details heading, exception class/message, expandable stack trace Both build_description/4 and build_comment/5 accept keyword opts for the optional custom_description and stacktrace arguments. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49ed703 to
8d02399
Compare
* feat: Add Zexbox.JiraClient to link error handling with support processes.
…/zexbox into auto_escalation_adf_builder
Replace opts keyword list with explicit stacktrace and custom_description positional arguments in build_description/5 and build_comment/6. Simplify internal list-building from Kernel.++ pipe chains to plain ++ expressions, and consolidate add_if/has_content? helpers into optional_description_blocks and single_context_blocks. Restore Zexbox.OpenTelemetry (from stacked PR) so the module is available to compile and mock in tests. Fix duplicate dependency entries in mix.exs. All 60 tests pass; credo and dialyzer clean. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the ++ chain in build_description and build_comment with a shared private build_body/6 pipeline. Each section is now appended via a dedicated append_telemetry/1, append_description/2, append_context/3, and append_error_details/3 function that takes and returns the accumulator list, making the document structure readable as a left-to-right pipe and keeping each optional section's emptiness logic self-contained. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
[Redacted]