{"id":14156322,"url":"https://github.com/hofstadter-io/harmony","last_synced_at":"2026-02-11T06:01:59.851Z","repository":{"id":104133306,"uuid":"479840910","full_name":"hofstadter-io/harmony","owner":"hofstadter-io","description":"Easily test downstream projects before releasing new code","archived":false,"fork":false,"pushed_at":"2023-02-22T03:17:11.000Z","size":12,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-23T15:11:44.957Z","etag":null,"topics":["cue","cuelang","dagger","harmony","hofstadter"],"latest_commit_sha":null,"homepage":"","language":"CUE","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hofstadter-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-04-09T20:51:49.000Z","updated_at":"2024-01-16T10:01:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"989c0100-4640-466e-938c-6f962fe382de","html_url":"https://github.com/hofstadter-io/harmony","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hofstadter-io/harmony","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hofstadter-io%2Fharmony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hofstadter-io%2Fharmony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hofstadter-io%2Fharmony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hofstadter-io%2Fharmony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hofstadter-io","download_url":"https://codeload.github.com/hofstadter-io/harmony/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hofstadter-io%2Fharmony/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29327834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T03:52:29.695Z","status":"ssl_error","status_checked_at":"2026-02-11T03:52:23.094Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cue","cuelang","dagger","harmony","hofstadter"],"created_at":"2024-08-17T08:05:22.765Z","updated_at":"2026-02-11T06:01:59.836Z","avatar_url":"https://github.com/hofstadter-io.png","language":"CUE","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"# harmony \n\n`harmony` is a framework for\ntesting a suite of repositories\nacross versions of dependencies.\nDiscover errors and regressions\nin downstream projects before\nreleasing new code.\n`harmony` makes it easy for both developers and users\nto setup and register projects for usage in upstream testing.\n\nBuilt on [Dagger](https://dagger.io), `harmony` provides\n\n- simple setup for developers\n- simple registration for user projects\n- support for any languages or tools \n- consistent environment for testing\n- simplified version injection\n- easily run specific or all cases\n\n_Note, while `harmony` uses Dagger, it is not required for downstream projects._\n\n#### Examples\n\n- [harmony-cue](https://github.com/hofstadter-io/harmony-cue) for testing CUE base projects\n\n## Harmony Setup\n\nTo setup `harmony`, add the following file to your project.\n\n```cue\npackage main\n\nimport (\n  \"dagger.io/dagger\"\n  \"universe.dagger.io/docker\"\n\n  \"github.com/hofstadter-io/harmony\"\n\n  // import your projects registry\n  \"github.com/username/project/registry\"\n)\n\n// A dagger plan is used as the driver for testing\ndagger.#Plan\n\n// add actions from Harmony\nactions: harmony.Harmony\n\n// project specific actions \u0026 configuration\nactions: {\n\n  // global version config for this harmony\n  versions: {\n    go: \"1.18\"\n  }\n\n  // the registry of downstream projects\n  // typically we put this in a subdir and import it\n  \"registry\": registry.Registry\n\n  // the image test cases are run in\n  // typically parametrized so we can change dependencies or versions \n  // (you can also build any image you want here)\n  runner: docker.#Pull \u0026 {\n    source: \"index.docker.io/golang:\\(versions.go)-alpine\"\n  }\n\n  // where downstream project code is checked out\n  workdir: \"/work\" \n}\n```\n\nRun registration cases or a single case with dagger: `dagger do \u003creg\u003e [case]`.\nAny cases found will be run in parallel.\n\nUse `./run.py` to run the full suite of registrations and cases sequentially,\nor as a convenient way to set dependency versions.\n\n#### Registry\n\nYou will typically want to provide a subdirectory\nfor registered projects. You can also provide\nshort codes to simplify user project registration further.\n\nHere we add a `_dagger` short code by\nincluding a `schema.cue` in our `registry/` directory.\n\n```cue\npackage registry\n\nimport (\n  \"strings\"\n\n  \"universe.dagger.io/docker\"\n  \"github.com/hofstadter-io/harmony\"\n)\n\n// customized Registration schema built on harmony's\nRegistration: harmony.Registration \u0026 {\n  // add our short codes \n  cases: [string]: docker.#Run \u0026 {\n    _dagger?: string\n    if _dagger != _|_ {\n      command: {\n        name: \"bash\"\n        args: [\"-c\", _script]\n        _script: \"\"\"\n        dagger version\n        dagger project update\n        dagger do \\(_dagger)\n        \"\"\" \n      }\n    }\n  }\n}\n```\n\nRegistrations then use with `cases: foo: { _dagger: \"foo bar\", workdir: \"/work\" }`\n\n\n## Registration Setup\n\nTo add a new registration for user projects,\nadd a CUE file to the upstream project.\n\n```cue\npackage registry\n\n// Note the 'Registry: \u003cname\u003e: ...` needs to be unique\nRegistry: hof: Registration \u0026 {\n  // \n  remote: \"github.com/hofstadter-io/hof\"\n  ref: \"main\"\n\n  cases: {\n    // these are docker.#Run from Dagger universe\n    cli: { \n      workdir: \"/work\"\n      command: {\n        name: \"go\"\n        args: [\"build\", \"./cmd/hof\"]\n    }\n    flow: { \n      workdir: \"/work\"\n      command: {\n        name: \"go\"\n        args: [\"test\", \"./flow\"]\n    }\n  }\n}\n```\n\n## Base image using dirty code\n\nAs a developer of a project,\nyou may wish to run harmony\nbefore committing your code.\nTo do this, we need to\n\n- mount the local directory into dagger\n- build a runner image from the local code\n- mount the local directory into the runner (possibly)\n\nRefer to [harmony-cue](https://github.com/hofstadter-io/harmony-cue) for an example.\nLook at how \"local\" is used:\n\n- harmony.cue\n- testers/image.cue\n- run.py\n\nThe essence is to use CUE guards (if statements)\n\n---\n\n`harmony` was inspired by the idea\nof creating a [cue-unity](https://github.com/cue-unity/unity)\npowered by [Dagger](https://dagger.io).\nThe goal of `cue-unity` is to collect community projects\nand run them against new CUE language changes.\n`cue-unity` was itself inspired by some work\nRob Pike did on Go, for the same purpose\nof testing downstream projects using Go's stdlib.\n\n`harmony` is more generalized and\nthe CUE specific version is [harmony-cue](https://github.com/hofstadter-io/harmony-cue).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhofstadter-io%2Fharmony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhofstadter-io%2Fharmony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhofstadter-io%2Fharmony/lists"}