Stage Linear and Jira smoke issue outputs - #58786
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot the goal of this exercise is to fix linear/Jira implementation rations. Suggest code fixes or add error detection and diagnostic message to let the user know what to fix |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot add support for LINEAR_TEAM_ID env var that gets loaded by the compiler |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed in |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in |
|
@copilot add linear ... team-id in the safe outputs configuration (support expressions) instead of telling the user to use env... |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot support team id and project id configured globally through env vars as fallbacks |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in |
There was a problem hiding this comment.
🟡 Changes recommended
The smoke workflow never enables global staged mode, so live handlers and write permissions remain active.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds Linear ID fallbacks and clearer integration diagnostics, aiming to make the smoke workflow safe for preview runs. However, the workflow does not enable the promised staged mode.
Changes:
- Adds Linear team/project ID defaults and overrides.
- Improves Linear, Jira, and handler-loading errors.
- Updates schemas, tests, documentation, and the compiled smoke workflow.
File summaries
| File | Description |
|---|---|
pkg/workflow/safe_outputs_env.go |
Routes Linear ID variables to the trusted processor step. |
pkg/workflow/linear_safe_outputs.go |
Injects Linear token and ID defaults. |
pkg/workflow/linear_safe_outputs_test.go |
Tests credential injection and overrides. |
pkg/workflow/js/safe_outputs_tools.json |
Documents Linear ID fallbacks. |
pkg/workflow/compiler_safe_outputs_job.go |
Uses the expanded Linear credential injector. |
pkg/parser/schemas/main_workflow_schema.json |
Makes Linear team ID optional and expression-capable. |
pkg/parser/schema_linear_safe_outputs_test.go |
Tests new schema forms. |
pkg/constants/tool_constants.go |
Defines default Linear variable expressions. |
docs/src/content/docs/specs/safe-outputs-specification.md |
Documents optional Linear IDs. |
docs/src/content/docs/reference/safe-outputs.md |
Explains Linear fallback precedence. |
actions/setup/js/safe_outputs_tools.json |
Updates runtime tool guidance. |
actions/setup/js/safe_output_handler_manager.test.cjs |
Tests load-error warning behavior. |
actions/setup/js/safe_output_handler_manager.cjs |
Separates missing and failed handlers. |
actions/setup/js/linear_safe_outputs.test.cjs |
Tests fallbacks, precedence, and errors. |
actions/setup/js/linear_graphql.cjs |
Adds team-access diagnostics. |
actions/setup/js/linear_create_issue.cjs |
Reads IDs from environment fallbacks. |
actions/setup/js/jira_client.test.cjs |
Tests credential-specific errors. |
actions/setup/js/jira_client.cjs |
Reports missing Jira credentials individually. |
.github/workflows/smoke-issues.md |
Uses a repository variable for the Linear team. |
.github/workflows/smoke-issues.lock.yml |
Regenerates the compiled workflow. |
Review details
- Files reviewed: 20/20 changed files
- Comments generated: 3
- Review effort level: Balanced
| safe-outputs: | ||
| linear-create-issue: | ||
| team-id: "9cfb482a-81e3-4154-b5b9-2c805e70a02d" | ||
| team-id: ${{ vars.LINEAR_TEAM_ID }} |
| if (Array.isArray(payload.errors) && payload.errors.length > 0) { | ||
| const message = redactToken(payload.errors[0]?.message || "unknown GraphQL error", token).slice(0, 500); | ||
| if (message.toLowerCase().includes(LINEAR_TEAM_NOT_FOUND_MESSAGE)) { | ||
| throw new Error(`${ERR_CONFIG}: Linear could not access the configured team. Verify safe-outputs.linear-create-issue.team-id or LINEAR_TEAM_ID references a team in the workspace authorized by LINEAR_API_KEY`); |
| ``` | ||
|
|
||
| `team-id` is the Linear team model UUID, available through Linear's model UUID tooling or API. Optional `project-id` fixes new issues to a trusted project and accepts either the 12-character identifier from a Linear project URL or its model UUID. Comment and update targets are fixed trusted configuration and accept either a Linear issue model UUID or shorthand identifier such as `ENG-123`. Updates replace only the enabled `title` and `body` fields. All agent-provided titles, descriptions, and comments use standard Safe Outputs sanitization. | ||
| `team-id` accepts a Linear team model UUID, available through Linear's model UUID tooling or API, or a GitHub Actions expression such as `${{ vars.LINEAR_TEAM_ID }}`. Optional `project-id` fixes new issues to a trusted project and accepts either the 12-character identifier from a Linear project URL or its model UUID. When omitted, the compiler loads `LINEAR_TEAM_ID` and `LINEAR_PROJECT_ID` from same-named repository or organization variables. Values in `safe-outputs.env` can override those defaults; explicit `team-id` and `project-id` values take precedence over environment fallbacks. Comment and update targets are fixed trusted configuration and accept either a Linear issue model UUID or shorthand identifier such as `ENG-123`. Updates replace only the enabled `title` and `body` fields. All agent-provided titles, descriptions, and comments use standard Safe Outputs sanitization. |
The Smoke Issues workflow failed when unavailable Jira credentials and an inaccessible Linear team reached live safe-output handlers.