Skip to content

Relocate infra to $CODE/infra; keep $CODE as the workspace root#54

Open
krystophny wants to merge 6 commits into
mainfrom
chore/relocate-infra
Open

Relocate infra to $CODE/infra; keep $CODE as the workspace root#54
krystophny wants to merge 6 commits into
mainfrom
chore/relocate-infra

Conversation

@krystophny
Copy link
Copy Markdown
Member

@krystophny krystophny commented May 28, 2026

What

Make this repository the infra directory of a workspace instead of the
workspace root, and retire the umbrella integration CI that never passed.

$CODE/            workspace root (no .git, no pollution)
  infra/          this repo            -> $INFRA
  external/       prebuilt third-party libs, shared by all codes
  libneo/ SIMPLE/  code checkouts (own .git)
  • activate.sh/.fish export INFRA=$CODE/infra and derive CODE as its
    parent. Infra-private paths (scripts, .venv, modules) move to $INFRA.
  • $CODE stays the workspace root, so the codes keep resolving dependencies as
    $CODE/<name> (find_or_fetch) and prebuilt libraries as $CODE/external.
  • The two accidental gitlinks (SIMPLE, libneo) are dropped.
  • main.yml is removed. It built the unpinned tips of six code repos in one
    sequential job and never went green (0 of 94 runs). The replacement model is
    in docs/development-model.md: per-code CI at the source plus release-time
    reverse-dependency validation owned by the upstream.

Migration for users

Move your checkout one level down and repoint the activation line:

mkdir ~/code.new && mv ~/code ~/code.new/infra && mv ~/code.new ~/code
# move the sibling checkouts (libneo, SIMPLE, ...) and external/ up next to infra
# then in ~/.bashrc: source $HOME/code/infra/activate.sh

Verification

New activation resolves correctly. Simulated workspace with infra at <ws>/infra
and a libneo/ sibling:

INFRA = /tmp/ws/infra
CODE  = /tmp/ws
venv  = /tmp/ws/infra/.venv
INFRA/scripts on PATH: yes
CODE/libneo/build on lib path: yes
find_or_fetch contract [ -d $CODE/libneo ]: PASS

Before/after on the dependency-resolution contract, with infra at <ws>/infra:

BEFORE: CODE=<ws>/infra -> $CODE/libneo = <ws>/infra/libneo -> absent, refetched
AFTER : CODE=<ws>       -> $CODE/libneo = <ws>/libneo       -> present, local

Verified locally on macOS: variable resolution, venv activation, PATH and
library-path entries, set_branch. CI is no longer the umbrella build; that
workflow is removed rather than fixed.

Note

docs/development-model.md is proposed, not settled. It documents the layout,
the <DEP>_BRANCH convention, the release-branch flow, and YY.MINOR.PATCH
versioning for group discussion. setup.yml (the release-tarball builder) is
left in place but loses its only consumer with main.yml gone, so it needs a
separate decision.

The repository was the workspace root, so its .git tracked every sibling code
checkout as untracked noise and carried two accidental gitlinks (SIMPLE,
libneo) with no .gitmodules. Make it the infra directory of a workspace.

activate.sh, activate.fish and activate export INFRA (this repo) and derive
CODE as its parent. Infra-owned paths (scripts, .venv, external, modules,
images, local, lib, bin) move to $INFRA. $CODE stays the workspace root, so
the codes keep resolving dependencies as $CODE/<name> via find_or_fetch.
Sibling references ($CODE/libneo/build) and workspace navigation (cdcode,
vscode) stay on $CODE; set_branch reads the infra repo via $INFRA.

Drop the accidental SIMPLE and libneo gitlinks. Update setup.sh, the
devcontainer build and postCreateCommand.sh, the release CI in main.yml, the
STELLOPT and VMEC config paths, and the README to the new layout.
main.yml downloaded a pinned release tarball whose frozen activate.sh predates
the infra relocation, so $INFRA was unset and $INFRA/scripts/checkout_branch.sh
resolved to /scripts/... (exit 127). Check out the branch and rsync its
sources over the tarball, keeping the release's prebuilt .venv and external,
and relocate the venv shebangs to the new path.
activate.sh is meant for interactive shells; its add_to_path/add_to_library_path
helpers return the guard status, so under the runner's bash -e the first absent
dir ($INFRA/local/bin) aborted the step before the venv activated. Wrap the
source in set +e/set -e so activation completes while build commands stay strict.
The codes read prebuilt third-party libs from $CODE/external (e.g. NEO-2's
build links $CODE/external/fgsl-1.6.0/.libs/libfgsl.a). external is workspace-
shared like the code checkouts, not infra-private, so revert it from $INFRA to
$CODE and stop tracking it in the infra repo. setup.sh creates it; CI moves the
release's external to the workspace; CODE_ROOT (STELLOPT make configs) points at
$CODE. setup.yml release packaging flagged for tag-time validation.
@krystophny krystophny force-pushed the chore/relocate-infra branch from 9be1ed9 to a14b19c Compare May 28, 2026 19:38
main.yml built every downstream code on each push to infra and never passed
(0 of 94 runs): it built the unpinned tips of six repos in one sequential job
against a frozen release tarball. Remove it.

Add docs/development-model.md (proposed): workspace layout, the self-describing
dependency graph, the per-code + release-time reverse-dependency testing model,
the <DEP>_BRANCH convention, the release-branch flow, and YY.MINOR.PATCH
versioning. The genuine external -> $CODE fix from earlier commits stays; the
umbrella build it was chasing is gone.
docs/templates/downstream-integration.yml: per-consumer reverse-dep validation,
dispatched with a libneo ref, no commit. docs/templates/upstream-release.yml:
libneo release-branch + gate + bump-PR skeleton (untested, TODOs marked).
Referenced by the development-model design note.
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