@gapi/gcli 1.8.277 → 1.8.278

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.
@@ -0,0 +1,18 @@
1
+ ## 2026-11-20 - time-triggers-yaml: lambda create and update apply triggers.time
2
+
3
+ **Feature:** time-triggers-yaml · **Type:** feat
4
+
5
+ - `lambda:create` / `lambda:update` now apply `triggers.time` of
6
+ lambforge.yaml: create the time trigger, keep it when name + cron match,
7
+ replace it when they differ (one per lambda). No block = no change. The
8
+ `triggers` block used to be dropped with everything outside `function`.
9
+ - **Test:** `npx jest test/time-trigger-yaml.spec.ts` (4 cases: no block,
10
+ create, same, replace on name or cron).
11
+ - **Debug:** the deploy prints `Time trigger ... created / is up to date /
12
+ replaced by ...`; a failure prints `triggers.time was not applied`.
13
+ - **Verification:** local build `lambda:update` on graphql-server-functions
14
+ `platform-tick` (2026-11-20): "Time trigger platform-tick-every-10m
15
+ (*/10 * * * *) is up to date", trigger unchanged in production. All 12
16
+ packages with `triggers.time` compared with production first: log-retention
17
+ (`@daily` vs `0 3 * * *`) and workspace-gc (no trigger yet) fixed in their
18
+ yaml so nothing is replaced or created by surprise.
@@ -44,3 +44,4 @@ Outline (drop sections that don't apply):
44
44
  | `lambda-site-url` | [lambda-site-url.md](lambda-site-url.md) | Slice (canonical: graphql-server-lambdas): `Site:` line after create/update |
45
45
  | `lambda-spread` | [lambda-spread.md](lambda-spread.md) | Slice (canonical: graphql-server-lambdas): replicas across machines (plan 33): `--spread` / `--spreadStrict`, yaml keys |
46
46
  | `mq-triggers-yaml` | [mq-triggers-yaml.md](mq-triggers-yaml.md) | `queue:declare`, `mq-trigger:apply`, `queues:` / `triggers.mq` in `lambforge.yaml` (plan 34) |
47
+ | [time-triggers-yaml](time-triggers-yaml.md) | lambda:create / lambda:update apply `triggers.time` (create / keep / replace the one time trigger) |
@@ -0,0 +1,30 @@
1
+ # Time triggers from lambforge.yaml
2
+
3
+ `gcli lambda:create` and `gcli lambda:update` apply the `triggers.time`
4
+ block of lambforge.yaml after the lambda is saved
5
+ (`src/commands/lambda/helpers/time-trigger-sync.ts`):
6
+
7
+ ```yaml
8
+ triggers:
9
+ time:
10
+ triggerName: every-10m
11
+ cron: '*/10 * * * *'
12
+ ```
13
+
14
+ | The lambda has | Result |
15
+ |---|---|
16
+ | no time trigger | created (`<lambda>-<triggerName>`) |
17
+ | one with the same name and cron | kept ("is up to date") |
18
+ | one with another name or cron | replaced (deleted, then created) - the platform allows ONE time trigger per lambda |
19
+ | (file has no `triggers.time`) | nothing - a deploy never deletes a trigger the file does not mention |
20
+
21
+ The stored name is `<lambda>-<triggerName>`; older triggers stored without
22
+ the prefix also count as the same name. A failure is printed
23
+ ("triggers.time was not applied: ... - run gcli cron:create") and never
24
+ fails the deploy. `gcli cron:create` / `cron:delete` still work by hand.
25
+
26
+ - **Test:** `npx jest test/time-trigger-yaml.spec.ts`.
27
+ - **Debug:** the deploy prints `Time trigger <name> (<cron>) created /
28
+ is up to date / replaced by ...`; compare with `gcli cron:list`.
29
+ - **History:** until 1.8.277 the block was ignored (found 2026-11-19 -
30
+ `workspace-gc` declared `@weekly` and never had a trigger).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gapi/gcli",
3
- "version": "1.8.277",
3
+ "version": "1.8.278",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/Stradivario/gapi.git"