Skip to content

harness-deploy: complete solution with entity-scoped workflow and two stage templates - #234

Merged
jeff-schnitter merged 9 commits into
mainfrom
cx-harness-deploy-solution
Aug 13, 2026
Merged

harness-deploy: complete solution with entity-scoped workflow and two stage templates#234
jeff-schnitter merged 9 commits into
mainfrom
cx-harness-deploy-solution

Conversation

@jeff-schnitter

Copy link
Copy Markdown
Collaborator

Summary

  • Splits the single Harness stage template into two reusable templates (cortex_record_deploy + cortex_async_callback), matching the GitHub Actions composite action pattern
  • Demo pipeline now has 3 stages: Build (with 3 intermediate UPDATE progress callbacks) → Record Deploy in Cortex → Callback to Cortex
  • Workflow changed from GLOBAL to ENTITY scope; renamed to "Solution: Trigger Harness Deploy"
  • Harness coordinates (org, project, pipeline) stored in entity x-cortex-custom-metadata.harness and read at runtime — no manual inputs required at trigger time
  • setup.py writes custom metadata via PATCH /api/v1/open-api after collecting answers
  • Workflow run failure output links to the Cortex Workflow runs page for investigation
  • README and run response template updated to reflect 3-stage architecture
  • ASCII diagram fixed (box alignment + 3-stage pipeline)

Test plan

  • cortex solutions install -s harness-deploy completes cleanly
  • cortex solutions post-install -s harness-deploy creates both stage templates, pipeline, secret, and writes custom metadata
  • Workflow appears on entity page (ENTITY scope)
  • Triggering workflow reads Harness config from custom metadata and fires pipeline
  • Progress updates appear in Cortex workflow UI during pipeline run
  • Deploy event recorded on entity after completion

🤖 Generated with Claude Code

jeff-schnitter and others added 9 commits August 12, 2026 13:43
Mirrors the github-actions-deploy solution pattern for Harness pipelines:
- Entity + scorecard (deploy health, Bronze/Silver/Gold)
- Cortex async workflow template (HTTP_REQUEST_ASYNC with Harness integration)
- Harness pipeline YAML template (registers deploy + async callback)
- setup.py wizard: selects Harness integration alias, imports workflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Instead of telling the user to paste YAML into Harness, setup.py now:
- Prompts for a Harness API key
- Creates the cortex_deploy pipeline via POST /v1/orgs/.../pipelines
- Creates the cortex_api_key secret via POST /ng/api/v2/secrets/text
- Skips both steps if the resource already exists (idempotent)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… in setup

- Add cortex integrations harness subcommand with full CRUD:
  add, get, list, get-default, update, delete, delete-all, validate, validate-by-alias
- setup.py now creates the Cortex Harness integration automatically when
  none exists (prompts for alias, API key, account ID, optional host, then
  calls POST /api/v1/harness/configuration)
- Captured credentials are reused for the Harness pipeline/secret steps so
  the user is never asked for the same thing twice

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
'Resource' is retired Cortex terminology. All CLI messages now say 'entity'
/ 'entities' consistently.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
_harness_base() was using .get(..., default) which doesn't catch an
empty-string value set when the user accepts the blank host prompt.
Use `or` so any falsy value falls back to HARNESS_APP_HOST.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Harness v1 POST /pipelines expects JSON with the YAML embedded as a
string field, not raw YAML as the body. The error was:
  Unrecognized field "pipeline" (class PipelineCreateRequestBody)

Fix: send Content-Type: application/json with {identifier, name, yaml}.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two fixes found by testing against the actual Harness API:
- Field name is pipeline_yaml, not yaml or pipelineYaml
- YAML name must match the name field in the JSON body

Verified 201 response with a test pipeline (subsequently deleted).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… stage templates

- Split single stage template into cortex_record_deploy + cortex_async_callback
  (mirrors GitHub Actions composite action pattern)
- Pipeline now has 3 stages: Build → Record Deploy in Cortex → Callback to Cortex
- Build stage sends 3 intermediate UPDATE callbacks with progress % before terminal callback
- Workflow changed from GLOBAL to ENTITY scope; renamed to "Solution: Trigger Harness Deploy"
- Harness coordinates stored in entity custom metadata (x-cortex-custom-metadata.harness)
  and read at runtime via GET /custom-data/harness — no manual inputs required
- setup.py writes custom metadata via PATCH /api/v1/open-api after collecting answers
- Workflow run failure shows link to Cortex Workflow runs page for investigation
- README and run response template updated to reflect new architecture
- ASCII diagram fixed (alignment + 3-stage pipeline)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jeff-schnitter
jeff-schnitter merged commit 0c338c4 into main Aug 13, 2026
3 of 4 checks passed
@jeff-schnitter
jeff-schnitter deleted the cx-harness-deploy-solution branch August 13, 2026 23:36
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.

1 participant