feat: discover environments from remote deployment repos#6
Open
hisco wants to merge 3 commits into
Open
Conversation
For services with deploymentRepo, environments are now discovered by
cloning the deployment repo and listing overlay directories, with env
details read from skyhook/environments/{name}.yaml files. Services
without deploymentRepo continue using the local environments[] array.
- Add src/deployment/repo-fetcher.js for clone, overlay listing, and
env config reading with per-repo:branch clone cache and per-env
config cache to prevent collisions
- Support per-service environments in matrix builder
- Token fallback: tries explicit github-token input, then GITHUB_TOKEN
env var, with retry on auth failure
- Default to remote HEAD when branch input is not specified
- Rewrite README to document both Skyhook and Koala config formats
autoDeploy is now part of the environment schema (both local skyhook.yaml environments[] and remote skyhook/environments/*.yaml). Defaults to false when not specified.
- SkyhookEnvironment constructor: true, "true", false, undefined - Local matrix builder: autoDeploy true/false reflected in auto_deploy - Remote readEnvironmentConfig: autoDeploy read from YAML, defaults false - Missing env YAML: autoDeploy defaults false
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
deploymentReponow discover their environments from the remote deployment repo (clone → listoverlays/dirs → readskyhook/environments/{name}.yaml) instead of requiring a localenvironments[]arraydeploymentRepocontinue using local environments as beforegithub-tokeninput first, falls back toGITHUB_TOKENenv var, with retry across tokens on auth failuremain)autoDeployadded to the environment schema (defaults tofalse)Environment schema change
autoDeployis now part of the environment configuration, both in localskyhook.yamland remoteskyhook/environments/{name}.yamlfiles. It controls theauto_deployfield in the matrix output. Defaults tofalsewhen not specified.Local (
skyhook.yaml):Remote (
skyhook/environments/dev.yaml):Previously
auto_deploywas hardcoded to"true"for all matrix entries.Key changes
src/deployment/repo-fetcher.jsrepo:branch), overlay listing, env config reading with cache (repo:branch:envName)src/index.jsresolveTokens(), branch defaults to emptysrc/matrix/matrix-builder.jsperServiceEnvsmap; readautoDeployfrom env instead of hardcodingsrc/config/SkyhookConfig.jsautoDeploytoSkyhookEnvironment(accepts bool/string, defaultsfalse)action.ymlmaindefault forbranchinputtests/skyhook.test.jsREADME.mdTest plan
npm test)git cloneomits--branch(uses HEAD)autoDeploy: true/false/"true"/undefined all handled correctly in constructorautoDeploy: local path — matrix entries reflect env settingautoDeploy: remote path — read from YAML, defaults false when missing