Skip to content

Add one-shot OTEL configuration with endpoint validation - #79549

Merged
pelikhan merged 14 commits into
mainfrom
copilot/add-specialized-env-subcommand
Nov 20, 2026
Merged

pelikhan merged 14 commits into
mainfrom
copilot/add-specialized-env-subcommand

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Add gh aw env otel as an operational command that validates OTEL inputs, tests collector authentication, and configures existing GitHub Actions settings.

Scope

  • Configure the existing GH_AW_DEFAULT_OTLP_ENDPOINT and GH_AW_DEFAULT_OTLP_HEADERS scalar secrets, plus OTEL_EXPORTER_OTLP_PROTOCOL and GH_AW_OTEL_METRICS variables.
  • Support hidden interactive credentials or stdin, repeatable repository/organization targets, enterprise-to-organization expansion, and selected visibility.
  • Validate URLs and headers, then require an authenticated empty traces export with bounded requests/responses and no redirects before writing settings.
  • Preflight target access and organization/repository overrides. Update scalar settings fail-closed: temporarily disable the endpoint, write headers and variables, then enable the validated endpoint last. Errors identify the affected target; writes are not transactional.

No compiler, runtime, specification, or generated-workflow changes. The command uses the existing OTEL configuration contract and does not compile workflows or introduce a JSON configuration secret.

gh aw env otel --repo my-org/one --repo my-org/two \
  --endpoint https://collector.example.com \
  --protocol http/protobuf --headers-stdin --yes < otlp-headers.txt

The probe verifies route/authentication acceptance, not span ingestion or connectivity from GitHub runners. Organization setup rejects partial repository secret overrides and changes to existing secret visibility; avoid concurrent settings changes and workflow starts during configuration.

@pelikhan pelikhan changed the title Add one-shot OTEL setup with authenticated endpoint validation Add one-shot OTEL configuration with endpoint validation Nov 20, 2026
@pelikhan
pelikhan marked this pull request as ready for review November 20, 2026 16:24
Copilot AI adaptive review requested due to automatic review settings November 20, 2026 16:24
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~6 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #79549 · codex · routed: gpt61 medium · ~6 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by PR Specification Reviewer for #79549 · copilot · gpt56 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.7K · ◷

@github-actions

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills...

@github-actions github-actions Bot left a comment

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.

What this change does: It adds a command that checks an OpenTelemetry endpoint and saves export settings for selected GitHub targets. The check supports JSON and protobuf responses.

Should fix

  1. Reuse the existing protobuf wire decoder to reduce the custom parsing code, as noted inline.

Verdict: fix 1 first.
Lean: -10 lines possible.

Generated by ✂️ Ponytail Reviewer for #79549 · codex · routed: gpt61 medium · ~6 AIC · ⌖ ~1 AIC · ⊞ 185
Comment /ponytail to run again

Comment thread pkg/cli/env_otel_probe.go Resolved
@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (>100 new lines in pkg/) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/79549-one-shot-otel-configuration-with-endpoint-validation.md — review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch — it was generated from the PR diff

  2. Complete the missing sections — resolve the [TODO: verify] items, refine the rationale, and list the real alternatives you considered

  3. Commit the finalized ADR to docs/adr/ on your branch

  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-79549: One-Shot OTEL Configuration With Authenticated Endpoint Validation (link unavailable: invalid HTTPS URL)

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · routed: sonnet55 high · ~14 AIC · ⌖ ~2 AIC · ⊞ 8.6K · ◷
Comment /review to run again

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-be60ab7f-3882-4701-bc93-e476199fa399","parents":[],"payload":{"id":"ldg-556872b1-a09a-44de-b5a5-bb617a98e510","operation":"append","value":{"finding_count":0,"head_sha":"4e0b402ac4b30c38e4b4219a540d927127e609c9","outcome":"aligned"}},"sha":"sha256:cb93a4ec7665b0a3c5eb84047139c314756c6f6e3bf043243f02c02de7a17873","timestamp":"2026-11-20T16:30:51.486Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-20T16:27:15Z
review_event: REQUEST_CHANGES
top_themes:
  - enterprise selected-target validation rejects documented organization slugs
files_reviewed:
  - docs/src/content/docs/reference/open-telemetry.mdx
  - pkg/cli/env_command.go
  - pkg/cli/env_otel_command.go
  - pkg/cli/env_otel_command_test.go
  - pkg/cli/env_otel_probe.go
comment_count: 1
History

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~6 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

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.

Found one blocking correctness issue in enterprise selected-target handling. The documented enterprise --visibility selected --selected <org> flow is rejected by the shared repository-selection validation before expansion.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~6 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again

Comment thread pkg/cli/env_otel_command.go Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-3760c305-647e-4a9d-8c47-6fef054c9e15","parents":[],"payload":{"id":"ldg-99308375-bc36-492b-9809-1b247b4fbbcf","operation":"append","value":{"finding_count":1,"head_sha":"4e0b402ac4b30c38e4b4219a540d927127e609c9","outcome":"findings"}},"sha":"sha256:0ad3fb26560fe55a6f71bc01154c99c3958d89da6953adc0fe5b3128a9f405a6","timestamp":"2026-11-20T16:33:35.647Z","type":"ledger_append","version":1}
History

Copilot AI left a comment

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.

🟡 Changes recommended

Unresolved critical flaws can expose credentials to unintended collectors and bypass Go’s protection against executing binaries from relative PATH entries.

11 open issues
What changed in this PR

Adds gh aw env otel to configure default OpenTelemetry export for repositories, organizations, and an enterprise’s visible organizations.

Changes:

  • Supports interactive or stdin-based bulk setup with protocol, metrics, and repository-access options.
  • Probes endpoints before saving encrypted endpoint/header secrets and configuration variables.
  • Adds command registration, unit coverage, and setup documentation.
File Description
pkg/​cli/​env_otel_probe.go Validates URLs and headers; performs bounded OTLP endpoint checks.
pkg/​cli/​env_otel_command.go Implements input, target expansion, preflight checks, and persistence.
pkg/​cli/​env_otel_command_test.go Covers validation, credentials, target selection, and writes.
pkg/​cli/​env_command.go Registers the env otel subcommand.
docs/​src/​content/​docs/​reference/​open-telemetry.mdx Documents setup options, validation behavior, and operational limits.

Review effort: Max (adaptive)

Comment thread pkg/cli/env_otel_command.go Resolved
Comment thread pkg/cli/env_otel_command.go Resolved
Comment thread pkg/cli/env_otel_command.go Resolved
Comment thread pkg/cli/env_otel_probe.go Resolved
Comment thread pkg/cli/env_otel_probe.go Resolved
Comment thread pkg/cli/env_otel_probe.go Resolved
Comment thread pkg/cli/env_otel_probe.go Resolved
Comment thread pkg/cli/env_otel_probe.go Resolved
Comment thread pkg/cli/env_otel_probe.go Resolved
Comment thread pkg/cli/env_otel_command.go Resolved
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot run pr-finisher skill

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Copilot stopped work on behalf of pelikhan due to an error November 20, 2026 17:52
@github-actions

Copy link
Copy Markdown
Contributor

Visual regression check: docs preview

Built docs were served on 127.0.0.1:4321 inside the sandbox and captured with Playwright CLI.

Page Viewport Capture status Comparison status
/gh-aw/ Mobile 375x812 captured unavailable
/gh-aw/ Tablet 768x1024 captured unavailable
/gh-aw/ Desktop 1440x900 captured unavailable

Comparison is unavailable: no baseline is provisioned for this workflow, so no visual diff was made.

Accessibility inspection (/gh-aw/)

The full snapshot (884 lines) was read to EOF. Console showed 0 errors and 4 warnings.

  • Heading order is sound: one h1, then h2 sections with h3 subheadings.
  • Landmarks are present (banner, main, navigation, contentinfo) and named regions are used. A skip link is present.
  • Controls, tabs and figures carry accessible names. No missing-name failures were seen.

Items to review (not confirmed defects):

  • Link labels are inconsistent. Some external links announce (opens in a new tab), while Try the workflow wizard and the Slides link do not.
  • Create a workflow and Copy installation prompt appear twice with the same targets.

Scope limit: this was a structural snapshot only. No contrast, keyboard or axe-based checks were run.

Limitations

  • Browser closed and preview server stopped; the stop result confirmed the server was gone.
  • A workspace check for leftover Playwright artifacts (for example .playwright-cli/) was denied by tool permissions, so it is unverified.

Generated by 👁️ Visual Regression Checker for #79549 · copilot · routed: haiku55 high · ~2 AIC · ⌖ ~1 AIC · ⊞ 3.5K · ◷

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot merge main

…ed-env-subcommand

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

@copilot merge main

Merged main in 639c14764f. The merge has two parents and passed the fast compile/vet and JavaScript lint checks.

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Merged main in 639c14764f. The OTEL design and dry-run telemetry test failure remain unresolved; the older route job was interrupted by runner shutdown, and the conclusion job logged collector authorization failures.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot fix ci failures

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot merge main and fix dry-run unresolved credential-exposure concern

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check Unit tests (D-G) (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "639c14764f23a7776e6075ebe5cd87a905c3c0fa",
  "kind": "requested",
  "schema_version": "1",
  "state": "9142e8f22615661c4749f05432a2d2610a9d6b4b2042924dfc12d3998d1ad171",
  "work": [
    "49c80a00fb3786e9cd4801737bd50a4de83978035bb4a487a6bb6689f2c3cd03"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

pelikhan and others added 2 commits November 20, 2026 20:54

Copilot AI commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

@copilot merge main and fix dry-run unresolved credential-exposure concern

Merged main in 44bd45b6d4 and removed the paired OTLP secret from dry-run environments in 6d3a5822ca; focused tests pass. The full validation gate was stopped after its Go linters ran for eight minutes, and CodeQL timed out. Ordinary workflows still expose the paired secret to the agent sandbox; this dry-run fix does not address that separate blocker.

Copilot AI commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Already addressed: 44bd45b6d4 merged the current main, and 6d3a5822ca fixed the dry-run test failure. Focused tests passed; the current-head CGO run is still in progress.

pelikhan and others added 2 commits November 20, 2026 14:00
Resolve paired-config conflicts by retaining the existing scalar OTLP contract, preserving upstream changes and regenerating workflow outputs.

Co-authored-by: Copilot App <[email protected]>
@pelikhan
pelikhan merged commit 9727609 into main Nov 20, 2026
87 of 88 checks passed
@pelikhan
pelikhan deleted the copilot/add-specialized-env-subcommand branch November 20, 2026 22:18
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.

5 participants