Commit Graph
23 Commits
Author SHA1 Message Date
Benjamin LabrecqueandClaude Opus 5 cfd3ecad6c refactor: centralize deploy-time substitutions (steps 1-2)
Deploy-time placeholders were spread across four independent
implementations: sed in the Gitea deploy script, ansible.builtin.replace
in two playbooks, a hardcoded suffix in bin/sls_hla_launch_gui.sh, and
another in agebd/pv.py. Each defined its own values, so nothing kept them
in sync and a missed substitution failed silently.

Step 1 -- one source of truth:

  * config/environments.yml declares every deploy-time token, its value
    per environment, and where tokens are allowed to live. An environment
    that is missing a token, or defines an undeclared one, is a load-time
    error.
  * agebd.subs loads it and renders. Rendering is a strict regex over
    declared token names rather than a template engine: the rendered
    files are EPICS db/substitution files and Qt XML, and an unknown
    token must raise rather than survive into the output.
  * scripts/ci/check_subs.py enforces the contract in CI: tokens in a
    rendered path are declared, declared tokens only appear where they
    are rendered or generated, and no pre-migration delimiters survive.

Step 2 -- separate the two substitution stages by delimiter:

  * Creation-time (copier, once per new service) keeps {{ token }}.
    Deploy-time (every deploy, per environment) becomes @@token@@.
  * This drops the {{ '{{ token }}' }} escaping from templates/, which
    existed only because one Jinja pass had to emit syntax for a second.
  * Angle brackets were tried first and rejected: << >> is not
    well-formed XML, and cli parses qt/*.ui with ElementTree.
  * The existing sed and ansible consumers are repointed at the new
    delimiters so this stays behaviour-preserving. Routing them through
    agebd.subs is step 3.

Also fixes, as a side effect of having one implementation:

  * The sed pattern '{{ *agebd_env_suffix_upper* }}' quantified 'r'
    rather than the space, so it only matched one exact spacing.
  * agebd.subs.read_ioc_port compares service names case-insensitively;
    ansible/tasks/utils/get-ioc-port.yml still compares CamelCase
    registry names against a lowercase input and never matches.

qt/*.ui is declared as a render path but nothing renders it yet -- the
Qt deploy step is still a plain rsync. Wiring that up is step 4.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 11:26:49 +02:00
Benjamin Labrecque da4836ac0a fix: DBPM3Current -> DBPM3Curr
Deploy / deploy (push) Successful in 7s
2026-08-05 16:45:17 +02:00
labrec_bandBenjamin Labrecque 1933b906de Feature/cli add service gui creation options (#12)
Deploy / deploy (push) Successful in 8s
Add option to use the GUI of an existing service when creating new services

---------

Co-authored-by: Benjamin Labrecque <labrecque.benji@gmail.com>
Reviewed-on: #12
2026-07-28 16:39:01 +02:00
Benjamin Labrecque 355957455a chore: fix optics camel case names in services registry 2026-07-28 11:21:34 +02:00
Benjamin Labrecque e42f162c26 chore: use camelcase name in gui 2026-07-28 09:45:48 +02:00
Benjamin Labrecque b9cbca2c3c registry: set services to inactive 2026-07-23 16:02:09 +02:00
Benjamin Labrecque 1b3825bfe2 fix: config files 2026-07-22 13:09:20 +02:00
Benjamin Labrecque 63f682c058 fix: test cli add service
Deploy / deploy (push) Canceled after 0s
2026-07-22 12:25:02 +02:00
Benjamin Labrecque cd09c99306 cli: add ioc *-all commands 2026-07-17 09:25:33 +02:00
Benjamin Labrecque a99b1efa98 chore: add all services to registry 2026-07-16 08:39:59 +02:00
labrec_bandBenjamin Labrecque e6938646f1 Feature/add service dbpm3curr (#3)
Add new service dbpm3curr

---------

Co-authored-by: Benjamin Labrecque <labrecque.benji@gmail.com>
Reviewed-on: #3
2026-07-14 11:39:58 +02:00
labrec_bandBenjamin Labrecque 13abb68f96 Feature/add service nturns (#2)
Migrate NTURNS

---------

Co-authored-by: Benjamin Labrecque <labrecque.benji@gmail.com>
Reviewed-on: #2
2026-07-14 09:35:10 +02:00
labrec_bandBenjamin Labrecque 2194f65fe7 Feature/ui (#1)
Deploy bin / deploy (push) Successful in 1s
Deploy agebd python package / deploy (push) Successful in 3s
- Add ServiceManager.ui
- Update ServiceManager.ui when adding a new service
- Better git error handling (clean abort if remote branch already exists)

---------

Co-authored-by: Benjamin Labrecque <labrecque.benji@gmail.com>
Reviewed-on: #1
2026-07-09 15:06:13 +02:00
Benjamin Labrecque debac0cf5e refactor: remove service id altogether
Deploy bin / deploy (push) Successful in 2s
Deploy agebd python package / deploy (push) Successful in 4s
2026-07-08 16:47:42 +02:00
Benjamin Labrecque af2ed89667 fix: use str in service registry id
Deploy bin / deploy (push) Successful in 4s
Deploy agebd python package / deploy (push) Successful in 3s
2026-07-08 14:43:51 +02:00
Benjamin Labrecque 6960b10ce0 feature: dynamicallt allocate port and save in service registry. Update iocs overview on service creation
Deploy bin / deploy (push) Successful in 5s
Deploy agebd python package / deploy (push) Successful in 2s
2026-07-08 14:40:18 +02:00
Benjamin Labrecque b8784e8f6a chore: format config files
Deploy bin / deploy (push) Successful in 2s
Deploy, build and restart MASTER / deploy (push) Successful in 10s
Deploy agebd python package / deploy (push) Successful in 3s
2026-07-07 11:38:50 +02:00
Benjamin Labrecque 3618906f40 fix: template brackets
Deploy bin / deploy (push) Successful in 3s
Deploy service MASTER / deploy (push) Failing after 6s
2026-07-06 12:27:15 +02:00
Benjamin Labrecque 469e2a9eab chore: better git handling
Deploy bin / deploy (push) Canceled after 0s
Deploy service MASTER / deploy (push) Canceled after 0s
2026-07-03 15:20:55 +02:00
Benjamin Labrecque 09edcf53a2 chore: fix templating
Deploy bin / deploy (push) Canceled after 0s
Deploy service MASTER / deploy (push) Canceled after 0s
2026-07-03 15:02:08 +02:00
Benjamin Labrecque c7604359a9 feature: add new service template files rendering
Deploy bin / deploy (push) Canceled after 0s
Deploy service MASTER / deploy (push) Canceled after 0s
2026-07-03 14:06:25 +02:00
Benjamin Labrecque dfc19768fa chore: add cli tool -- init skeleton 2026-07-03 13:12:41 +02:00
Benjamin Labrecque c65a6e1728 chore: add cli skeleton and create config dir
Deploy bin / deploy (push) Canceled after 0s
Deploy service MASTER / deploy (push) Canceled after 0s
2026-07-03 08:25:56 +02:00