@vzn/vx-ci 0.0.644 → 0.0.645

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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 vx contributors
3
+ Copyright (c) 2026 VZN
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -50,7 +50,7 @@ github({
50
50
  title: 'build & test', // default: 'vx run'
51
51
  checks: true, // default: on with GITHUB_TOKEN; true warns when it is missing, false opts out
52
52
  checkName: 'ci', // default: 'vx', the check run's name
53
- cacheScope: false, // default: on; scope remote cache writes by ref
53
+ cacheScope: false, // default: on; scope plugin cache entries by ref
54
54
  })
55
55
  ```
56
56
 
@@ -59,26 +59,19 @@ github({
59
59
  On Actions (`GITHUB_ACTIONS=true`) the plugin's `config` stage names the
60
60
  run's branch through `ctx.setBranch`, from the ref (`GITHUB_REF`,
61
61
  `GITHUB_REF_NAME`, `GITHUB_HEAD_REF`, `GITHUB_REPOSITORY`) and the
62
- `GITHUB_EVENT_PATH` payload. A push to the default branch names no scope (reads and writes
63
- the default keys). A push to, or a pull request from, a branch names
62
+ `GITHUB_EVENT_PATH` payload. A push to the default branch names no scope.
63
+ A push to, or a pull request from, a branch names
64
64
  `<owner>/<repo>:<branch>` of the repository the branch lives in, so a
65
65
  fork's pull request names the fork; so does a `pull_request_target` or
66
66
  `workflow_run` run on a PR's behalf (by `GITHUB_EVENT_NAME`, though its
67
67
  ref is main's), and an `issue_comment` on a PR, which names no branch,
68
68
  `pr-<n>`. A merge queue's run (`merge_group`) is trusted: no scope,
69
- whatever its `gh-readonly-queue/...` branch, so it reads and writes only
70
- the default keys (`x-vx-cache-scope: trusted`), compared with
69
+ whatever its `gh-readonly-queue/...` branch, compared with
71
70
  `merge_group.base_sha`. A pull request also names its base commit
72
- (`pull_request.base.sha`), so vx diffs the merge checkout from it with
73
- no git call. A scoped run's changed tasks read the scope's remote entry,
74
- the rest the default keys, and every task it builds is saved to the
75
- remote under the scope; the local cache never knows a scope. A
76
- PR never writes what main reads, and a laptop on the branch derives the
77
- same scope. Whether a run writes at all is `cache.policy`'s call.
78
- `VX_CACHE_SCOPE` overrides it. This is a client-side convention: the
79
- real boundary is a cache token the server limits, so give PR jobs one
80
- that cannot write the default keys (`docs/security.md` § Cache
81
- poisoning).
71
+ (`pull_request.base.sha`), the base of a bare `--affected`. The scope
72
+ keys only what plugins store themselves (`ctx.cache`, run records):
73
+ task keys never carry it, and the cache server decides from the CI OIDC
74
+ token where a task's entry lands. `VX_CACHE_SCOPE` overrides it.
82
75
 
83
76
  ## GitLab CI
84
77
 
@@ -99,10 +92,10 @@ subgroup's project is `group/sub/app:feat-x`, the scope a laptop on
99
92
  `feat-x` derives. A merge request pipeline names its source branch
100
93
  (`CI_MERGE_REQUEST_SOURCE_BRANCH_NAME`) in the project it lives in (a
101
94
  fork's `CI_MERGE_REQUEST_SOURCE_PROJECT_PATH`) and its diff base
102
- (`CI_MERGE_REQUEST_DIFF_BASE_SHA`), so vx diffs from it with no git
103
- call. A merge train's pipeline (`CI_MERGE_REQUEST_EVENT_TYPE=merge_train`)
104
- builds what lands on the target, so it is trusted: no scope, only the
105
- default keys. `gitlab({ cacheScope: false })` (`GitlabPluginOptions`) turns it off;
95
+ (`CI_MERGE_REQUEST_DIFF_BASE_SHA`), the base of a bare `--affected`.
96
+ A merge train's pipeline (`CI_MERGE_REQUEST_EVENT_TYPE=merge_train`)
97
+ builds what lands on the target, so it is trusted: no scope. As on
98
+ Actions, the scope keys only plugin entries. `gitlab({ cacheScope: false })` (`GitlabPluginOptions`) turns it off;
106
99
  `VX_CACHE_SCOPE` overrides it. Anywhere else `gitlab()` returns
107
100
  `undefined`, so declaring both plugins is safe. Merge request comments
108
101
  and reports are not part of it yet.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vzn/vx-ci",
3
- "version": "0.0.644",
3
+ "version": "0.0.645",
4
4
  "license": "MIT",
5
5
  "description": "GitHub Actions and GitLab CI integration for vx — a job summary on Actions and the branch cache scope on both.",
6
6
  "keywords": [
@@ -34,7 +34,7 @@
34
34
  "access": "public"
35
35
  },
36
36
  "peerDependencies": {
37
- "@vzn/vx": "^0.0.644"
37
+ "@vzn/vx": "^0.0.645"
38
38
  },
39
39
  "repository": {
40
40
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  // The cache scope and base commit a GitHub Actions run names through
2
- // `setBranch`: the default branch writes the default keys, a branch its own
3
- // scope, the one a laptop on that branch reads (owner, 2026-10-17).
2
+ // `setBranch`: none on the default branch, a branch its own scope, the one
3
+ // a laptop on that branch derives (owner, 2026-10-17).
4
4
  import { readFile } from 'node:fs/promises'
5
5
  import { type BranchFacts, branchCacheScope } from '@vzn/vx'
6
6
 
@@ -13,10 +13,10 @@ import { type BranchFacts, branchCacheScope } from '@vzn/vx'
13
13
  * derives. An event that runs in the default branch's context on a pull
14
14
  * request's behalf (`pull_request_target`, `issue_comment` on a PR, a
15
15
  * `workflow_run` a PR started) is the PR's, whatever `GITHUB_REF` says: a
16
- * workflow that checks out the PR's head there would otherwise write the
17
- * default keys. `issue_comment` names no branch, so it writes `pr-<n>`.
16
+ * workflow that checks out the PR's head there would otherwise share main's
17
+ * scope. `issue_comment` names no branch, so it writes `pr-<n>`.
18
18
  * A merge queue's run (`merge_group`) is trusted (owner, 2026-10-18): no
19
- * scope, only the default keys, compared with `merge_group.base_sha`.
19
+ * scope, compared with `merge_group.base_sha`.
20
20
  * `base`: a pull request's base commit (`pull_request.base.sha`), what its
21
21
  * merge checkout is compared with, no git call needed.
22
22
  */
package/src/gitlab.ts CHANGED
@@ -14,9 +14,9 @@ import {
14
14
  export interface GitlabPluginOptions {
15
15
  /**
16
16
  * Name the run's cache scope and base commit from GitLab's predefined
17
- * variables: the default branch and a merge train read and write the
18
- * default keys, any other branch `<project path>:<branch>`, and a merge
19
- * request is compared with its diff base. `VX_CACHE_SCOPE` beats it.
17
+ * variables: none on the default branch or a merge train, else
18
+ * `<project path>:<branch>`; a merge request is compared with its diff
19
+ * base. The scope keys plugin entries only. `VX_CACHE_SCOPE` beats it.
20
20
  * Default: on; `false` opts out.
21
21
  */
22
22
  cacheScope?: boolean
package/src/plugin.ts CHANGED
@@ -40,11 +40,11 @@ export interface GithubPluginOptions {
40
40
  /** Check-run name. Default: `'vx'`. */
41
41
  checkName?: string
42
42
  /**
43
- * Name the run's cache scope and base commit from the Actions event: a
44
- * push to the default branch keeps the default keys, a branch or its pull
45
- * request writes to `<owner>/<repo>:<branch>` (a fork's names the fork),
46
- * and a pull request is compared with its base commit. `VX_CACHE_SCOPE`
47
- * beats it. Default: on; `false` opts out.
43
+ * Name the run's cache scope and base commit from the Actions event: none
44
+ * on the default branch, else `<owner>/<repo>:<branch>` (a fork's names
45
+ * the fork); a pull request is compared with its base commit. The scope
46
+ * keys plugin entries only. `VX_CACHE_SCOPE` beats it. Default: on;
47
+ * `false` opts out.
48
48
  */
49
49
  cacheScope?: boolean
50
50
  /** Test seam — inject the append. Defaults to fs appendFile. */