devzone 7.1.1 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/.devcontainer/Dockerfile +14 -14
  2. package/.devcontainer/ai/host-check.message +12 -12
  3. package/.devcontainer/ai/host-check.sh +1 -1
  4. package/.devcontainer/catalog/catalog-watcher.sh +7 -7
  5. package/.devcontainer/catalog.sh +1 -1
  6. package/.devcontainer/devzone +2 -14
  7. package/.devcontainer/devzone-ai.sh +1 -1
  8. package/.devcontainer/devzone-cluster.sh +1 -2
  9. package/.devcontainer/devzone-repair.sh +3 -3
  10. package/.devcontainer/devzone-services.sh +2 -2
  11. package/.devcontainer/gitlab/demo/.gitlab-ci.yml +1 -1
  12. package/.devcontainer/help.sh +0 -1
  13. package/.devcontainer/packages.sh +1 -1
  14. package/.devcontainer/password.sh +5 -6
  15. package/.devcontainer/ports.sh +1 -1
  16. package/.devcontainer/services-admin.sh +2 -2
  17. package/.devcontainer/workspace-init.sh +0 -7
  18. package/Makefile +3 -3
  19. package/README.md +1 -13
  20. package/bin/SHA256SUMS +6 -6
  21. package/bin/devzone-darwin-amd64 +0 -0
  22. package/bin/devzone-darwin-arm64 +0 -0
  23. package/bin/devzone-linux-amd64 +0 -0
  24. package/bin/devzone-linux-arm64 +0 -0
  25. package/bin/devzone-windows-amd64.exe +0 -0
  26. package/bin/devzone-windows-arm64.exe +0 -0
  27. package/manage/devzone +3 -16
  28. package/manage/scripts/ci/check-names.sh +5 -6
  29. package/manage/scripts/ci/ticket-protocol.txt +7 -0
  30. package/manage/scripts/ci/versions-tools-plan.sh +1 -1
  31. package/manage/scripts/devzone-create.sh +4 -4
  32. package/manage/scripts/devzone-update.sh +18 -22
  33. package/manage/scripts/workspace/argocd-services.sh +1 -1
  34. package/manage/scripts/workspace/argocd-workspace.sh +2 -2
  35. package/manage/scripts/workspace/ports-workspace.sh +5 -5
  36. package/manage/scripts/workspace/services-workspace.sh +3 -3
  37. package/manage/scripts/workspace/workspace-update.sh +0 -3
  38. package/manage/workspace.sh +0 -14
  39. package/package.json +1 -1
  40. package/.devcontainer/command-aliases.sh +0 -234
  41. package/.devcontainer/rename-legacy-files.sh +0 -172
  42. package/.devcontainer/rename-legacy-ports.sh +0 -119
  43. package/manage/scripts/ci/check-english.sh +0 -57
@@ -1,119 +0,0 @@
1
- #!/usr/bin/env bash
2
- # shellcheck shell=bash
3
- # Migration of the names of the port watcher, of the locks and of the state files
4
- # of the port automation (#774, lot 5). Sourced by rename-legacy-files.sh, which
5
- # defines ROOT, TMP_DIR, is_real_dir and rename_legacy: never run alone. bash 3.2.
6
- #
7
- # Rule for a lock: a lock held by a live process is never moved or removed, it
8
- # is reported on stderr and the next run migrates it once its holder has gone.
9
-
10
- # pid_alive PID: true when PID is a live process
11
- pid_alive() {
12
- [ -n "${1:-}" ] && kill -0 "$1" 2>/dev/null
13
- }
14
-
15
- # lock_held DIR: true when the lock folder DIR names a live process in DIR/pid
16
- lock_held() {
17
- pid_alive "$(cat "$1/pid" 2>/dev/null || true)"
18
- }
19
-
20
- # migrate_lock OLD NEW: the lock folder OLD becomes NEW, unless a live process
21
- # holds it
22
- migrate_lock() {
23
- [ -e "$1" ] || [ -L "$1" ] || return 0
24
- if lock_held "$1"; then
25
- echo "devzone : $1 kept: held by a live process" >&2
26
- return 0
27
- fi
28
- rename_legacy "$1" "$2"
29
- }
30
-
31
- # is_watcher PID: true when PID is a live port watcher (its command line names
32
- # ports-workspace.sh, or is "workspace ports loop" of the Go watcher), so a pid
33
- # file left by a dead watcher never makes us signal an unrelated process that
34
- # reuses the number
35
- is_watcher() {
36
- [ -n "${1:-}" ] || return 1
37
- kill -0 "$1" 2>/dev/null || return 1
38
- ps -p "$1" -o command= 2>/dev/null | grep -Eq 'ports-workspace\.sh|workspace ports loop'
39
- }
40
-
41
- # Folders of the workstation port watcher (#774, lots 4 and 5): relais/ becomes
42
- # relays/, pris/ taken/, verrou lock and plafond cap. A watcher that is running
43
- # keeps the old folders and creates them again at each round, so it is stopped
44
- # first: SIGTERM, and its own handler removes its relays, its lock and its pid.
45
- # It is not restarted here (the files of the package are replaced after this
46
- # script): the file restart is left in its folder as the signal that this
47
- # migration, not the user, stopped it; devzone update starts it again once the
48
- # files are replaced, and a start or a stop by the user removes the signal. If
49
- # it does not stop within 2 s, nothing is renamed.
50
- migrate_ports() {
51
- local d="$ROOT/.devzone.workspace-ports" pid old n
52
- is_real_dir "$d" || return 0
53
- old=""
54
- for n in relais pris verrou plafond; do
55
- if [ -e "$d/$n" ] || [ -L "$d/$n" ]; then old=1; fi
56
- done
57
- [ -n "$old" ] || return 0
58
- pid="$(cat "$d/pid" 2>/dev/null || true)"
59
- if is_watcher "$pid"; then
60
- kill "$pid" 2>/dev/null || true
61
- for _ in 1 2 3 4 5 6 7 8 9 10; do
62
- is_watcher "$pid" || break
63
- sleep 0.2
64
- done
65
- if is_watcher "$pid"; then
66
- echo "devzone : port watcher (pid $pid) still running, $d folders kept under their old names" >&2
67
- return 0
68
- fi
69
- : >"$d/restart"
70
- echo "devzone : port watcher stopped to rename its folders, restart it: devzone workspace ports start"
71
- fi
72
- rename_legacy "$d/relais" "$d/relays"
73
- rename_legacy "$d/pris" "$d/taken"
74
- rename_legacy "$d/verrou" "$d/lock"
75
- rename_legacy "$d/plafond" "$d/cap"
76
- }
77
-
78
- # State of the port automation of the pod, one folder per instance in
79
- # $DEVZONE_PORTS_AUTO_DIR (default: devzone-ports-auto of the temporary folder):
80
- # verrou lock, occupes busy, actifs active, courant current. An instance whose
81
- # lock is held by a live watcher is left whole: its files are in use.
82
- migrate_ports_auto() {
83
- local base="${DEVZONE_PORTS_AUTO_DIR:-$TMP_DIR/devzone-ports-auto}" d
84
- for d in "$base"/*; do
85
- is_real_dir "$d" || continue
86
- if lock_held "$d/verrou"; then
87
- echo "devzone : $d kept: its watcher is running" >&2
88
- continue
89
- fi
90
- rename_legacy "$d/verrou" "$d/lock"
91
- rename_legacy "$d/occupes" "$d/busy"
92
- rename_legacy "$d/actifs" "$d/active"
93
- rename_legacy "$d/courant" "$d/current"
94
- done
95
- }
96
-
97
- # Locks of the agent (state folder of devzone agent) and of the catalog watcher
98
- migrate_agent_locks() {
99
- migrate_lock "${DEVZONE_AGENT_STATE:-${HOME:-/nonexistent}/.local/state/oc-lancer}/verrou" \
100
- "${DEVZONE_AGENT_STATE:-${HOME:-/nonexistent}/.local/state/oc-lancer}/lock"
101
- migrate_lock "$ROOT/.devzone.catalog-watcher/verrou" "$ROOT/.devzone.catalog-watcher/lock"
102
- }
103
-
104
- # Write lock of the state file: the folder .devzone.modules.verrou became
105
- # .devzone.modules.lockdir. It is a transient mkdir lock without pid: it is
106
- # not renamed, the old one is removed once it is older than 30 s, which is the
107
- # age after which state-lock.sh itself takes a lock for abandoned. A younger
108
- # one may belong to a write in progress: it is left for the next run.
109
- migrate_state_lock() {
110
- local old="$ROOT/.devzone.modules.verrou" t
111
- is_real_dir "$old" || return 0
112
- t="$(stat -c %Y "$old" 2>/dev/null || stat -f %m "$old" 2>/dev/null || true)"
113
- [ -n "$t" ] && [ "$(($(date +%s) - t))" -gt 30 ] || return 0
114
- if rm -rf -- "$old"; then
115
- echo "devzone : $old removed (abandoned write lock, now .devzone.modules.lockdir)"
116
- else
117
- echo "devzone : $old not removed" >&2
118
- fi
119
- }
@@ -1,57 +0,0 @@
1
- #!/usr/bin/env bash
2
- # CI check: the files listed in .english must be written in English (#502).
3
- # A file fails when one of its lines contains a French accented letter or one
4
- # of the frequent French words, whole word, case-insensitive. Each fault is
5
- # printed as "path:line: text" and the run exits 1; otherwise it prints
6
- # "english check: N files ok" and exits 0. A listed file that is missing is
7
- # an error too.
8
-
9
- set -u
10
-
11
- ICI="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
- ROOT="$(cd "$ICI/../../.." && pwd)"
13
- LIST="$ROOT/.english"
14
-
15
- # Byte escapes and split fragments, so this file never matches its own rules
16
- # (a literal accented letter or whole word here would be reported).
17
- ACCENTS="$(printf '[\303\305][\200\202\204\206\207\210\211\212\213\216\217\222\223\224\226\231\233\234\240\242\244\246\247\250\251\252\253\256\257\264\266\270\271\273\274\277]')"
18
- WORDS="$(printf 'le_s|de_s|un_e|po_ur|av_ec|sa_ns|da_ns|fich_ier|doss_ier' | tr -d '_')"
19
- PATTERN="$ACCENTS|\\b($WORDS)\\b"
20
-
21
- # Byte matching only: the accents are matched as UTF-8 byte sequences
22
- LC_ALL=C
23
- export LC_ALL
24
-
25
- if [ ! -f "$LIST" ]; then
26
- echo "check-english: list not found: $LIST" >&2
27
- exit 1
28
- fi
29
-
30
- fails=0
31
- count=0
32
- while IFS= read -r f; do
33
- case "$f" in
34
- '' | '#'*) continue ;;
35
- esac
36
- file="$ROOT/$f"
37
- if [ ! -f "$file" ]; then
38
- echo "check-english: file listed but missing: $f" >&2
39
- fails=1
40
- continue
41
- fi
42
- count=$((count + 1))
43
- matches="$(grep -Ein -- "$PATTERN" "$file")" || matches=""
44
- while IFS= read -r m; do
45
- [ -n "$m" ] || continue
46
- n="${m%%:*}"
47
- printf '%s:%s: %s\n' "$f" "$n" "${m#*:}"
48
- fails=1
49
- done <<EOF
50
- $matches
51
- EOF
52
- done <"$LIST"
53
-
54
- if [ "$fails" -ne 0 ]; then
55
- exit 1
56
- fi
57
- echo "english check: $count files ok"