@afix-ci/cli-linux-x64 0.1.0-rc.31 → 0.1.0-rc.38

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 (3) hide show
  1. package/README.md +74 -0
  2. package/cli +0 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,6 +2,72 @@
2
2
 
3
3
  A simple tool for running scripts and correcting their outputs
4
4
 
5
+ ## Prepare a pull request
6
+
7
+ `afix prepare-pr` updates the current branch with the selected remote's
8
+ advertised default branch, resolves configured smart-merge conflicts, runs
9
+ repository setup and the normal afix fix loop, then submits the result. The
10
+ working tree must be clean and HEAD must be attached to a local branch.
11
+ `--forge` and `--submit-method` are required:
12
+
13
+ ```sh
14
+ afix prepare-pr \
15
+ --forge github \
16
+ --submit-method dependent-pr \
17
+ --git-remote origin
18
+ ```
19
+
20
+ By default, preparation mutates the current checkout. Use `--worktree` to
21
+ prepare on a new afix-prefixed branch in a unique sibling worktree, leaving the
22
+ current checkout unchanged:
23
+
24
+ ```sh
25
+ afix prepare-pr --worktree \
26
+ --forge github \
27
+ --submit-method dependent-pr
28
+ ```
29
+
30
+ Add `--swap-branch` when the submitted branch must retain the current branch
31
+ name. This option requires `--worktree`: the host checkout moves to
32
+ `<current-branch>-pre-pr-backup`, while the submission worktree checks out the
33
+ original branch without changing its upstream tracking configuration.
34
+
35
+ Failures before submission do not push or open a pull request. In worktree
36
+ modes, the prepared checkout is retained; failures print its path for
37
+ inspection. Swap setup is transactional, but after setup succeeds its backup
38
+ branch is intentionally retained.
39
+
40
+ ### Repository preparation commands
41
+
42
+ An optional `[submit]` section can replace the built-in merge and run setup
43
+ after the upstream merge has been resolved:
44
+
45
+ ```toml
46
+ [submit]
47
+ pull_command = "git pull --no-edit origin main"
48
+ setup_command = "yarn install --immutable"
49
+ ```
50
+
51
+ Commands run directly in the prepared checkout without an implicit shell.
52
+ They also accept the full command form for explicit arguments and environment:
53
+
54
+ ```toml
55
+ [submit.pull_command]
56
+ bin = "git"
57
+ args = ["pull", "--no-edit", "origin", "main"]
58
+
59
+ [submit.setup_command]
60
+ bin = "yarn"
61
+ args = ["install", "--immutable"]
62
+ env = { CI = "true" }
63
+ ```
64
+
65
+ `pull_command` runs instead of the built-in merge, but afix still fetches the
66
+ advertised default target first and verifies that the command incorporated its
67
+ exact commit. `setup_command` runs only after a clean merge and before afix
68
+ loads validators and fixers. Relative binary paths are resolved within the
69
+ prepared checkout.
70
+
5
71
  ## Useful Commands
6
72
 
7
73
  ```sh
@@ -11,7 +77,15 @@ afix autoclass ado-init
11
77
  afix autoclass pull-logs --count=500
12
78
  # run metrics to generate graphs and csv to ./afix-metrics
13
79
  afix autoclass metrics
80
+ # render previously computed dwell history without scanning logs or reading Git
81
+ afix autoclass metrics --metrics-provider=static
14
82
  # pull unique PR ids from metrics csv
15
83
  cat afix-metrics/build-history.csv | python3 -c 'import csv,sys; seen=set(); [print(r["pr_id"]) for r in csv.DictReader(sys.stdin) if r["is_open"]=="true" and r["fixable"]=="true" and r["is_safe_submit"]=="true" and not (r["pr_id"] in seen or seen.add(r["pr_id"]))]' > afix-metrics/safe-pr-ids.log
16
84
  # fix all, sequentially
17
85
  ```
86
+
87
+ Metrics reports always use the current afix and smart-merge configuration.
88
+ Compute and `pull-logs` runs populate config-keyed build classification history
89
+ and commit-OID-keyed closure/token-usage facts in the shared SQLite cache.
90
+ Static reports read only those cached historical inputs; a build without
91
+ classification history for the current config is charted as `Unavailable`.
package/cli CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afix-ci/cli-linux-x64",
3
- "version": "0.1.0-rc.31",
3
+ "version": "0.1.0-rc.38",
4
4
  "license": "MIT",
5
5
  "os": [
6
6
  "linux"