Skip to content

5.9: Hub API integration in harness #61

Description

@savitharaghunathan

5.9: Hub API integration in harness

Part of #46 (Harness → AgentPlaybookRun alignment)

Context

The harness currently receives git credentials via GIT_* env vars injected by the controller. With Hub integration, the harness resolves application metadata, git credentials, and analysis results directly from the Hub REST API at startup. The controller passes HUB_BASE_URL, HUB_TOKEN, and APP_ID — the harness does the rest.

This aligns the harness with the Hub-centric architecture described in ADR-0003 and matches the pattern used by tackle2-addon-kai.

Tasks

  • internal/hub/ package — HTTP client with bearer auth, minimal response types, fetch functions (FetchApp, FetchGitCreds, FetchAnalysis)
  • Hub resolution in main.go startup — resolve app metadata, git creds, and analysis from Hub before clone
  • Write analysis insights to .konveyor/analysis.json in the workspace
  • Credential isolation — hub.ClearEnv() strips HUB_BASE_URL, HUB_TOKEN, APP_ID from env before goose starts
  • TARGET_BRANCH as required env var — Hub's app.Repository.Branch is the source branch, not the push target; controller must set the target
  • Push failure is fatal (exit 1), not a warning
  • CheckoutBranch fix — early return when HEAD already points to the target branch
  • Update hack/harness-test/ resources to use Hub env vars (HUB_BASE_URL, HUB_TOKEN, APP_ID) instead of GIT_* env vars
  • JWT generation in setup.sh for local Hub testing
  • Update ADR-0006 to reflect Hub integration changes
  • Remove dead TestReadFromEnv from git_test.go

Dependencies

References

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status
🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions