harness-deploy: complete solution with entity-scoped workflow and two stage templates - #234
Merged
Merged
Conversation
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>
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.
Summary
cortex_record_deploy+cortex_async_callback), matching the GitHub Actions composite action patternUPDATEprogress callbacks) → Record Deploy in Cortex → Callback to CortexGLOBALtoENTITYscope; renamed to"Solution: Trigger Harness Deploy"org,project,pipeline) stored in entityx-cortex-custom-metadata.harnessand read at runtime — no manual inputs required at trigger timesetup.pywrites custom metadata viaPATCH /api/v1/open-apiafter collecting answersTest plan
cortex solutions install -s harness-deploycompletes cleanlycortex solutions post-install -s harness-deploycreates both stage templates, pipeline, secret, and writes custom metadata🤖 Generated with Claude Code