Skip to content

fix(platform-link): going live, the toolkit project is the Team Server copy (#765) - #776

Open
MendixMau wants to merge 1 commit into
masterfrom
triage/765-teamserver-going-live
Open

MendixMau wants to merge 1 commit into
masterfrom
triage/765-teamserver-going-live

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

Fixes #765

Direct lane

What changed and why (one paragraph): A greenfield app built with the toolkit went live through a separate Team Server working copy with no .mxtk. Every later change skipped the exec gate, snapshots and BUILD-LOG, and nothing on the toolkit side said so. This implements the triage comment's options 1 + 2, with the deploy check warning only; it never requires a remote.

Option 1 (docs): skills/platform-link.md §3 gets a "Going live: the toolkit project IS the Team Server copy" rule and a six-step Recovering a split-off Team Server copy recipe:

  1. Fetch the Team Server copy in.
  2. Take its model whole: git rm -rq mprcontents, then check it out from the Team Server copy. The mprname/App.mpr trap is noted here.
  3. Run mxcli fix hashes (ContentsHash goes stale after a checkout), then mx check.
  4. Adopt with -X ours and push without force.
  5. Sync the metadata notes with mx-metadata-note.py sync.
  6. Retire the extra copy.

The recipe adds that the model-aware merge path (both sides changed the model) needs mxcli ≥ 0.30 for git merge (#741 research), and points to parallel-builds.md §4–5. One-line pointers go in conversion-runbook.md Stage 6, worded as "every entry mode" because greenfield skips Stage 7, and in deploy-to-sandbox.md Step 1.

Option 2 (warn): bin/status.sh adds two WATCH items:

  • No Team Server remote: at Stage 6/7, it warns when no remote URL contains git.api.mendix.com or teamserver.
  • Commits made outside the toolkit: it warns "Team Server has commits made outside the toolkit" when a fetched Team Server ref is not an ancestor of HEAD and no local branch contains it. The local-branch clause keeps the subtree route's ts-export branch from raising a false alarm.

Both use local git only (git config --get-regexp remote.*.url, for-each-ref, merge-base --is-ancestor): no network and no exit-code change. It reads the project root, plus app/ when that is its own repository (two-tree).

Impact

Row Answer
Process No gate and nothing blocks. Two advisory WATCH items appear on bin/status.sh (brief and full screen) only when they fire. No new artifact.
Dependencies bin/status.sh (adds one block and one WATCH-loop entry); skills/conversion-runbook.md (baseline, one line); skills/platform-link.md and skills/deploy-to-sandbox.md (on demand). The only reads are git config and refs, which exist in any repo, so there is no new producer. Git ≥ 2.7 is needed for for-each-ref --contains. No GNU-only flags; check-portability is clean. Shares bin/status.sh with #767's PR, so the two need a composition check.
Context cost Baseline total 66,196 → 66,217 (+21) of 80,000, from bin/render-routing.sh --check on master and branch. Only the runbook line is baseline. Every stage that loads the runbook gets +21 for lead/ba/architect (for example Stage 6: lead 26,975 → 26,996). Stage 6 mdl/gate/test/review get +21 through the runbook slice (mdl 9,581 → 9,602, gate 21,952 → 21,973). The platform-link.md and deploy-to-sandbox.md additions are on demand. The 21 words are needed at the trigger moment: a Stage 6 session about to deploy is told not to make a second copy.
Behaviour NOT RUN: there is no fixture project with a Team Server remote, and no PAT in this environment. The text change is a pointer plus an on-demand recipe. Maintainer to accept or request A/B.
Runtime 2–4 local git calls per status.sh run: per session, never per exec or build row. About 10 ms measured.

Time cost: per session (status.sh) · ~0.01 s on a Linux container · can force rework: n · offset: maintainer OK

Field evidence: a greenfield build field report (2026-11-13, anonymised in #765) shows the defect: a second Team Server copy with no toolkit. The instrument has not run against a real Team Server project yet (no PAT here). Its inputs are git's own refs and config, which the fixture builds as real git objects in temp repos. The golden input is therefore real git state, not a hand-written parse. The first field run should be cited on the next project that goes live.

Fixture: tests/wave2/test-status-teamserver.sh bin/status.sh. Cases:

  • no remote at Stage 6 → warn
  • Stage 5 → silent
  • ref == HEAD → silent
  • ref ahead of HEAD → warn
  • ref held by a local branch → silent
  • a two-tree app/ remote counts
  • exit 0, and the warning on the full screen

Results:

  • master's bin/status.sh: 7 passed, 3 failed (T1 no-remote warn, T4 ahead warn, T7 full-screen warn)
  • branch: 10 passed, 0 failed

Existing fixtures targeting bin/status.sh, on the branch:

  • test-status-existing-app: 27/27, including the byte-diff
  • test-status-lint-unversioned: 4/4
  • test-status-session-cwd: 10/10
  • test-status-bare-var: 3/3 (T1–T2 SKIP, no ISO-8859-1 locale)

Also clean: bin/check-scripts.sh, bin/check-portability.sh, render-routing.sh --check, and the leak guard.

  • No client data anywhere in the diff
  • Size cap: 6 files, 173 insertions / 1 deletion (fixture and CHANGELOG included)
  • Test tier reached: T1 (scoped fixture on real temp git repos; both layouts covered by T6). Not run on macOS or Git Bash. check-portability is clean, and the code uses POSIX awk/grep/sed and only the git plumbing listed above.
  • For a new/changed instrument: golden input is real git state, not hand-written parsed output. Both layouts: yes (T6). Both platforms: considered, not executed.
  • For a new skill: n/a
  • CHANGELOG.md line appended under ## Unreleased, crediting the greenfield field run of 2026-11-13
  • New bug entries: n/a

Review: pending independent review


Generated by Claude Code

…r copy (#765)

An app built with the toolkit went live through a separate Team Server
working copy with no .mxtk, so later changes skipped the exec gate,
snapshots and BUILD-LOG unnoticed.

- skills/platform-link.md §3: the "going live" rule plus a six-step
  recovery for a copy that already split off (mprname trap, ContentsHash,
  model-aware merge needs mxcli >= 0.30).
- One-line pointers from conversion-runbook Stage 6 and deploy-to-sandbox.
- bin/status.sh: WATCH (local git only, exit code unchanged) at Stage 6+
  with no Team Server remote, and when a fetched Team Server ref is in no
  local branch.
- tests/wave2/test-status-teamserver.sh: master 7/10, branch 10/10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXpQSjXefSNicGGqP4aiSC
@MendixMau

Copy link
Copy Markdown
Owner Author

Review: MERGE. It implements #765 options 1 + 2 as triaged: warn-only, using local git only. One minor point: a Stage 6/7 project that deliberately deploys outside Team Server gets a permanent "no Team Server remote" WATCH with no way to silence it. That is advisory, so it does not block.

Value:

  • The rule is at skills/platform-link.md:309-315, and the six-step recovery at :425-454.
  • The recovery's references check out:
    • traps 6(b)/6(c) exist (:165, :195);
    • the mxcli fix hashes --repair row is at :536;
    • project-bin/mx-metadata-note.py exists;
    • mxcli ≥ 0.30 for git merge matches parallel-builds.md:42.
  • Pointers: conversion-runbook.md:675 (Stage 6, "every entry mode") and deploy-to-sandbox.md Step 1.
  • The WATCH is at bin/status.sh:306-335.
  • Option 3 is parked, as recommended. Not overbuilt.

Regression risk:

  • No verdict or exit-code change (T7 asserts exit 0).
  • After sync, existing Stage 6/7 projects with only a GitHub remote, or no remote, will see a new WATCH. That is the intent.
  • The second WATCH fires for any fetched Team Server branch that no local branch holds, which includes teammates' Studio Pro branches. The wording ("in no local branch") is accurate.
  • Two-tree: app/ is read only when it has its own .git; the -e test covers submodules too.
  • bash 3.2: no arrays and no GNU flags. for-each-ref --contains needs git ≥ 2.7.

Correctness: No bugs found.

  • _cur (:330) duplicates CUR_STAGE (:220), which is only set inside a case. Harmless.
  • The fixture builds real git objects and uses the real init-project.sh scaffold, so its input is not hand-written.
  • Run in a detached worktree: test-status-teamserver 10/0, existing-app 27/27, lint-unversioned 4/0, session-cwd 10/0, bare-var 3/0.
  • Recipe step 4 says "git diff --stat HEAD^1 HEAD must print nothing". That holds only if step 2 checked out every folder Team Server holds, and step 2 says so ("whatever model folders it holds").

Context cost: 66196 → 66217 always-loaded words (+21, measured). It is the runbook's Stage 6 line, read at the deploy moment.

Time cost: per status.sh session, 2–4 local git calls plus 1–2 per Team Server ref, which takes milliseconds. Nothing per build row.

Conflicts: none with origin/master. It conflicts with #777 in bin/status.sh's WATCH loop and in CHANGELOG. Both are trivial: keep both additions. Composition check on the merged tree: test-status-teamserver 10/0, test-stage-header 21/0, test-change-log 57/0, all test-status-*.sh green. Whichever of #776 and #777 merges second rebases and keeps both lines.


Generated by Claude Code

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.

[bug] Team Server working copy has no toolkit: changes made there skip the exec gate, snapshots and build log

2 participants